forte2.mcopt.mc_optimizer ========================= .. py:module:: forte2.mcopt.mc_optimizer Module Contents --------------- .. py:class:: MCOptimizer Bases: :py:obj:`forte2.base_classes.active_space_solver.ActiveSpaceSolver` Two-step optimizer for multi-configurational wavefunctions. :Parameters: **states** : State | 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. **nroots** : int | 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. **weights** : list[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_space** : MOSpace, 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_orbitals** : list[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. **maxiter** : int, optional, default=50 Maximum number of macroiterations. **econv** : float, optional, default=1e-8 Energy convergence tolerance. **gconv** : float, optional, default=1e-7 Gradient convergence tolerance. **die_if_not_converged** : bool, optional, default=True If True, raises an error if the optimization does not converge. **optimize_frozen_orbs** : bool, optional, default=True Whether to optimize the frozen orbitals. **freeze_inter_gas_rots** : bool, optional, default=False Whether to freeze inter-GAS orbital rotations when multiple GASes are defined. **micro_maxiter** : int, optional, default=6 Maximum number of microiterations for L-BFGS. **max_rotation** : float, 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_diis** : bool, optional Whether DIIS acceleration is used. **diis_start** : int, optional, default=15 Start saving DIIS vectors after this many iterations. **diis_nvec** : int, optional, default=8 The number of vectors to keep in the DIIS. **diis_min** : int, optional, default=4 The minimum number of vectors to perform extrapolation. **do_transition_dipole** : bool, optional, default=False Whether to compute transition dipole moments. .. rubric:: 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). .. !! processed by numpydoc !! .. py:attribute:: active_frozen_orbitals :type: list[int] :value: None .. py:attribute:: optimize_frozen_orbs :type: bool :value: True .. py:attribute:: freeze_inter_gas_rots :type: bool :value: False .. py:attribute:: maxiter :type: int :value: 50 .. py:attribute:: econv :type: float :value: 1e-08 .. py:attribute:: gconv :type: float :value: 1e-07 .. py:attribute:: die_if_not_converged :type: bool :value: True .. py:attribute:: micro_maxiter :type: int :value: 6 .. py:attribute:: max_rotation :type: float :value: 0.2 .. py:attribute:: ci_maxiter :type: int :value: 100 .. py:attribute:: ci_econv :type: float :value: 1e-10 .. py:attribute:: ci_rconv :type: float :value: 1e-05 .. py:attribute:: ci_guess_per_root :type: int :value: 2 .. py:attribute:: ci_ndets_per_guess :type: int :value: 10 .. py:attribute:: ci_collapse_per_root :type: int :value: 2 .. py:attribute:: ci_basis_per_root :type: int :value: 4 .. py:attribute:: ci_energy_shift :type: float :value: None .. py:attribute:: do_diis :type: bool :value: None .. py:attribute:: diis_start :type: int :value: 15 .. py:attribute:: diis_nvec :type: int :value: 8 .. py:attribute:: diis_min :type: int :value: 4 .. py:attribute:: do_transition_dipole :type: bool :value: False .. py:attribute:: converged :type: bool :value: False .. py:attribute:: executed :type: bool :value: False .. py:attribute:: two_component :type: bool :value: False .. py:attribute:: dtype :type: type .. py:method:: run() Run the two-step orbital-CI optimization. :Returns: **self** : MCOptimizer The instance of the optimizer with the results stored in its attributes. .. !! processed by numpydoc !! .. py:class:: RelMCOptimizer Bases: :py:obj:`forte2.base_classes.active_space_solver.RelActiveSpaceSolver`, :py:obj:`MCOptimizer` Two-step optimizer for multi-configurational wavefunctions. :Parameters: **states** : State | 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. **nroots** : int | 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. **weights** : list[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_space** : MOSpace, 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_orbitals** : list[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. **maxiter** : int, optional, default=50 Maximum number of macroiterations. **econv** : float, optional, default=1e-8 Energy convergence tolerance. **gconv** : float, optional, default=1e-7 Gradient convergence tolerance. **die_if_not_converged** : bool, optional, default=True If True, raises an error if the optimization does not converge. **optimize_frozen_orbs** : bool, optional, default=True Whether to optimize the frozen orbitals. **freeze_inter_gas_rots** : bool, optional, default=False Whether to freeze inter-GAS orbital rotations when multiple GASes are defined. **micro_maxiter** : int, optional, default=6 Maximum number of microiterations for L-BFGS. **max_rotation** : float, 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_diis** : bool, optional Whether DIIS acceleration is used. **diis_start** : int, optional, default=15 Start saving DIIS vectors after this many iterations. **diis_nvec** : int, optional, default=8 The number of vectors to keep in the DIIS. **diis_min** : int, optional, default=4 The minimum number of vectors to perform extrapolation. **do_transition_dipole** : bool, optional, default=False Whether to compute transition dipole moments. .. rubric:: 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). .. !! processed by numpydoc !!