quri_parts.chem.mol package#
- class ActiveSpace(n_active_ele, n_active_orb, active_orbs_indices=None)#
Bases:
object
An immutable (frozen) dataclass representing a active space.
- Parameters:
n_active_ele (int) –
n_active_orb (int) –
active_orbs_indices (Sequence[int] | None) –
- n_active_ele: int#
number of active electrons.
- n_active_orb: int#
number of active orbitals.
- active_orbs_indices: Sequence[int] | None = None#
sequence of spatial orbital indices of the active orbitals.
- cas(n_active_ele, n_active_orb, active_orbs_indices=None)#
Convenient function for constructing the active space.
- Parameters:
n_active_ele (int) –
n_active_orb (int) –
active_orbs_indices (Sequence[int] | None) –
- Return type:
- class ActiveSpaceMolecularOrbitals(mo, active_space)#
Bases:
ActiveSpaceMolecularOrbitalsBase
Represents a data of the active space for the molecule.
- Parameters:
mo (MolecularOrbitals) –
MolecularOrbitals
for the molecule.active_space (ActiveSpace) –
ActiveSpace
for the molecule.
- property n_electron: int#
Returns a number of electrons.
- property spin: int#
Returns the total spin of the electrons.
- property n_active_ele: int#
Returns the number of active electrons.
- property n_core_ele: int#
Returns the number of core electrons.
- property n_ele_alpha: int#
Return the number of spin up electrons.
- property n_ele_beta: int#
Return the number of spin down electrons.
- property n_spatial_orb: int#
Returns the number of spatial orbitals.
- property n_active_orb: int#
Returns the number of active orbitals.
- property n_core_orb: int#
Returns the number of core orbitals.
- property n_vir_orb: int#
Returns the number of virtual orbitals.
- property mo_coeff: ndarray[Any, dtype[complex128]]#
Returns molecular orbital coefficients.
- get_core_and_active_orb()#
Returns a set of core and active orbitals.
The output orbitals are represented as the spatial orbital.
- Return type:
tuple[Sequence[int], Sequence[int]]
- orb_type(mo_index)#
Returns a type of the given orbital index.
- Parameters:
mo_index (int) – Orbital index.
- Return type:
- class ActiveSpaceMolecularOrbitalsBase(*args, **kwargs)#
Bases:
MolecularOrbitals
,ABC
- abstract property n_active_ele: int#
- abstract property n_core_ele: int#
- abstract property n_active_orb: int#
Returns the number of active orbitals.
- abstract property n_core_orb: int#
Returns the number of core orbitals.
- abstract property n_vir_orb: int#
Returns the number of virtual orbitals.
- abstract get_core_and_active_orb()#
- Return type:
tuple[Sequence[int], Sequence[int]]
- abstract orb_type(mo_index)#
- Parameters:
mo_index (int) –
- Return type:
- class AO1eInt(*args, **kwargs)#
Bases:
Protocol
Interface protocol for an atomic orbital one-electron integral.
- abstract property array: ndarray[Any, dtype[complex128]]#
Returns integral as numpy ndarray.
- abstract to_mo1int(mo_coeff)#
This method converts an atomic orbital one-electron integral into the molecular orbital one-electron integral.
- Parameters:
mo_coeff (ndarray[Any, dtype[complex128]]) – molecular orbital coefficients.
- Return type:
- class AO2eInt(*args, **kwargs)#
Bases:
Protocol
Interface protocol for an atomic orbital two-electron integral.
- abstract property array: ndarray[Any, dtype[complex128]]#
Returns integral as numpy ndarray.
- abstract to_mo2int(mo_coeff)#
This method converts an atomic orbital two-electron integral into the molecular orbital two-electron integral.
- Parameters:
mo_coeff (ndarray[Any, dtype[complex128]]) – molecular orbital coefficients.
- Return type:
- class AOeIntSet(*args, **kwargs)#
Bases:
Protocol
AOeIntSet holds a constant and the atomic orbital electron integrals.
- constant: float#
constant.
- to_full_space_mo_int(mo)#
Compute the full space spin mo integral.
- Parameters:
mo (MolecularOrbitals) –
- Return type:
- to_active_space_mo_int(active_space_mo)#
Compute the active space spin mo integral.
- Parameters:
active_space_mo (ActiveSpaceMolecularOrbitalsBase) –
- Return type:
- class AO1eIntArray(ao1eint_array)#
Bases:
AO1eInt
- Parameters:
ao1eint_array (npt.NDArray[np.complex128]) –
- property array: ndarray[Any, dtype[complex128]]#
Returns the ao 1-electron integrals in physicist’s notation.
- to_spatial_mo1int(mo_coeff)#
Returns the spatial mo 1-electron integrals in physicist’s notation.
- Parameters:
mo_coeff (ndarray[Any, dtype[complex128]]) –
- Return type:
- to_mo1int(mo_coeff)#
Returns the spin mo 1-electron integrals in physicist’s notation.
- Parameters:
mo_coeff (ndarray[Any, dtype[complex128]]) –
- Return type:
- class AO2eIntArray(ao2eint_array)#
Bases:
AO2eInt
- Parameters:
ao2eint_array (npt.NDArray[np.complex128]) –
- property array: ndarray[Any, dtype[complex128]]#
Returns the ao 2-electron integrals in physicist’s convention.
- to_spatial_mo2int(mo_coeff)#
Returns the spatial mo 2-electron integrals in physicist’s convention.
- Parameters:
mo_coeff (ndarray[Any, dtype[complex128]]) –
- Return type:
- to_mo2int(mo_coeff)#
Returns the spin mo 2-electron integrals in physicist’s convention.
- Parameters:
mo_coeff (ndarray[Any, dtype[complex128]]) –
- Return type:
- class AOeIntArraySet(constant: 'float', ao_1e_int: 'AO1eIntArray', ao_2e_int: 'AO2eIntArray')#
Bases:
AOeIntSet
- Parameters:
constant (float) –
ao_1e_int (AO1eIntArray) –
ao_2e_int (AO2eIntArray) –
- constant: float#
constant.
- ao_1e_int: AO1eIntArray#
atomic orbital one-electron integral
AO1eInt
.
- ao_2e_int: AO2eIntArray#
atomic orbital two-electron integral
AO2eInt
.
- to_full_space_mo_int(mo)#
Computes the full space spin mo integrals.
- Parameters:
mo (MolecularOrbitals) –
- Return type:
- to_full_space_spatial_mo_int(mo)#
Computes the full space spatial mo integrals.
- Parameters:
mo (MolecularOrbitals) –
- Return type:
- to_active_space_mo_int(active_space_mo)#
Computes the active space spin mo integrals.
Note: Does not provide speed advantage compared to PySCFAOeIntSet as it takes additional time to convert ao_eint to mo_eint. Performance penalty grows when the full space mo integral is large.
- Parameters:
active_space_mo (ActiveSpaceMolecularOrbitalsBase) –
- Return type:
- to_active_space_spatial_mo_int(active_space_mo)#
Computes the active space spatial mo integrals.
Note: Does not provide speed advantage compared to PySCFAOeIntSet as it takes additional time to convert ao_eint to mo_eint. Performance penalty grows when the full space mo integral is large.
- Parameters:
active_space_mo (ActiveSpaceMolecularOrbitalsBase) –
- Return type:
- class MolecularOrbitals(*args, **kwargs)#
Bases:
Protocol
Interface protocol for a data of the molecule.
- abstract property n_electron: int#
Returns the number of electrons.
- abstract property spin: int#
Returns the total spin of the electrons.
Note
We follow the quantum chemistry convention where:
\[N_{\alpha} - N_{\beta} = 2S\]and spin = 2S.
- abstract property n_spatial_orb: int#
Returns the number of spatial orbitals.
- abstract property mo_coeff: ndarray[Any, dtype[complex128]]#
Returns molecular orbital coefficients.
- class SpatialMO1eInt(*args, **kwargs)#
Bases:
Protocol
Interface protocol for a molecular orbital one-electron integral.
- abstract property array: ndarray[Any, dtype[complex128]]#
Returns integral as numpy ndarray.
- class SpatialMO1eIntArray(array)#
Bases:
SpatialMO1eInt
A class of a molecular orbital one-electron integral.
This interface has an integral as numpy ndarray.
- Parameters:
array (npt.NDArray[np.complex128]) –
- property array: ndarray[Any, dtype[complex128]]#
Returns integral as numpy ndarray.
- class SpatialMO2eInt(*args, **kwargs)#
Bases:
Protocol
Interface protocol for a molecular orbital two-electron integral.
- abstract property array: ndarray[Any, dtype[complex128]]#
Returns integral as numpy ndarray.
- class SpatialMO2eIntArray(array)#
Bases:
SpatialMO2eInt
A class of a molecular orbital two-electron integral.
This interface has an integral as numpy ndarray.
- Parameters:
array (npt.NDArray[np.complex128]) –
- property array: ndarray[Any, dtype[complex128]]#
Returns integral as numpy ndarray.
- class SpatialMOeIntSet(const, mo_1e_int, mo_2e_int)#
Bases:
NamedTuple
SpatialMOeIntSet holds a constant and a set of molecular orbital electron integral.
- Parameters:
const (float) –
mo_1e_int (SpatialMO1eInt) –
mo_2e_int (SpatialMO2eInt) –
- const: float#
constant.
- mo_1e_int: SpatialMO1eInt#
molecular orbital one-electron integral.
- mo_2e_int: SpatialMO2eInt#
molecular orbital two-electron integral.
- class SpinMO1eInt(*args, **kwargs)#
Bases:
Protocol
Interface protocol for a molecular spin orbital one-electron integral.
- abstract property array: ndarray[Any, dtype[complex128]]#
Returns integral as numpy ndarray.
- class SpinMO2eInt(*args, **kwargs)#
Bases:
Protocol
Interface protocol for a molecular spin orbital two-electron integral.
- abstract property array: ndarray[Any, dtype[complex128]]#
Returns integral as numpy ndarray.
- class SpinMO1eIntArray(array)#
Bases:
SpinMO1eInt
Stores the array of the 1-electron integrals.
- Parameters:
array (npt.NDArray[np.complex128]) –
- property array: ndarray[Any, dtype[complex128]]#
Returns integral as numpy ndarray.
- class SpinMO2eIntArray(array)#
Bases:
SpinMO2eInt
Stores the array of the 2-electron integrals.
- Parameters:
array (npt.NDArray[np.complex128]) –
- property array: ndarray[Any, dtype[complex128]]#
Returns integral as numpy ndarray.
- class SpinMOeIntSet(const, mo_1e_int, mo_2e_int)#
Bases:
NamedTuple
SpinMOeIntSet holds a constant and a set of molecular orbital electron integral.
- Parameters:
const (float) –
mo_1e_int (SpinMO1eInt) –
mo_2e_int (SpinMO2eInt) –
- const: float#
constant.
- mo_1e_int: SpinMO1eInt#
spin molecular orbital one-electron integral.
- mo_2e_int: SpinMO2eInt#
spin molecular orbital two-electron integral.
- convert_to_spin_orbital_indices(occupied_indices, active_indices)#
Convert each spatial occupied orbital indices and active orbitals indices into the spin occupied orbital indices and active spin indices.
- Parameters:
occupied_indices (Sequence[int]) – A Sequence of spatial occupied orbital indices.
active_indices (Sequence[int]) – A Sequence of spatial active orbital indices.
- Return type:
tuple[Sequence[int], Sequence[int]]
- get_active_space_spin_integrals_from_ao_eint(active_space_mo, electron_ao_ints)#
Compute the active space spin electron integrals from ao electron integrals.
- Parameters:
active_space_mo (ActiveSpaceMolecularOrbitalsBase) –
electron_ao_ints (AOeIntArraySet) –
- Return type:
- get_active_space_spatial_integrals_from_ao_eint(active_space_mo, electron_ao_ints)#
Compute the active space spatial electron integrals from ao electron integrals.
- Parameters:
active_space_mo (ActiveSpaceMolecularOrbitalsBase) –
electron_ao_ints (AOeIntArraySet) –
- Return type:
- get_active_space_spin_integrals_from_mo_eint(active_space_mo, electron_mo_ints)#
Compute the active space spin electron integrals from mo electron integrals.
- Parameters:
active_space_mo (ActiveSpaceMolecularOrbitalsBase) –
electron_mo_ints (SpatialMOeIntSet) –
- Return type:
- get_active_space_spatial_integrals_from_mo_eint(active_space_mo, electron_mo_ints)#
Compute the active space effective core energy and all the spin space electron integrals in the physicist’s convention.
Note: This function yields the active space electron integral faster than pyscf_get_active_space_integrals function in the quri_parts.pyscf package, as it stores the mo electron integrals on memory for computations.
- Parameters:
active_space_mo (ActiveSpaceMolecularOrbitalsBase) –
electron_mo_ints (SpatialMOeIntSet) –
- Return type:
- get_core_and_active_orbital_indices(n_active_ele, n_active_orb, n_electrons, active_orbs_indices=None)#
Returns sequences of spatial occupied orbital indices and active orbitals indices obtained from the number of active electrons, number of active orbitals, and number of total electrons.
- Parameters:
n_active_ele (int) – number of active electrons.
n_active_orb (int) – number of active orbitals.
n_electrons (int) – total number of electrons.
active_orbs_indices (Sequence[int] | None) – sequence of spatial orbital indices of the active orbitals.
- Return type:
tuple[Sequence[int], Sequence[int]]
- get_effective_active_space_core_energy(core_energy, mo_1e_int, mo_2e_int, core_spatial_orb_idx)#
Compute the effective active space core energy for a given active space configuration.
- Parameters:
core_energy (float) – The full space core erengy.
mo_1e_int (ndarray[Any, dtype[complex128]]) – The full space spatial mo 1-electron integral.
mo_2e_int (ndarray[Any, dtype[complex128]]) – The full space spatial mo 2-electron integral.
core_spatial_orb_idx (Sequence[int]) – The core spatial orbital indices.
- Return type:
float
- get_effective_active_space_1e_integrals(mo_1e_int, mo_2e_int, core_spatial_orb_idx, active_spatial_orb_idx)#
Compute the effective active space 1-electron spatial integral for a given active space configuration.
- Parameters:
mo_1e_int (ndarray[Any, dtype[complex128]]) – The orginal space spatial mo 1-electron integral.
mo_2e_int (ndarray[Any, dtype[complex128]]) – The orginal space spatial mo 2-electron integral.
core_spatial_orb_idx (Sequence[int]) – The core spatial orbital indices.
active_spatial_orb_idx (Sequence[int]) –
- Return type:
ndarray[Any, dtype[complex128]]
- get_effective_active_space_2e_integrals(mo_2e_int, active_spatial_orb_idx)#
Compute the effective active space 2-electron spatial integral for a given active space configuration.
- Parameters:
mo_1e_int – The orginal space spatial mo 1-electron integral.
mo_2e_int (ndarray[Any, dtype[complex128]]) – The orginal space spatial mo 2-electron integral.
core_spatial_orb_idx – The core spatial orbital indices.
active_spatial_orb_idx (Sequence[int]) –
- Return type:
ndarray[Any, dtype[complex128]]
- spatial_mo_eint_set_to_spin_mo_eint_set(spatial_mo_eint_set)#
Compute the spin space mo_eint_set from spatial mo_eint_set.
- Parameters:
spatial_mo_eint_set (SpatialMOeIntSet) –
- Return type:
- to_spin_orbital_integrals(n_spin_orb, spatial_1e_integrals, spatial_2e_integrals)#
Convert spatial orbital electron integrals to spin orbital electron integrals.
- Parameters:
n_spin_orb (int) –
spatial_1e_integrals (ndarray[Any, dtype[complex128]]) –
spatial_2e_integrals (ndarray[Any, dtype[complex128]]) –
- Return type:
tuple[ndarray[Any, dtype[complex128]], ndarray[Any, dtype[complex128]]]
- spatial_mo_1e_int_to_spin_mo_1e_int(n_spin_orb, spatial_1e_integrals)#
Convert spatial mo 1e electron integrals to spin mo 1e electron integrals.
- Parameters:
n_spin_orb (int) –
spatial_1e_integrals (ndarray[Any, dtype[complex128]]) –
- Return type:
ndarray[Any, dtype[complex128]]
- spatial_mo_2e_int_to_spin_mo_2e_int(n_spin_orb, spatial_2e_integrals)#
Convert spatial mo 2e electron integrals to spin mo 2e electron integrals.
- Parameters:
n_spin_orb (int) –
spatial_2e_integrals (ndarray[Any, dtype[complex128]]) –
- Return type:
ndarray[Any, dtype[complex128]]
Submodules#
- quri_parts.chem.mol.active_space module
- quri_parts.chem.mol.models module
OrbitalType
ActiveSpace
cas()
MolecularOrbitals
ActiveSpaceMolecularOrbitalsBase
ActiveSpaceMolecularOrbitalsBase.n_active_ele
ActiveSpaceMolecularOrbitalsBase.n_core_ele
ActiveSpaceMolecularOrbitalsBase.n_active_orb
ActiveSpaceMolecularOrbitalsBase.n_core_orb
ActiveSpaceMolecularOrbitalsBase.n_vir_orb
ActiveSpaceMolecularOrbitalsBase.get_core_and_active_orb()
ActiveSpaceMolecularOrbitalsBase.orb_type()
ActiveSpaceMolecularOrbitals
ActiveSpaceMolecularOrbitals.n_electron
ActiveSpaceMolecularOrbitals.spin
ActiveSpaceMolecularOrbitals.n_active_ele
ActiveSpaceMolecularOrbitals.n_core_ele
ActiveSpaceMolecularOrbitals.n_ele_alpha
ActiveSpaceMolecularOrbitals.n_ele_beta
ActiveSpaceMolecularOrbitals.n_spatial_orb
ActiveSpaceMolecularOrbitals.n_active_orb
ActiveSpaceMolecularOrbitals.n_core_orb
ActiveSpaceMolecularOrbitals.n_vir_orb
ActiveSpaceMolecularOrbitals.mo_coeff
ActiveSpaceMolecularOrbitals.get_core_and_active_orb()
ActiveSpaceMolecularOrbitals.orb_type()
AO1eInt
AO2eInt
AOeIntSet
SpatialMO1eInt
SpatialMO2eInt
SpatialMO1eIntArray
SpatialMO2eIntArray
SpatialMOeIntSet
SpinMO1eInt
SpinMO2eInt
SpinMO1eIntArray
SpinMO2eIntArray
SpinMOeIntSet
- quri_parts.chem.mol.non_relativistic_models module
AO1eIntArray
AO2eIntArray
AOeIntArraySet
get_effective_active_space_core_energy()
get_effective_active_space_1e_integrals()
get_effective_active_space_2e_integrals()
spatial_mo_1e_int_to_spin_mo_1e_int()
spatial_mo_2e_int_to_spin_mo_2e_int()
to_spin_orbital_integrals()
spatial_mo_eint_set_to_spin_mo_eint_set()
get_active_space_spatial_integrals_from_mo_eint()
get_active_space_spin_integrals_from_mo_eint()
get_active_space_spatial_integrals_from_ao_eint()
get_active_space_spin_integrals_from_ao_eint()