forte2.mcopt.mc_optimizer#
Module Contents#
- class forte2.mcopt.mc_optimizer.MCOptimizer#
Bases:
forte2.base_classes.active_space_solver.ActiveSpaceSolverTwo-step optimizer for multi-configurational wavefunctions.
- Parameters:
- statesState | list[State]
The electronic states for which the CI is solved. Can be a single state or a list of states. A state-averaged CI is performed if multiple states are provided.
- nrootsint | list[int], optional, default=1
The number of roots to compute. If a list is provided, each element corresponds to the number of roots for each state. If a single integer is provided, states must be a single State object.
- weightslist[float] | list[list[float]], optional
The weights for state averaging. If a list of lists is provided, each sublist corresponds to the weights for each state. The number of weights must match the number of roots for each state. If not provided, equal weights are assumed for all states. If a single list is provided, states must be a single State object.
- mo_spaceMOSpace, optional
A MOSpace object defining the partitioning of the molecular orbitals. If not provided, CISolver must be called with a parent method that has MOSpaceMixin (e.g., AVAS). If provided, it overrides the one from the parent method.
- 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.
- econvfloat, optional, default=1e-8
Energy convergence tolerance.
- gconvfloat, 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.
- optimize_frozen_orbsbool, optional, default=True
Whether to optimize the frozen orbitals.
- 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.
- ci_*various, optional
Various parameters for the CI solver. See CISolver for details. Available parameters: - ci_guess_per_root - ci_ndets_per_guess - ci_collapse_per_root - ci_basis_per_root - ci_maxiter - ci_econv - ci_rconv - ci_energy_shift All parameters have the same default values.
- do_diisbool, optional
Whether DIIS acceleration is used.
- diis_startint, optional, default=15
Start saving DIIS vectors after this many iterations.
- diis_nvecint, optional, default=8
The number of vectors to keep in the DIIS.
- diis_minint, optional, default=4
The minimum number of vectors to perform extrapolation.
- do_transition_dipolebool, optional, default=False
Whether to compute transition dipole moments.
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).
- active_frozen_orbitals: list[int] = None#
- optimize_frozen_orbs: bool = True#
- freeze_inter_gas_rots: bool = False#
- maxiter: int = 50#
- econv: float = 1e-08#
- gconv: float = 1e-07#
- die_if_not_converged: bool = True#
- micro_maxiter: int = 6#
- max_rotation: float = 0.2#
- ci_maxiter: int = 100#
- ci_econv: float = 1e-10#
- ci_rconv: float = 1e-05#
- ci_guess_per_root: int = 2#
- ci_ndets_per_guess: int = 10#
- ci_collapse_per_root: int = 2#
- ci_basis_per_root: int = 4#
- ci_energy_shift: float = None#
- do_diis: bool = None#
- diis_start: int = 15#
- diis_nvec: int = 8#
- diis_min: int = 4#
- do_transition_dipole: bool = False#
- converged: bool = False#
- executed: bool = False#
- two_component: bool = False#
- dtype: type#
- run()#
Run the two-step orbital-CI optimization.
- Returns:
- selfMCOptimizer
The instance of the optimizer with the results stored in its attributes.
- class forte2.mcopt.mc_optimizer.RelMCOptimizer#
Bases:
forte2.base_classes.active_space_solver.RelActiveSpaceSolver,MCOptimizerTwo-step optimizer for multi-configurational wavefunctions.
- Parameters:
- statesState | list[State]
The electronic states for which the CI is solved. Can be a single state or a list of states. A state-averaged CI is performed if multiple states are provided.
- nrootsint | list[int], optional, default=1
The number of roots to compute. If a list is provided, each element corresponds to the number of roots for each state. If a single integer is provided, states must be a single State object.
- weightslist[float] | list[list[float]], optional
The weights for state averaging. If a list of lists is provided, each sublist corresponds to the weights for each state. The number of weights must match the number of roots for each state. If not provided, equal weights are assumed for all states. If a single list is provided, states must be a single State object.
- mo_spaceMOSpace, optional
A MOSpace object defining the partitioning of the molecular orbitals. If not provided, CISolver must be called with a parent method that has MOSpaceMixin (e.g., AVAS). If provided, it overrides the one from the parent method.
- 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.
- econvfloat, optional, default=1e-8
Energy convergence tolerance.
- gconvfloat, 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.
- optimize_frozen_orbsbool, optional, default=True
Whether to optimize the frozen orbitals.
- 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.
- ci_*various, optional
Various parameters for the CI solver. See CISolver for details. Available parameters: - ci_guess_per_root - ci_ndets_per_guess - ci_collapse_per_root - ci_basis_per_root - ci_maxiter - ci_econv - ci_rconv - ci_energy_shift All parameters have the same default values.
- do_diisbool, optional
Whether DIIS acceleration is used.
- diis_startint, optional, default=15
Start saving DIIS vectors after this many iterations.
- diis_nvecint, optional, default=8
The number of vectors to keep in the DIIS.
- diis_minint, optional, default=4
The minimum number of vectors to perform extrapolation.
- do_transition_dipolebool, optional, default=False
Whether to compute transition dipole moments.
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).