View source on GitHub |
Class for storing molecule data from a fixed basis set at a fixed geometry that is obtained from classical electronic structure packages.
openfermion.chem.MolecularData(
geometry=None,
basis=None,
multiplicity=None,
charge=0,
description='',
filename='',
data_directory=None
)
Used in the notebooks
Used in the tutorials |
---|
Not every field is filled in every calculation. All data that can (for some instance) exceed 10 MB should be saved separately. Data saved in HDF5 format.
Methods
get_active_space_integrals
get_active_space_integrals(
occupied_indices=None, active_indices=None
)
Restricts a molecule at a spatial orbital level to an active space
This active space may be defined by a list of active indices and doubly occupied indices. Note that one_body_integrals and two_body_integrals must be defined n an orthonormal basis set.
Args | |
---|---|
occupied_indices
|
A list of spatial orbital indices indicating which orbitals should be considered doubly occupied. |
active_indices
|
A list of spatial orbital indices indicating which orbitals should be considered active. |
Returns | |
---|---|
tuple
|
Tuple with the following entries:
core_constant: Adjustment to constant shift in Hamiltonian from integrating out core orbitals one_body_integrals_new: one-electron integrals over active space. two_body_integrals_new: two-electron integrals over active space. |
get_antisym
get_antisym()
Method to return anti-symmetrized integrals in spin-orbital basis.
Returns | |
---|---|
antisymints
|
Numpy array of anti-symmetrized integrals in spin-
orbital basis |
Raises | |
---|---|
MissingCalculationError
|
If integrals are not calculated. |
get_from_file
get_from_file(
property_name
)
Helper routine to re-open HDF5 file and pull out single property
Args | |
---|---|
property_name
|
Property name to load from self.filename |
Returns | |
---|---|
The data located at file[property_name] for the HDF5 file at self.filename. Returns None if the key is not found in the file. |
get_integrals
get_integrals()
Method to return 1-electron and 2-electron integrals in MO basis.
Returns | |
---|---|
one_body_integrals
|
An array of the one-electron integrals having shape of (n_orbitals, n_orbitals). |
two_body_integrals
|
An array of the two-electron integrals having shape of (n_orbitals, n_orbitals, n_orbitals, n_orbitals). |
Raises | |
---|---|
MissingCalculationError
|
If integrals are not calculated. |
get_j
get_j()
Method to return coulomb matrix.
Returns | |
---|---|
k_matr
|
Numpy array of the coulomb integrals J_{p,q} = (pp|qq) (in chemist notation). |
Raises | |
---|---|
MissingCalculationError
|
If integrals are not calculated. |
get_k
get_k()
Method to return exchange matrix.
Returns | |
---|---|
k_matr
|
Numpy array of the coulomb integrals K_{p,q} = (pq|qp) (in chemist notation). |
Raises | |
---|---|
MissingCalculationError
|
If integrals are not calculated. |
get_molecular_hamiltonian
get_molecular_hamiltonian(
occupied_indices=None, active_indices=None
)
Output arrays of the second quantized Hamiltonian coefficients.
Args | |
---|---|
occupied_indices
|
list
A list of spatial orbital indices indicating which orbitals should be considered doubly occupied. |
active_indices
|
list
A list of spatial orbital indices indicating which orbitals should be considered active. |
Returns | |
---|---|
molecular_hamiltonian
|
An instance of the MolecularOperator class. |
Note | |
---|---|
The indexing convention used is that even indices correspond to spin-up (alpha) modes and odd indices correspond to spin-down (beta) modes. |
get_molecular_rdm
get_molecular_rdm(
use_fci=False
)
Method to return 1-RDM and 2-RDMs from CISD or FCI.
Args | |
---|---|
use_fci
|
Boolean indicating whether to use RDM from FCI calculation. |
Returns | |
---|---|
rdm
|
An instance of the MolecularRDM class. |
Raises | |
---|---|
MisissingCalculationError
|
If the CI calculation has not been performed. |
get_n_alpha_electrons
get_n_alpha_electrons()
Return number of alpha electrons.
get_n_beta_electrons
get_n_beta_electrons()
Return number of beta electrons.
init_lazy_properties
init_lazy_properties()
Initializes properties loaded on demand to None
load
load()
save
save()
Method to save the class under a systematic name.