forte2.mcopt.mc_optimizer ========================= .. py:module:: forte2.mcopt.mc_optimizer Module Contents --------------- .. py:class:: MCOptimizerBase Bases: :py:obj:`abc.ABC`, :py:obj:`forte2.base_classes.SystemMixin`, :py:obj:`forte2.base_classes.MOsMixin`, :py:obj:`forte2.base_classes.MOSpaceMixin` Two-step optimizer for multi-configurational wavefunctions. :Parameters: **ci_solver** : CIBase | RelCIBase The CI solver to use. This should be an instance of a class that inherits from CIBase or RelCIBase. **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. **e_tol** : float, optional, default=1e-8 Energy convergence tolerance. **g_tol** : 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. **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. **do_transition_dipole** : bool, optional, default=False Whether to compute and report transition dipole moments at the end of the optimization. **final_orbital** : str, optional, default="semicanonical" Whether to return the final orbitals in the semicanonical basis or the original basis. .. 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:: ci_solver :type: forte2.base_classes.CIBase | forte2.base_classes.RelCIBase .. py:attribute:: active_frozen_orbitals :type: list[int] :value: None .. py:attribute:: freeze_inter_gas_rots :type: bool :value: False .. py:attribute:: maxiter :type: int :value: 50 .. py:attribute:: e_tol :type: float :value: 1e-08 .. py:attribute:: g_tol :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:: do_transition_dipole :type: bool :value: False .. py:attribute:: final_orbital :type: str :value: 'semicanonical' .. py:attribute:: converged :type: bool :value: False .. py:attribute:: executed :type: bool :value: False .. 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:method:: make_average_1rdm() .. py:method:: make_average_2rdm() .. py:method:: make_average_2cumulant() .. py:method:: make_average_3rdm() .. py:method:: make_average_3cumulant() .. py:method:: make_average_cumulants() .. py:class:: MCOptimizer Bases: :py:obj:`MCOptimizerBase` Two-step optimizer for multi-configurational wavefunctions. :Parameters: **ci_solver** : CIBase | RelCIBase The CI solver to use. This should be an instance of a class that inherits from CIBase or RelCIBase. **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. **e_tol** : float, optional, default=1e-8 Energy convergence tolerance. **g_tol** : 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. **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. **do_transition_dipole** : bool, optional, default=False Whether to compute and report transition dipole moments at the end of the optimization. **final_orbital** : str, optional, default="semicanonical" Whether to return the final orbitals in the semicanonical basis or the original basis. .. 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:method:: make_sd_1rdm(left_root: int, right_root: int | None = None) -> tuple[numpy.typing.NDArray, numpy.typing.NDArray] .. py:method:: make_sd_2rdm(left_root: int, right_root: int | None = None) -> tuple[numpy.typing.NDArray, numpy.typing.NDArray, numpy.typing.NDArray] .. py:method:: make_sd_3rdm(left_root: int, right_root: int | None = None) -> tuple[numpy.typing.NDArray, numpy.typing.NDArray, numpy.typing.NDArray, numpy.typing.NDArray] .. py:method:: make_sf_1rdm(left_root: int, right_root: int | None = None) -> numpy.typing.NDArray .. py:method:: make_sf_2rdm(left_root: int, right_root: int | None = None) -> numpy.typing.NDArray