scine_autocas.autocas_utils.active_space¶
Determine the active space.
This module handles the active space search for a give set of diagnostics and system specific values.
Classes
|
A Class to store active space information and search for one. |
- class scine_autocas.autocas_utils.active_space.ActiveSpace(settings_dict=None)[source]¶
A Class to store active space information and search for one.
A active space is give for a give occupation and orbital indices.
Attributes
n_orbitals
(int) the number of orbitals in the active space search
n_electrons
(int) the number of electrons in the active space search
n_inactive_orbitals
(int) the number of inactive orbitals, to d subtract them from input occupations
orbitals_indices
(List[int]) the index of each orbital in the active space
occupation
(List[int]) the occupation of each orbital, e.g. 2, 1, 0
excluded
(bool) internal flag if orbitals were excluded from the active space
Notes
—–
The orbital_indices attribute indices start with 1.
- __slots__ = ('n_orbitals', 'n_electrons', 'n_inactive_orbitals', 'orbital_indices', 'occupation', 'excluded')¶
- __init__(settings_dict=None)[source]¶
Construct an ActiveSpace object.
At creation every list is assumend empty and will be filled by the provided methods. If a settings dir is provided, with attributes in it, these attributes will be overwritten.
- Parameters
- settings_dictDict[str, Any], optional
a dict, usually provided by the input_handler, which stores attributes and corresponding values
See also
settings_dict
InputHandler
- occupation: List[int]¶
List with orbital occupations for CAS, e.g. “2” doubly occupied, “1” singly occupied, “0” virtual”
- __doc__ = 'A Class to store active space information and search for one.\n\n A active space is give for a give occupation and orbital indices.\n\n Attributes\n ----------\n n_orbitals : int\n the number of orbitals in the active space search\n n_electrons : int\n the number of electrons in the active space search\n n_inactive_orbitals : int\n the number of inactive orbitals, to d subtract them from input occupations\n orbitals_indices : List[int]\n the index of each orbital in the active space\n occupation : List[int]\n the occupation of each orbital, e.g. 2, 1, 0\n excluded : bool\n internal flag if orbitals were excluded from the active space\n Notes\n -----\n The orbital_indices attribute indices start with 1.\n '¶
- __module__ = 'scine_autocas.autocas_utils.active_space'¶
- make_valence_cas(molecule)[source]¶
Make valence active space.
Creates the valence active space for the provided molecule object.
- Parameters
- moleculeMolecule
the molecule object to create an active space for
- _make_valence_occupation(molecule)[source]¶
Determine the number of electrons and orbitals, as well as the occupation for the provided molecule.
The electrons, orbtials and occupation here corresponds to the valence active space. The occupation is generated with respect to the corresponding spin multiplicity.
- Parameters
- moleculeMolecule
the molecule to determine the occupation for
- _make_valence_indices(molecule)[source]¶
Generate a list of indices for the valence active space.
The indices are either created from the number of basis functions of the number of valence orbitals. This depends on the provided molecule object.
- Parameters
- moleculeMolecule
the molecule to determine the cas indices for
- Notes
- —-_
- The orbital indices start with 1 for the first orbital.
- update(molecule, occupation, orbital_indices=None)[source]¶
Get the orbital occupation from aufbau principle.
If orbital_indices are provided, the aufbau principle here, means that the occupation will still be [2,2,0] even if the orbital_indices are [2,4,3]
- Parameters
- moleculeMolecule
the molecule object, which holds molecular system specific variables
- occupationList[int]
the orbital occupation, for each orbital in the active space
- orbital_indicesOptional[List[int]]
the orbital indices, for each orbital in the active space
- exclude_orbitals(diagnostics)[source]¶
Exclude weak correlated orbitals from active space.
If not active space can be found, autocas tries to exclude orbitals with low single orbital entropy. The functions removes the corresponding orbital indices and occupations from the class attributes.
- Parameters
- diagnosticsDiagnostics
object, which holds diffferent threshold values and provides functions for diagnostics.
- Returns
- s1_newList[float]
single orbital entropies, where low s1 values are removed
Notes
This function set the “excluded” attribute to True
- get_from_plateau(plateau_vector, orbitals_index)[source]¶
Get number of cas electrons and cas indices from plateau vector and orbitals_index.
The plateau vector contains orbital indices for the corresponding orbital_index list, which represents orbitals for an active space. This mapping is provided by the autoCAS class.
- Parameters
- plateau_vectorList[int]
contains indices from a found plateau
- orbitals_indexList[int]
sorted list of orbital indices