forte2.mcopt.mc_optimizer#

Module Contents#

class forte2.mcopt.mc_optimizer.MCOptimizerBase#

Bases: abc.ABC, forte2.base_classes.SystemMixin, forte2.base_classes.MOsMixin, forte2.base_classes.MOSpaceMixin

Two-step optimizer for multi-configurational wavefunctions.

Parameters:
ci_solverCIBase | RelCIBase

The CI solver to use. This should be an instance of a class that inherits from CIBase or RelCIBase.

active_frozen_orbitalslist[int], optional

List of active orbital indices to be frozen in the MCSCF optimization. If provided, all gradients involving these orbitals will be zeroed out.

maxiterint, optional, default=50

Maximum number of macroiterations.

e_tolfloat, optional, default=1e-8

Energy convergence tolerance.

g_tolfloat, optional, default=1e-7

Gradient convergence tolerance.

die_if_not_convergedbool, optional, default=True

If True, raises an error if the optimization does not converge.

freeze_inter_gas_rotsbool, optional, default=False

Whether to freeze inter-GAS orbital rotations when multiple GASes are defined.

micro_maxiterint, optional, default=6

Maximum number of microiterations for L-BFGS.

max_rotationfloat, optional, default=0.2

Maximum orbital rotation size for L-BFGS.

do_transition_dipolebool, optional, default=False

Whether to compute and report transition dipole moments at the end of the optimization.

final_orbitalstr, optional, default=”semicanonical”

Whether to return the final orbitals in the semicanonical basis or the original basis.

Notes

See J. Chem. Phys. 152, 074102 (2020) for the current implementation of a unified CASSCF/GASSCF gradient and diagonal Hessian. The non-GAS part of diagonal Hessian implementation follows Theor. Chem. Acc. 97, 88-95 (1997). An earlier implementation (CASSCF only) used J. Chem. Phys. 142, 224103 (2015).

ci_solver: forte2.base_classes.CIBase | forte2.base_classes.RelCIBase#
active_frozen_orbitals: list[int] = None#
freeze_inter_gas_rots: bool = False#
maxiter: int = 50#
e_tol: float = 1e-08#
g_tol: float = 1e-07#
die_if_not_converged: bool = True#
micro_maxiter: int = 6#
max_rotation: float = 0.2#
do_transition_dipole: bool = False#
final_orbital: str = 'semicanonical'#
converged: bool = False#
executed: bool = False#
run()#

Run the two-step orbital-CI optimization.

Returns:
selfMCOptimizer

The instance of the optimizer with the results stored in its attributes.

make_average_1rdm()#
make_average_2rdm()#
make_average_2cumulant()#
make_average_3rdm()#
make_average_3cumulant()#
make_average_cumulants()#
class forte2.mcopt.mc_optimizer.MCOptimizer#

Bases: MCOptimizerBase

Two-step optimizer for multi-configurational wavefunctions.

Parameters:
ci_solverCIBase | RelCIBase

The CI solver to use. This should be an instance of a class that inherits from CIBase or RelCIBase.

active_frozen_orbitalslist[int], optional

List of active orbital indices to be frozen in the MCSCF optimization. If provided, all gradients involving these orbitals will be zeroed out.

maxiterint, optional, default=50

Maximum number of macroiterations.

e_tolfloat, optional, default=1e-8

Energy convergence tolerance.

g_tolfloat, optional, default=1e-7

Gradient convergence tolerance.

die_if_not_convergedbool, optional, default=True

If True, raises an error if the optimization does not converge.

freeze_inter_gas_rotsbool, optional, default=False

Whether to freeze inter-GAS orbital rotations when multiple GASes are defined.

micro_maxiterint, optional, default=6

Maximum number of microiterations for L-BFGS.

max_rotationfloat, optional, default=0.2

Maximum orbital rotation size for L-BFGS.

do_transition_dipolebool, optional, default=False

Whether to compute and report transition dipole moments at the end of the optimization.

final_orbitalstr, optional, default=”semicanonical”

Whether to return the final orbitals in the semicanonical basis or the original basis.

Notes

See J. Chem. Phys. 152, 074102 (2020) for the current implementation of a unified CASSCF/GASSCF gradient and diagonal Hessian. The non-GAS part of diagonal Hessian implementation follows Theor. Chem. Acc. 97, 88-95 (1997). An earlier implementation (CASSCF only) used J. Chem. Phys. 142, 224103 (2015).

make_sd_1rdm(left_root: int, right_root: int | None = None) tuple[numpy.typing.NDArray, numpy.typing.NDArray]#
make_sd_2rdm(left_root: int, right_root: int | None = None) tuple[numpy.typing.NDArray, numpy.typing.NDArray, numpy.typing.NDArray]#
make_sd_3rdm(left_root: int, right_root: int | None = None) tuple[numpy.typing.NDArray, numpy.typing.NDArray, numpy.typing.NDArray, numpy.typing.NDArray]#
make_sf_1rdm(left_root: int, right_root: int | None = None) numpy.typing.NDArray#
make_sf_2rdm(left_root: int, right_root: int | None = None) numpy.typing.NDArray#