qrunch.chemistry.molecule.molecular_configuration
Module with the definition of a molecular configuration.
Module Attributes
Sentinel key used in a basis set dictionary to specify the default basis set for atoms not explicitly listed. |
Classes
Describes a molecular configuration of a molecule. |
- DEFAULT_BASIS = <qrunch.chemistry.molecule.molecular_configuration._DefaultBasisKey object>
Sentinel key used in a basis set dictionary to specify the default basis set for atoms not explicitly listed.
Example:
# Use cc-pvdz for all atoms, but 321g specifically for Carbon config = MolecularConfiguration( molecule=my_molecule, basis_set={ DEFAULT_BASIS: BasisSet.CCPVDZ, Atom("C"): BasisSet.POPLE_321G, }, )
- class MolecularConfiguration
Bases:
objectDescribes a molecular configuration of a molecule.
- __init__(molecule: Molecule, basis_set: BasisSet | dict[Atom, BasisSet] | dict[Atom | _DefaultBasisKey, BasisSet], charge: int = 0, spin_difference: int = 0, embedded_atoms: Sequence[int] | None = None, solvent: Solvent | None = None, aux_basis_set: BasisSet | dict[Atom, BasisSet] | dict[Atom | _DefaultBasisKey, BasisSet] | None = None) None
Initialize a molecular configuration.
- Parameters:
molecule (Molecule) – Molecule to specify configuration for.
basis_set (BasisSet | dict[Atom, BasisSet] | dict[Atom | _DefaultBasisKey, BasisSet]) –
Basis set to use for the atoms types in the molecule. Can be specified as:
A single
BasisSetto use for all atoms.A dictionary mapping
AtomtoBasisSetfor element-specific basis sets. UseDEFAULT_BASISas a key to specify a default basis set for any atoms not explicitly listed in the dictionary.
charge (int) – Overall charge of the molecule.
spin_difference (int) – Difference between the number of spin up and spin down electrons (default: 0).
embedded_atoms (Sequence[int] | None) – Optional field describing which atoms are embedded.
solvent (Solvent | None) – Solvent for the molecular configuration to be embedded in.
aux_basis_set (BasisSet | dict[Atom, BasisSet] | dict[Atom | _DefaultBasisKey, BasisSet] | None) – Auxiliary basis set, used for density fitting, to use for the atoms types in the molecule. Can be specified in the same way as
basis_set.
- Return type:
None
- atom_to_atomic_orbital_indices_map() dict[int, tuple[int, int]]
Return a map from the atom index to the start and end atomic orbital index.
- Return type:
dict[int, tuple[int, int]]
- property charge: int
Charge of the configuration.
- core_hamiltonian() ndarray[tuple[int, ...], dtype[float64]]
Return core hamiltonian in atomic basis.
- Return type:
ndarray[tuple[int, …], dtype[float64]]
- embedded_atoms_string() str
Provide a human-readable string representation for the embedded atoms.
- Return type:
str
- nuclear_repulsion_energy() float
Calculate the nuclear repulsion energy of the atoms in the molecule.
- Return type:
float
- number_of_alpha_electrons() int
Calculate number of alpha electrons.
- Return type:
int
- number_of_atomic_orbitals() int
Return the number of atomic orbitals.
- Return type:
int
- number_of_beta_electrons() int
Calculate number of beta electrons.
- Return type:
int
- number_of_electrons() int
Calculate the total number of electrons on the molecule.
- Return type:
int
- number_of_spatial_orbitals() int
Calculate the number of spatial orbitals.
- Return type:
int
- overlap_matrix() ndarray[tuple[int, ...], dtype[float64]]
Return the atomic orbital overlap matrix.
- Return type:
ndarray[tuple[int, …], dtype[float64]]
- property pyscf_molecule: Mole
Get the PySCF molecule.
- property spin_difference: int
Spin of the configuration.
- update_spin_and_charge(new_spin_difference: int, new_charge: int) None
Update both spin_difference and charge at the same time.
If both spin_difference and charge are changed separately, the intermediate molecule might fail validation. To avoid this, this method can be used instead.
- Parameters:
new_spin_difference (int) – new spin_difference to be set on the molecule.
new_charge (int) – new charge to be set on the molecule.
- Return type:
None