scine_autocas.autocas_utils.molecule

A molecular data container.

This module implementes the Molecule class, which stores all molecular system related data, which is required to set up calculations with autoCAS.

Classes

Molecule([xyz_file, atoms, charge, ...])

A class to provide useful information of a molecule.

class scine_autocas.autocas_utils.molecule.Molecule(xyz_file=None, atoms=None, charge=0, spin_multiplicity=1, n_basis_functions=0, double_d_shell=True, settings_dict=None)[source]

A class to provide useful information of a molecule.

A molecule object stores all system dependend information to set up a Hartree-Fock and post-HF calculations.

Attributes

atoms

(List[str]) contains the chemical element string for each atom in a molecule

core_orbitals

(int) the number of core orbitals

valence_orbitals

(int) the number of valence orbitals (occupied and virtual)

electrons

(int) the number of electrons

charge

(int) the total charge of the molecule

spin_multiplicity

(int) the total spin multiplicity (2S+1) of the molecule

double_d_shell

(bool) flag to add 4d orbitals to the number of valence orbitals for 3d transition metals

occupation

(List[int]) stores the occupation of all core and valence orbitals, e.g. 2 for doubly, 1 for singly and 0 for unoccupied.

__slots__ = ('atoms', 'core_orbitals', 'valence_orbitals', 'electrons', 'occupation', 'charge', 'spin_multiplicity', 'double_d_shell', 'n_basis_functions')
__init__(xyz_file=None, atoms=None, charge=0, spin_multiplicity=1, n_basis_functions=0, double_d_shell=True, settings_dict=None)[source]

Construct a molecule from any source of information.

At creation a molecule is first assumed to be in the lowest possible spin state with no charge, and later updated. See update function.

Parameters
xyz_filestr, optional

the location of an xyz-file storing the molecular geometry

atomsList[str], optional

a list containing element symbols for each atom in the molecule

chargeint, optional

the total charge of the molecule

spin_multiplicityint, optional

the spin_multiplicity (2s+1) of the molecule

n_basis_functionsint, optional

the number of basis functions if more virtual orbitals should be part of the valence space

double_d_shellbool, optional

flag to add 4d orbitals to total number of valence orbitals for 3rd row transition metals

settings_dictDict[str, Any], optional

holds all settings provided by a yaml input

Raises
ValueError

If no atomic information is provided.

See also

settings_dict

InputHandler

Notes

At least one of “xyz_file”, “atoms” or “settings_dict” (with similar information) has to be provided. For unrestriced calculations double occupations are still assumed in the occupation.

core_orbitals: int

the number of core orbitals

valence_orbitals: int

the number of valence orbitals (occupied and virtual)

electrons: int

the number of electrons

charge: int

the total charge of the molecule

spin_multiplicity: int

the total spin multiplicity (2S+1) of the molecule

n_basis_functions: int

number of basis functions

double_d_shell: bool

flag to add 4d orbitals to the number of valence orbitals for 3d transition metals

__doc__ = 'A class to provide useful information of a molecule.\n\n    A molecule object stores all system dependend information to set up\n    a Hartree-Fock and post-HF calculations.\n\n    Attributes\n    ----------\n    atoms : List[str]\n        contains the chemical element string for each atom in a molecule\n    core_orbitals : int\n        the number of core orbitals\n    valence_orbitals : int\n        the number of valence orbitals (occupied and virtual)\n    electrons : int\n        the number of electrons\n    charge : int\n        the total charge of the molecule\n    spin_multiplicity : int\n        the total spin multiplicity (2S+1) of the molecule\n    double_d_shell : bool\n        flag to add 4d orbitals to the number of valence orbitals for\n        3d transition metals\n    occupation : List[int]\n        stores the occupation of all core and valence orbitals,\n        e.g. 2 for doubly, 1 for singly and 0 for unoccupied.\n    '
__module__ = 'scine_autocas.autocas_utils.molecule'
occupation: List[int]

stores the occupation of all core and valence orbitals, e.g. 2 for doubly, 1 for singly and 0 for unoccupied.

atoms: List[str]

contains the chemical element string for each atom in a molecule

update()[source]

Update the molecular information.

This means the number of electrons is updated with respect to charge, 4d orbtials are included if necessary, the occupation is corrected with respect to spin and number of basis functions.

__setup_orbital_and_electrons(atoms, double_d_shell)

Set up orbitals and electrons.

This means the number of core and valence orbitals, as well as the number of electrons for the molecule is generated, based on all elements in the atoms list.

Parameters
atomsList[str]

every string has to be a symbol for an atom

double_d_shellbool

only important for 3rd row transition metals, if 4d orbitals are part of CAS.

__correct_charge(charge)

Update electrons with respect charge.

The number of electrons is subtracted by the provided charge.

Parameters
chargeint

total charge of the system

__correct_spin_multiplicity(spin_multiplicity)

Check spin multiplicity.

Parameters
spin_multiplicityint

the spin multiplicity, e.g. (2s+1)

Raises
ValueError

if the number of electrons prevents the spin multiplicity.

__setup_occupation(n_basis_functions=- 1)

Set up correct occupations.

Fills the occupation list by determining if an orbital is doubly, singly or not occupied, based on provided information.

Parameters
n_basis_functionsint, optional

the number of basis functions

Raises
ValueError

if number of basis functions is <= 0 or smaller than valence + core orbitals

get_atoms(xyz_file)[source]

Read atoms from XYZ file.

A list is filled with all element string occuring in the xyz file.

Parameters
xyz_filestr

path to the XYZ file

Returns
atomsList[str]

List of all atoms in the XYZ file

rtype

List[str] ..