forte2.orbitals.converters ========================== .. py:module:: forte2.orbitals.converters Module Contents --------------- .. py:function:: convert_coeff_spatial_to_spinor(C, complex=True) Convert spatial orbital MO coefficients to spinor(bital) MO coefficients :Parameters: **C** : list of NDArray The MO coefficients in spatial orbital basis. **complex** : bool, optional, default=True Whether to cast to complex dtype. :Returns: list of NDArray The MO coefficients in spinor(bital) basis. .. !! processed by numpydoc !! .. py:function:: list_spatial_to_spinor(lst) Convert a list of spatial orbital objects to a list of spinor orbital objects by either duplicating each element (RHF/ROHF case) or interleaving two lists (UHF case). :Parameters: **lst** : list of list of objects A list of lists of spatial orbital objects. The outer list is over spin (length 1 for RHF/ROHF, length 2 for UHF), and the inner lists are over nmos. :Returns: list[list] A list of spinor orbital objects. .. !! processed by numpydoc !! .. py:class:: SpinorUpcaster Bases: :py:obj:`forte2.base_classes.mixins.MOsMixin`, :py:obj:`forte2.base_classes.mixins.SystemMixin` A converter class to convert a spatial-orbital-based method to a spinor-based method by converting the MO coefficients to spinor basis and updating the system object. :Parameters: **x2c_type_override** : str | None, optional The type of X2C Hamiltonian to use. Must be either 'so' (spin-orbit) or 'sf' (spin-free). If provided, `System.x2c_type` will be overwritten by this value. If None, the X2C type will be determined by the `System` object. **snso_type_override** : str | None, optional The type of SNSO correction to use. Must be one of 'boettger', 'dc', 'dcb', or 'row-dependent'. If provided, `System.snso_type` will be overwritten by this value. If None, the SNSO type will be determined by the `System` object. **apply_random_phase** : bool, optional, default=False Whether to apply a random phase to the MO coefficients after conversion. This can be useful for testing the robustness of downstream methods to the choice of MO phases. **rng** : np.random.Generator or int, optional, default=np.random.default_rng() The random number generator to use for generating the random phase. Can be an instance of `np.random.Generator` or an integer seed. .. !! processed by numpydoc !! .. py:attribute:: x2c_type_override :type: str | None :value: None .. py:attribute:: snso_type_override :type: str | None :value: None .. py:attribute:: apply_random_phase :type: bool :value: False .. py:attribute:: rng :type: numpy.random.Generator | int .. py:attribute:: executed :type: bool :value: False .. py:method:: run()