|
ampsci
High-precision calculations for one- and two-valence atomic systems
|
Functions and classes for Configuration Interaction calculations.
Main functions are:
Main Classes are:
Classes | |
| struct | ConfigInfo |
| Configuration metadata for a single CI level. More... | |
| class | CSF2 |
| Two-electron configuration state function (CSF). More... | |
| class | PsiJPi |
| Container for CI solutions in a single (J, parity) sector. More... | |
Functions | |
| double | CSF2_Coulomb (const Coulomb::QkTable &qk, DiracSpinor::Index v, DiracSpinor::Index w, DiracSpinor::Index x, DiracSpinor::Index y, int twoJ) |
| Antisymmetrised two-body Coulomb matrix element in the coupled CSF basis. | |
| double | CSF2_Sigma2 (const Coulomb::LkTable &Sk, DiracSpinor::Index v, DiracSpinor::Index w, DiracSpinor::Index x, DiracSpinor::Index y, int twoJ) |
| Two-body \( \Sigma_2 \) (MBPT) correction to CSF2_Coulomb(). | |
| double | CSF2_Breit (const Coulomb::WkTable &Bk, DiracSpinor::Index v, DiracSpinor::Index w, DiracSpinor::Index x, DiracSpinor::Index y, int twoJ) |
| Antisymmetrised two-body Breit matrix element in the coupled CSF basis. | |
| double | Sigma2_AB (const CI::CSF2 &A, const CI::CSF2 &B, int twoJ, const Coulomb::LkTable &Sk) |
| Two-body \( \Sigma_2 \) correction to Hab(). | |
| double | Breit_AB (const CI::CSF2 &A, const CI::CSF2 &B, int twoJ, const Coulomb::WkTable &Bk) |
| Breit correction to Hab(). | |
| double | Hab (const CI::CSF2 &A, const CI::CSF2 &B, int twoJ, const Coulomb::meTable< double > &h1, const Coulomb::QkTable &qk) |
| CI Hamiltonian matrix element between two two-electron CSFs. | |
| Coulomb::meTable< double > | calculate_h1_table (const std::vector< DiracSpinor > &ci_basis, const std::vector< DiracSpinor > &s1_basis_core, const std::vector< DiracSpinor > &s1_basis_excited, const Coulomb::QkTable &qk, bool include_Sigma1) |
| Builds the one-body Hamiltonian matrix element table for the CI basis. | |
| Coulomb::meTable< double > | calculate_h1_table (const std::vector< DiracSpinor > &ci_basis, const MBPT::CorrelationPotential &Sigma, bool include_Sigma1) |
| Builds the one-body Hamiltonian table using a precomputed CorrelationPotential. | |
| Coulomb::WkTable | calculate_Bk (const std::string &bk_filename, const HF::Breit *const pBr, const std::vector< DiracSpinor > &ci_basis, int max_k, bool no_new_integralsQ=false) |
| Builds or loads the two-body Breit integral table. | |
| std::vector< DiracSpinor > | basis_subset (const std::vector< DiracSpinor > &basis, const std::string &subset_string, const std::string &frozen_core_string="") |
Returns the subset of basis matching subset_string, excluding states in frozen_core_string. | |
| double | ReducedME (const LinAlg::View< const double > &cA, const std::vector< CI::CSF2 > &CSFAs, int twoJA, const LinAlg::View< const double > &cB, const std::vector< CI::CSF2 > &CSFBs, int twoJB, const Coulomb::meTable< double > &h, int K_rank, int Parity) |
| Reduced matrix element between two CI states (low-level overload). | |
| double | RME_CSF2 (const CI::CSF2 &X, int twoJX, const CI::CSF2 &V, int twoJV, const Coulomb::meTable< double > &h, int K_rank) |
| Reduced matrix element between two two-electron CSFs. | |
| std::pair< int, int > | Term_S_L (int l1, int l2, int twoJ, double gJ_target) |
| Determines the best-fit (S, L) term for a two-electron state by matching the g-factor. | |
| std::string | Term_Symbol (int two_J, int L, int two_S, int parity) |
| Returns spectroscopic term symbol string, e.g. "3P_1". | |
| std::string | Term_Symbol (int L, int two_S, int parity) |
| Returns term symbol without the J subscript, e.g. "3P". | |
| LinAlg::Matrix< double > | construct_Hci (const PsiJPi &psi, const Coulomb::meTable< double > &h1, const Coulomb::QkTable &qk, const Coulomb::WkTable *Bk=nullptr, const Coulomb::LkTable *Sk=nullptr) |
| Constructs the full CI Hamiltonian matrix in the CSF basis. | |
| double | ReducedME (const PsiJPi &As, std::size_t iA, const PsiJPi &Bs, std::size_t iB, const Coulomb::meTable< double > &h, int K_rank, int Parity) |
| Reduced matrix element between two CI states (PsiJPi overload). | |
| std::vector< PsiJPi > | configuration_interaction (const IO::InputBlock &input, const Wavefunction &wf) |
| Runs Configuration Interation: returns CI solutions for all requested J and parity values. | |
| PsiJPi | run_CI (const std::vector< DiracSpinor > &ci_sp_basis, int twoJ, int parity, int num_solutions, std::optional< double > all_below_cm, const Coulomb::meTable< double > &h1, const Coulomb::QkTable &qk, const Coulomb::WkTable &Bk, const Coulomb::LkTable &Sk, bool include_Sigma2, bool print_details, std::ostream &outstream=std::cout) |
| Constructs and solves the CI eigenvalue problem for a single J,pi. | |
| bool | operator== (const CSF2 &A, const CSF2 &B) |
| bool | operator!= (const CSF2 &A, const CSF2 &B) |
| std::vector< CSF2 > | form_CSFs (int twoJ, int parity, const std::vector< DiracSpinor > &cisp_basis) |
| Forms all two-electron CSFs with given total J and parity. | |
| struct CI::ConfigInfo |
| double CI::CSF2_Coulomb | ( | const Coulomb::QkTable & | qk, |
| DiracSpinor::Index | v, | ||
| DiracSpinor::Index | w, | ||
| DiracSpinor::Index | x, | ||
| DiracSpinor::Index | y, | ||
| int | twoJ | ||
| ) |
Antisymmetrised two-body Coulomb matrix element in the coupled CSF basis.
Evaluates the angular-reduced, antisymmetrised Coulomb interaction between two two-electron CSFs \( |vw; J\rangle \) and \( |xy; J\rangle \):
\[ \langle vw; J \| g \| xy; J \rangle = \eta_{vw}\eta_{xy} \sum_k (-1)^{j_v+j_x+k+J} \begin{Bmatrix} j_v & j_w & J \\ j_y & j_x & k \end{Bmatrix} Q^k_{vwxy} + \text{exchange}, \]
where \( \eta_{ab} = 1/\sqrt{2} \) if \( a = b \) (identical-particle normalisation) and 1 otherwise, and \( Q^k \) are the Coulomb integrals stored in qk.
| qk | Table of Coulomb \( Q^k \) integrals. |
| v,w | Indices of the bra single-particle states. |
| x,y | Indices of the ket single-particle states. |
| twoJ | Twice the total angular momentum 2J of the coupled pair. |
| double CI::CSF2_Sigma2 | ( | const Coulomb::LkTable & | Sk, |
| DiracSpinor::Index | v, | ||
| DiracSpinor::Index | w, | ||
| DiracSpinor::Index | x, | ||
| DiracSpinor::Index | y, | ||
| int | twoJ | ||
| ) |
Two-body \( \Sigma_2 \) (MBPT) correction to CSF2_Coulomb().
Evaluates the same angular reduction as CSF2_Coulomb(), but using the two-body \( \Sigma_2 \) integrals \( S^k \) stored in Sk in place of the Coulomb \( Q^k \) integrals. Adds the second-order MBPT correction to the two-electron interaction.
| Sk | Table of two-body \( \Sigma_2 \) ( \( L^k \)) integrals. |
| v,w | Indices of the bra single-particle states. |
| x,y | Indices of the ket single-particle states. |
| twoJ | Twice the total angular momentum 2J of the coupled pair. |
| double CI::CSF2_Breit | ( | const Coulomb::WkTable & | Bk, |
| DiracSpinor::Index | v, | ||
| DiracSpinor::Index | w, | ||
| DiracSpinor::Index | x, | ||
| DiracSpinor::Index | y, | ||
| int | twoJ | ||
| ) |
Antisymmetrised two-body Breit matrix element in the coupled CSF basis.
Evaluates the same angular reduction as CSF2_Coulomb(), but using the Breit \( B^k \) integrals stored in Bk.
| Bk | Table of Breit \( W^k \) integrals. |
| v,w | Indices of the bra single-particle states. |
| x,y | Indices of the ket single-particle states. |
| twoJ | Twice the total angular momentum 2J of the coupled pair. |
| double CI::Sigma2_AB | ( | const CI::CSF2 & | A, |
| const CI::CSF2 & | B, | ||
| int | twoJ, | ||
| const Coulomb::LkTable & | Sk | ||
| ) |
Two-body \( \Sigma_2 \) correction to Hab().
Evaluates the MBPT \( \Sigma_2 \) contribution to the CI matrix element using CSF2_Sigma2(). Add to Hab() to form the full CI+MBPT Hamiltonian matrix element.
| A,B | The two CSFs. |
| twoJ | Twice the total angular momentum 2J. |
| Sk | Table of \( \Sigma_2 \) ( \( L^k \)) integrals. |
| double CI::Breit_AB | ( | const CI::CSF2 & | A, |
| const CI::CSF2 & | B, | ||
| int | twoJ, | ||
| const Coulomb::WkTable & | Bk | ||
| ) |
Breit correction to Hab().
Evaluates the two-body Breit contribution to the CI matrix element using CSF2_Breit(). Add to Hab() to include the Breit interaction.
| A,B | The two CSFs. |
| twoJ | Twice the total angular momentum 2J. |
| Bk | Table of Breit \( W^k \) integrals. |
| double CI::Hab | ( | const CI::CSF2 & | A, |
| const CI::CSF2 & | B, | ||
| int | twoJ, | ||
| const Coulomb::meTable< double > & | h1, | ||
| const Coulomb::QkTable & | qk | ||
| ) |
CI Hamiltonian matrix element between two two-electron CSFs.
Computes \( H_{AB} = \langle A | \hat{H} | B \rangle \) using the Slater-Condon rules, including one-body terms from h1 (which may already incorporate \( \Sigma_1 \) corrections) and the two-body Coulomb interaction via CSF2_Coulomb().
Does NOT include \( \Sigma_2 \) or Breit corrections; add those via Sigma2_AB() and Breit_AB() respectively.
| A,B | The two CSFs. |
| twoJ | Twice the total angular momentum 2J. |
| h1 | Table of one-body matrix elements \( \langle a | h_1 | b \rangle \). |
| qk | Table of Coulomb \( Q^k \) integrals. |
| Coulomb::meTable< double > CI::calculate_h1_table | ( | const std::vector< DiracSpinor > & | ci_basis, |
| const std::vector< DiracSpinor > & | s1_basis_core, | ||
| const std::vector< DiracSpinor > & | s1_basis_excited, | ||
| const Coulomb::QkTable & | qk, | ||
| bool | include_Sigma1 | ||
| ) |
Builds the one-body Hamiltonian matrix element table for the CI basis.
Constructs a lookup table of single-particle matrix elements \( \langle a | h_1 | b \rangle \) for all pairs \( a, b \) in ci_basis. The diagonal elements are the HF single-particle energies.
If include_Sigma1 is true, the one-body MBPT \( \Sigma_1 \) correction is computed from the Coulomb integrals in qk using s1_basis_core and s1_basis_excited as the internal lines of the MBPT diagrams and added to the diagonal.
| ci_basis | Basis states for which table entries are needed. |
| s1_basis_core | Core states used as internal lines for \( \Sigma_1 \). |
| s1_basis_excited | Excited states used as internal lines for \( \Sigma_1 \). |
| qk | Table of Coulomb \( Q^k \) integrals. |
| include_Sigma1 | If true, add one-body MBPT \( \Sigma_1 \) corrections. |
ci_basis states are Hartree-Fock eigenstates, so off-diagonal HF terms vanish. | Coulomb::meTable< double > CI::calculate_h1_table | ( | const std::vector< DiracSpinor > & | ci_basis, |
| const MBPT::CorrelationPotential & | Sigma, | ||
| bool | include_Sigma1 | ||
| ) |
Builds the one-body Hamiltonian table using a precomputed CorrelationPotential.
Overload of calculate_h1_table() that uses a CorrelationPotential object (i.e., a precomputed \( \Sigma_1 \) operator) instead of computing MBPT diagrams on the fly. Preferred when a CorrelationPotential is available, as it is generally faster and more complete.
| ci_basis | Basis states for which table entries are needed. |
| Sigma | Precomputed one-body correlation potential \( \Sigma_1 \). |
| include_Sigma1 | If true, include \( \Sigma_1 \) corrections from Sigma. |
| Coulomb::WkTable CI::calculate_Bk | ( | const std::string & | bk_filename, |
| const HF::Breit *const | pBr, | ||
| const std::vector< DiracSpinor > & | ci_basis, | ||
| int | max_k, | ||
| bool | no_new_integralsQ = false |
||
| ) |
Builds or loads the two-body Breit integral table.
Computes Breit \( W^k \) integrals for all pairs in ci_basis using the Breit operator pBr. Results are cached to/from bk_filename.
If pBr is nullptr or no_new_integralsQ is true, no new integrals are computed; only cached values are loaded.
| bk_filename | Filename for caching the \( W^k \) table. |
| pBr | Pointer to Breit operator; if nullptr, returns empty table. |
| ci_basis | Basis for which Breit integrals are needed. |
| max_k | Maximum multipolarity k to include. |
| no_new_integralsQ | If true, skip computing any new integrals. |
| std::vector< DiracSpinor > CI::basis_subset | ( | const std::vector< DiracSpinor > & | basis, |
| const std::string & | subset_string, | ||
| const std::string & | frozen_core_string = "" |
||
| ) |
Returns the subset of basis matching subset_string, excluding states in frozen_core_string.
Filters basis to retain only states described by the ampsci basis-string notation (e.g., "20spdf") that are not part of the frozen core.
| basis | Full single-particle basis to filter. |
| subset_string | Basis-string specifying which states to keep. |
| frozen_core_string | Basis-string specifying core states to exclude. |
| double CI::ReducedME | ( | const LinAlg::View< const double > & | cA, |
| const std::vector< CI::CSF2 > & | CSFAs, | ||
| int | twoJA, | ||
| const LinAlg::View< const double > & | cB, | ||
| const std::vector< CI::CSF2 > & | CSFBs, | ||
| int | twoJB, | ||
| const Coulomb::meTable< double > & | h, | ||
| int | K_rank, | ||
| int | Parity | ||
| ) |
Reduced matrix element between two CI states (low-level overload).
Evaluates the reduced matrix element of a rank-K_rank tensor operator between two CI states:
\[ \redmatel{A}{T^K}{B} = \sum_{ij} c_i^A \, c_j^B \, \redmatel{\text{CSF}_i}{T^K}{\text{CSF}_j}, \]
where the single-particle reduced matrix elements are looked up from h.
| cA,cB | CI expansion coefficient vectors for states A and B. |
| CSFAs,CSFBs | CSF bases for states A and B respectively. |
| twoJA,twoJB | Twice the total angular momentum of states A and B. |
| h | Lookup table of single-particle reduced matrix elements. |
| K_rank | Rank of the tensor operator. |
| Parity | Parity of the operator (+1 or -1). |
| double CI::RME_CSF2 | ( | const CI::CSF2 & | X, |
| int | twoJX, | ||
| const CI::CSF2 & | V, | ||
| int | twoJV, | ||
| const Coulomb::meTable< double > & | h, | ||
| int | K_rank | ||
| ) |
Reduced matrix element between two two-electron CSFs.
Evaluates \( \redmatel{X; J_X}{T^K}{V; J_V} \) for a rank-K_rank one-body tensor operator using the standard 6j angular reduction, accounting for identical-particle normalisation factors.
| std::pair< int, int > CI::Term_S_L | ( | int | l1, |
| int | l2, | ||
| int | twoJ, | ||
| double | gJ_target | ||
| ) |
Determines the best-fit (S, L) term for a two-electron state by matching the g-factor.
Iterates over all allowed (S, L) combinations for given orbital angular momenta l1, l2 and total twoJ /2, and returns the pair whose Lande g-factor is closest to gJ_target.
| l1,l2 | Orbital angular momenta of the two electrons. |
| twoJ | Twice the total angular momentum 2J. |
| gJ_target | Target g-factor to match. |
| std::string CI::Term_Symbol | ( | int | two_J, |
| int | L, | ||
| int | two_S, | ||
| int | parity | ||
| ) |
Returns spectroscopic term symbol string, e.g. "3P_1".
| std::string CI::Term_Symbol | ( | int | L, |
| int | two_S, | ||
| int | parity | ||
| ) |
Returns term symbol without the J subscript, e.g. "3P".
| LinAlg::Matrix< double > CI::construct_Hci | ( | const PsiJPi & | psi, |
| const Coulomb::meTable< double > & | h1, | ||
| const Coulomb::QkTable & | qk, | ||
| const Coulomb::WkTable * | Bk = nullptr, |
||
| const Coulomb::LkTable * | Sk = nullptr |
||
| ) |
Constructs the full CI Hamiltonian matrix in the CSF basis.
Builds the symmetric matrix \( H_{AB} \) for all CSF pairs in psi, calling Hab() for each element and optionally adding Breit and \( \Sigma_2 \) corrections.
| psi | CI solution container holding the CSF basis and J/parity. |
| h1 | One-body matrix element table (may include \( \Sigma_1 \)). |
| qk | Coulomb \( Q^k \) integral table. |
| Bk | Pointer to Breit \( W^k \) table; ignored if nullptr. |
| Sk | Pointer to \( \Sigma_2 \) \( L^k \) table; ignored if nullptr. |
|
inline |
Reduced matrix element between two CI states (PsiJPi overload).
Convenience wrapper around the low-level ReducedME() overload. Extracts expansion coefficients and CSF lists from As and Bs for the requested solution indices iA and iB.
| As,Bs | CI solution containers for the two states. |
| iA,iB | Solution indices within As and Bs. |
| h | Lookup table of single-particle reduced matrix elements. |
| K_rank | Rank of the tensor operator. |
| Parity | Parity of the operator (+1 or -1). |
| std::vector< PsiJPi > CI::configuration_interaction | ( | const IO::InputBlock & | input, |
| const Wavefunction & | wf | ||
| ) |
Runs Configuration Interation: returns CI solutions for all requested J and parity values.
Reads options from input, the CI Input Block, and constructs the CI basis from wf, computes the required Coulomb (and optionally Breit and two-body MBPT) integrals, then calls run_CI() for each requested (J, parity) pair.
The returned vector contains one PsiJPi per {J, parity} combination, each holding the eigenvalues and CI expansion coefficients for the requested number of solutions.
As of writing, options are:
Always check for up-to-date options from command line: $ ampsci -i CI See also run_CI, which this function calls
| input | Input block containing CI options. |
| wf | Fully initialised Wavefunction object supplying the orbital basis and radial grid. |
| PsiJPi CI::run_CI | ( | const std::vector< DiracSpinor > & | ci_sp_basis, |
| int | twoJ, | ||
| int | parity, | ||
| int | num_solutions, | ||
| std::optional< double > | all_below_cm, | ||
| const Coulomb::meTable< double > & | h1, | ||
| const Coulomb::QkTable & | qk, | ||
| const Coulomb::WkTable & | Bk, | ||
| const Coulomb::LkTable & | Sk, | ||
| bool | include_Sigma2, | ||
| bool | print_details, | ||
| std::ostream & | outstream = std::cout |
||
| ) |
Constructs and solves the CI eigenvalue problem for a single J,pi.
Builds the CI+MBPT Hamiltonian matrix in the basis of two-electron configuration state functions (CSFs) with total angular momentum twoJ /2 and parity parity, then solves the eigenvalue problem to obtain CI energies and expansion coefficients.
The Hamiltonian includes:
h1 qk Bk (used if Bk is non-empty)Sk (used if include_Sigma2 is true, and Sk is non-empty)The number of solutions returned is controlled by num_solutions and all_below: if all_below is set it takes precedence and all eigenstates with total energy below the threshold are found.
| ci_sp_basis | Single-particle basis states spanning the CI space. |
| twoJ | Twice the total angular momentum, 2J (must be a non-negative even integer for two-electron systems). |
| parity | Parity of the sector: +1 (even) or -1 (odd). |
| num_solutions | Number of lowest eigenstates to find. Ignored if all_below_cm is set. Pass 0 to find all solutions. |
| all_below_cm | If set, find all eigenstates with total energy below this value (in cm^-1). Overrides num_solutions. |
| h1 | Table of one-body Hamiltonian matrix elements between single-particle basis states. |
| qk | Table of two-body Coulomb \( Q^k \) integrals. |
| Bk | Table of two-body Breit \( B^k \) integrals. Ignored (treated as absent) if the table is empty. |
| Sk | Table of two-body MBPT \( \Sigma_2 \) ( \( S^k \)) integrals. Only used when include_Sigma2 is true. |
| include_Sigma2 | If true, add two-body MBPT corrections from Sk to the CI Hamiltonian. |
| print_details | If true, print a breakdown of the leading configurations for each solution. Leads to very large output if num_solutions is large |
| outstream | Output stream for progress and results [default: stdout]. |
| std::vector< CSF2 > CI::form_CSFs | ( | int | twoJ, |
| int | parity, | ||
| const std::vector< DiracSpinor > & | cisp_basis | ||
| ) |
Forms all two-electron CSFs with given total J and parity.
Iterates over all pairs of single-particle states in cisp_basis and retains those whose angular momenta can be coupled to total \( J = \) twoJ /2 and whose combined parity equals parity. Duplicate pairs are excluded by construction.
| twoJ | Twice the total angular momentum 2J. |
| parity | Total parity: +1 (even) or -1 (odd). |
| cisp_basis | Single-particle basis from which CSFs are constructed. |