forte2.sci.sci#
Module Contents#
- class forte2.sci.sci.SelectedCISolver#
Bases:
forte2.base_classes.CIBaseA general configuration interaction (CI) solver class. This solver is can be called iteratively, e.g., in a MCSCF loop or a DSRG reference relaxation loop.
- Parameters:
- sci_paramsSelectedCIParams or list[SelectedCIParams], optional
Parameters specific to the selected CI algorithm. If a list is provided, it should have one entry per state. If only a single SelectedCIParams is provided, it will be used for all states.
- davidson_liu_paramsDavidsonLiuParams or list[DavidsonLiuParams], optional
Parameters for the Davidson-Liu iterative eigensolver. If a list is provided, it should have one entry per state. If only a single DavidsonLiuParams is provided, it will be used for all states.
- do_test_rdmsbool, optional, default=False
If True, compute and test the reduced density matrices (RDMs) after the CI calculation.
- log_levelint, optional
The logging level for the CI solver. Defaults to the global logger’s verbosity level.
- Attributes:
- sub_solverslist[_SelectedCISingleStateSolver]
A list of CI solvers for each state in the state-averaged CI.
- evar/evals_[per_solver/flat]list[NDArray] / NDArray
The variational eigenvalues (energies) computed by each sub-solver / concatenated into a single array.
- ept2_var_[per_solver/flat]list[NDArray] / NDArray
The PT2 correction due to the new variational determinants, computed by each sub-solver / concatenated into a single array.
- ept2_pt_[per_solver/flat]list[NDArray] / NDArray
The PT2 correction due to the perturbative determinants, computed by each sub-solver / concatenated into a single array.
- etot_[per_solver/flat]list[NDArray] / NDArray
The total energy (variational + PT2) computed by each sub-solver / concatenated into a single array.
- ENDArray
Alias for evar_flat, the variational energies of the CI roots.
- E_pt2NDArray
The total PT2 correction (variational + perturbative) for each CI root.
- E_totNDArray
Alias for etot_flat, the total energies of the CI roots.
- E_avgfloat
The average variational energy computed from the state-averaged CI roots.
- sci_params: forte2.base_classes.params.SelectedCIParams | list[forte2.base_classes.params.SelectedCIParams]#
- davidson_liu_params: forte2.base_classes.params.DavidsonLiuParams | list[forte2.base_classes.params.DavidsonLiuParams]#
- do_test_rdms: bool = False#
- log_level: int = 4#
- run()#
- compute_average_energy()#
Compute the average energy from the CI roots using the weights.
- Returns:
- float
Average energy of the CI roots.
- make_sd_1rdm(left_root: int, right_root: int | None = None)#
Make the spin-dependent one-particle RDM for two absolute CI roots.
- make_sf_1rdm(left_root: int, right_root: int | None = None)#
Make the spin-free one-particle RDM for two absolute CI roots.
- make_1rdm(left_root: int, right_root: int | None = None)#
Make the spin-free one-particle RDM for two absolute CI roots.
- make_average_1rdm()#
Make the average spin-free one-particle RDM from the CI vectors.
- Returns:
- NDArray
Average spin-free one-particle RDM.
- make_average_2rdm()#
Make the average spin-free two-particle RDM from the CI vectors.
- Returns:
- NDArray
Average spin-free two-particle RDM.
- set_ints(scalar, oei, tei)#
Set the active-space integrals for the CI solver.
- Parameters:
- scalarfloat
The scalar energy term.
- oeiNDArray
One-electron active-space integrals in the MO basis.
- teiNDArray
Two-electron active-space integrals in the MO basis.
- compute_natural_occupation_numbers()#
Compute the natural occupation numbers for the CI states.
- Returns:
- (norb, nroot) NDArray
The natural occupation numbers for each root.
- get_top_determinants(n=5)#
Get the top n determinants for each root based on their coefficients in the CI vector.
- Parameters:
- nint, optional, default=5
The number of top determinants to return.
- Returns:
- top_detslist[list[tuple[Determinant, float]]]]
top_dets[i] contains a list of tuples (Determinant, coefficient) for the i-th root.
- compute_transition_properties(C=None)#
Compute the transition dipole moments and oscillator strengths from the spin-free 1-TDMs. The results are stored in self.transition_dipoles and self.oscillator_strengths.
- reset_eigensolver()#
- get_convergence_status()#
- class forte2.sci.sci.SelectedCI#
Bases:
SelectedCISolverSelected CI solver specialized for a single CI calculation. (i.e., not used in a loop). See SelectedCISolver for all parameters and attributes.
- die_if_not_converged: bool = True#
- final_orbital: str = 'original'#
- do_transition_dipole: bool = False#
- log_level: int = 3#
- run()#