ffsim.MolecularData

class ffsim.MolecularData(*, core_energy, one_body_integrals, two_body_integrals, norb, nelec, atom=None, basis=None, spin=None, symmetry=None, mo_coeff=None, mo_occ=None, active_space=None, hf_energy=None, hf_mo_coeff=None, hf_mo_occ=None, mp2_energy=None, mp2_t2=None, ccsd_energy=None, ccsd_t1=None, ccsd_t2=None, cisd_energy=None, cisd_vec=None, sci_energy=None, sci_vec=None, fci_energy=None, fci_vec=None, dmrg_energy=None, dipole_integrals=None, orbital_symmetries=None)[source]

Bases: object

Class for storing molecular data.

Attributes

active_space

The molecular orbitals included in the active space.

atom

The coordinates of the atoms in the molecule.

basis

The basis set, e.g. "sto-6g".

ccsd_energy

The CCSD energy.

ccsd_t1

The CCSD t1 amplitudes.

ccsd_t2

The CCSD t2 amplitudes.

cisd_energy

The CISD energy.

cisd_vec

The CISD state vector.

dipole_integrals

The dipole integrals.

dmrg_energy

The DMRG energy.

fci_energy

The FCI energy.

fci_vec

The FCI state vector.

hamiltonian

The Hamiltonian defined by the molecular data.

hf_energy

The Hartree-Fock energy.

hf_mo_coeff

Hartree-Fock canonical orbital coefficients in the AO basis.

hf_mo_occ

Hartree-Fock canonical orbital occupancies.

mo_coeff

Molecular orbital coefficients in the AO basis.

mo_occ

Molecular orbital occupancies.

mole

The PySCF Mole class for this molecular data.

mp2_energy

The MP2 energy.

mp2_t2

The MP2 t2 amplitudes.

orbital_symmetries

The orbital symmetries.

scf

A PySCF SCF class for this molecular data.

sci_energy

The SCI energy.

sci_vec

The SCI state vector coefficients, spin alpha strings, and spin beta strings.

spin

The spin of the molecule.

symmetry

The symmetry of the molecule.

core_energy

The core energy.

one_body_integrals

The one-body integrals.

two_body_integrals

The two-body integrals in compressed format.

norb

The number of spatial orbitals.

nelec

The numbers of alpha and beta electrons.

active_space: list[int] | None = None

The molecular orbitals included in the active space.

atom: list[tuple[str, list[float]]] | None = None

The coordinates of the atoms in the molecule.

basis: str | None = None

The basis set, e.g. "sto-6g".

ccsd_energy: float | None = None

The CCSD energy.

ccsd_t1: ndarray | tuple[ndarray, ndarray] | None = None

The CCSD t1 amplitudes.

ccsd_t2: ndarray | tuple[ndarray, ndarray, ndarray] | None = None

The CCSD t2 amplitudes.

cisd_energy: float | None = None

The CISD energy.

cisd_vec: ndarray | None = None

The CISD state vector.

dipole_integrals: ndarray | None = None

The dipole integrals.

dmrg_energy: float | None = None

The DMRG energy.

fci_energy: float | None = None

The FCI energy.

fci_vec: ndarray | None = None

The FCI state vector.

hamiltonian[source]

The Hamiltonian defined by the molecular data.

hf_energy: float | None = None

The Hartree-Fock energy.

hf_mo_coeff: ndarray | None = None

Hartree-Fock canonical orbital coefficients in the AO basis.

hf_mo_occ: ndarray | None = None

Hartree-Fock canonical orbital occupancies.

mo_coeff: ndarray | None = None

Molecular orbital coefficients in the AO basis.

mo_occ: ndarray | None = None

Molecular orbital occupancies.

mole[source]

The PySCF Mole class for this molecular data.

mp2_energy: float | None = None

The MP2 energy.

mp2_t2: ndarray | tuple[ndarray, ndarray, ndarray] | None = None

The MP2 t2 amplitudes.

orbital_symmetries: list[str] | None = None

The orbital symmetries.

scf[source]

A PySCF SCF class for this molecular data.

sci_energy: float | None = None

The SCI energy.

sci_vec: tuple[ndarray, ndarray, ndarray] | None = None

The SCI state vector coefficients, spin alpha strings, and spin beta strings.

spin: int | None = None

The spin of the molecule.

symmetry: str | None = None

The symmetry of the molecule.

core_energy: float

The core energy.

one_body_integrals: ndarray

The one-body integrals.

two_body_integrals: ndarray

The two-body integrals in compressed format.

norb: int

The number of spatial orbitals.

nelec: tuple[int, int]

The numbers of alpha and beta electrons.

Methods

from_fcidump(file)

Initialize a MolecularData from an FCIDUMP file.

from_json(file[, compression])

Load a MolecularData from a (possibly compressed) JSON file.

from_scf(hartree_fock[, active_space])

Initialize a MolecularData object from a Hartree-Fock calculation.

run_ccsd([t1, t2, store_t1, store_t2])

Run CCSD and store results.

run_cisd(*[, store_cisd_vec])

Run CISD and store results.

run_fci(*[, store_fci_vec])

Run FCI and store results.

run_mp2(*[, store_t2])

Run MP2 and store results.

run_sci(*[, store_sci_vec])

Run SCI and store results.

to_fcidump(file)

Save data to disk in FCIDUMP format.

to_json(file[, compression])

Serialize to JSON format, optionally compressed, and save to disk.

static from_fcidump(file)[source]

Initialize a MolecularData from an FCIDUMP file.

Parameters:

file (str | bytes | PathLike) – The FCIDUMP file path.

Return type:

MolecularData

static from_json(file, compression=None)[source]

Load a MolecularData from a (possibly compressed) JSON file.

Parameters:
  • file (str | bytes | PathLike) – The file path to read from.

  • compression (str | None) – The compression algorithm, if any, which was used to compress the file. Options: "gzip", "bz2", "lzma".

Return type:

MolecularData

Returns: The MolecularData object.

static from_scf(hartree_fock, active_space=None)[source]

Initialize a MolecularData object from a Hartree-Fock calculation.

Parameters:
  • hartree_fock (SCF) – The Hartree-Fock object.

  • active_space (Iterable[int] | None) – An optional list of orbitals to use for the active space.

Return type:

MolecularData

run_ccsd(t1=None, t2=None, *, store_t1=False, store_t2=False)[source]

Run CCSD and store results.

Return type:

None

run_cisd(*, store_cisd_vec=False)[source]

Run CISD and store results.

Return type:

None

run_fci(*, store_fci_vec=False)[source]

Run FCI and store results.

Return type:

None

run_mp2(*, store_t2=False)[source]

Run MP2 and store results.

run_sci(*, store_sci_vec=False)[source]

Run SCI and store results.

Return type:

None

to_fcidump(file)[source]

Save data to disk in FCIDUMP format.

Note

The FCIDUMP format does not retain all information stored in the MolecularData object. To serialize a MolecularData object losslessly, use the to_json() method to save to JSON format.

Parameters:

file (str | bytes | PathLike) – The file path to save to.

Return type:

None

to_json(file, compression=None)[source]

Serialize to JSON format, optionally compressed, and save to disk.

Parameters:
  • file (str | bytes | PathLike) – The file path to save to.

  • compression (str | None) – The optional compression algorithm to use. Options: "gzip", "bz2", "lzma".

Return type:

None