A Graph-Based Algorithm for Computing Matrix Elements of Arbitrary Operators between Configuration State Functions
Abstract
We present a graph-based algorithm for computing matrix elements of arbitrary second-quantized operators between configuration state functions (CSFs) defined in a genealogical scheme. Unlike Slater determinants, CSFs are spin-adapted and offer a more compact representation of many-electron wave functions, but their use in quantum chemical methods is often hindered by the complexity of evaluating matrix elements. Our approach leverages a graphical representation to efficiently encode the expansion of CSFs in terms of Slater determinants without explicitly constructing the full expansion. The algorithm applies operator sequences directly to the graph and computes overlaps via graph traversal, yielding matrix elements, and is completely general for any operator sequence. Numerical tests demonstrate that the method achieves machine-level precision and outperforms explicit determinant expansion by several orders of magnitude. This framework opens new possibilities for CSF-based implementations in selected and stochastic configuration interaction methods.