QCSchema (qiskit_nature.second_q.formats.qcschema)

The documentation of this schema can be found [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

In our Python implementation of this schema, we are handling optional attributes of the schema a bit differently than how they work in a JSON or HDF5 container. Whereas in these latter cases, the attributes might not simply exist at all, in our Python data classes, the attributes will always be available but might simply take the value None. When dumping a Python instance of this schema to either file format, attributes which are None will be filtered, in order to ensure that loading and dumping the same data subsequently, does not change the available attributes.

It should also be noted, that optional attributes will not take “default” values on the schema object. Thus, it is up to the code reading from a schema instance, to handle None i.e. undefined values for a specific variable, for example using in its place a suitable default value instead.

Classes

QCBasisSet(center_data, atom_map, name[, ...])

A dataclass to store the information of the basis set used in the original calculation.

QCCenterData([electron_shells, ...])

A dataclass to store the information of a single atom/center in the basis set.

QCECPPotential(ecp_type, angular_momentum, ...)

A dataclass to store the information of an ECP in a basis set.

QCElectronShell(angular_momentum, ...)

A dataclass to store the information of a single electron shell in a basis set.

QCError(error_type, error_message)

A dataclass to store the failure information contained in a QCSchema.

QCModel(method, basis)

A dataclass to store the mathematical model information used in the original calculation.

QCProperties([calcinfo_nbasis, ...])

A dataclass to store the computed properties of the original calculation.

QCProvenance(creator, version, routine)

A dataclass to store the program information that generated the QCSchema file.

QCSchema(schema_name, schema_version, ...[, ...])

The full QCSchema as a dataclass.

QCSchemaInput(schema_name, schema_version, ...)

A dataclass containing all classical input components of the QCSchema.

QCTopology(symbols, geometry, schema_name, ...)

A dataclass to store the topological information of the physical system.

QCWavefunction(basis[, overlap, orbitals_a, ...])

A dataclass to store any additional computed wavefunction properties.

class QCBasisSet(center_data, atom_map, name, schema_version=None, schema_name=None, description=None)[source]

A dataclass to store the information of the basis set used in the original calculation.

For more information refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/auto_basis.html#basis-set-schema).

atom_map: Sequence[str]

The list of atomic kinds, indicating the keys used to store the basis in center_data.

center_data: Mapping[str, QCCenterData]

A dictionary mapping the keys provided by atom_map to their basis center data.

description: str | None = None

A description of this basis set.

classmethod from_dict(data)[source]

Constructs a schema object from a dictionary of data.

The dictionary provided to this method corresponds to the format as obtained by json.load from a JSON representation of the schema object according to the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

data (dict[str, Any]) – the data dictionary.

Returns:

An instance of the schema object.

Return type:

QCBasisSet

classmethod from_hdf5(h5py_data)

Constructs a schema object from an HDF5 object.

While the QCSchema is officially tailored to support JSON, HDF5 is supported as a more high-performance alternative and considered the standard within Qiskit Nature. Due to its similarities with JSON a 1-to-1 correspondence can be made between the two.

For more details refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/tech_discussion.html#json-and-hdf5).

Parameters:

h5py_data (str | Path | Group) – can be either the path to a file or an h5py.Group.

Returns:

An instance of the schema object.

Return type:

_QCBase

classmethod from_json(json_data)

Constructs a schema object from JSON.

The JSON data must match the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

json_data (str | bytes | Path) – can be either the path to a file or the json data directly provided as a str.

Returns:

An instance of the schema object.

Return type:

_QCBase

name: str

The name of the basis set.

schema_name: str | None = None

The name of this schema. This value is expected to be qcschema_basis.

schema_version: int | None = None

The version of this specific schema.

to_dict()

Converts the schema object to a dictionary.

Returns:

The dictionary representation of the schema object.

Return type:

dict[str, Any]

to_hdf5(group)[source]

Converts the schema object to HDF5.

Parameters:

group (Group) – the h5py group into which to store the object.

to_json()

Converts the schema object to JSON.

Returns:

The JSON representation of the schema object.

Return type:

str

class QCCenterData(electron_shells=None, ecp_electrons=None, ecp_potentials=None)[source]

A dataclass to store the information of a single atom/center in the basis set.

For more information refer to [here](https://github.com/MolSSI/QCSchema/blob/1d5ff3baa5/qcschema/dev/definitions.py#L146).

ecp_electrons: int | None = None

The number of electrons replaced by an ECP.

ecp_potentials: Sequence[QCECPPotential] | None = None

The list of effective core potentials for this element.

electron_shells: Sequence[QCElectronShell] | None = None

The list of electronic shells for this element.

classmethod from_dict(data)[source]

Constructs a schema object from a dictionary of data.

The dictionary provided to this method corresponds to the format as obtained by json.load from a JSON representation of the schema object according to the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

data (dict[str, Any]) – the data dictionary.

Returns:

An instance of the schema object.

Return type:

QCCenterData

classmethod from_hdf5(h5py_data)

Constructs a schema object from an HDF5 object.

While the QCSchema is officially tailored to support JSON, HDF5 is supported as a more high-performance alternative and considered the standard within Qiskit Nature. Due to its similarities with JSON a 1-to-1 correspondence can be made between the two.

For more details refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/tech_discussion.html#json-and-hdf5).

Parameters:

h5py_data (str | Path | Group) – can be either the path to a file or an h5py.Group.

Returns:

An instance of the schema object.

Return type:

_QCBase

classmethod from_json(json_data)

Constructs a schema object from JSON.

The JSON data must match the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

json_data (str | bytes | Path) – can be either the path to a file or the json data directly provided as a str.

Returns:

An instance of the schema object.

Return type:

_QCBase

to_dict()

Converts the schema object to a dictionary.

Returns:

The dictionary representation of the schema object.

Return type:

dict[str, Any]

to_hdf5(group)[source]

Converts the schema object to HDF5.

Parameters:

group (Group) – the h5py group into which to store the object.

to_json()

Converts the schema object to JSON.

Returns:

The JSON representation of the schema object.

Return type:

str

class QCECPPotential(ecp_type, angular_momentum, r_exponents, gaussian_exponents, coefficients)[source]

A dataclass to store the information of an ECP in a basis set.

For more information refer to [here](https://github.com/MolSSI/QCSchema/blob/1d5ff3baa5/qcschema/dev/definitions.py#L90).

angular_momentum: Sequence[int]

The angular momenta of this potential as a list of integers.

coefficients: Sequence[Sequence[float | str]]

The general contraction coefficients of this potential. The official spec stores these values as strings.

ecp_type: str

The type of this potential.

classmethod from_dict(data)

Constructs a schema object from a dictionary of data.

The dictionary provided to this method corresponds to the format as obtained by json.load from a JSON representation of the schema object according to the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

data (dict[str, Any]) – the data dictionary.

Returns:

An instance of the schema object.

Return type:

_QCBase

classmethod from_hdf5(h5py_data)

Constructs a schema object from an HDF5 object.

While the QCSchema is officially tailored to support JSON, HDF5 is supported as a more high-performance alternative and considered the standard within Qiskit Nature. Due to its similarities with JSON a 1-to-1 correspondence can be made between the two.

For more details refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/tech_discussion.html#json-and-hdf5).

Parameters:

h5py_data (str | Path | Group) – can be either the path to a file or an h5py.Group.

Returns:

An instance of the schema object.

Return type:

_QCBase

classmethod from_json(json_data)

Constructs a schema object from JSON.

The JSON data must match the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

json_data (str | bytes | Path) – can be either the path to a file or the json data directly provided as a str.

Returns:

An instance of the schema object.

Return type:

_QCBase

gaussian_exponents: Sequence[float | str]

The exponents of the gaussian terms. The official spec stores these values as strings.

r_exponents: Sequence[int]

The exponents of the r term.

to_dict()

Converts the schema object to a dictionary.

Returns:

The dictionary representation of the schema object.

Return type:

dict[str, Any]

to_hdf5(group)[source]

Converts the schema object to HDF5.

Parameters:

group (Group) – the h5py group into which to store the object.

to_json()

Converts the schema object to JSON.

Returns:

The JSON representation of the schema object.

Return type:

str

class QCElectronShell(angular_momentum, harmonic_type, exponents, coefficients)[source]

A dataclass to store the information of a single electron shell in a basis set.

For more information refer to [here](https://github.com/MolSSI/QCSchema/blob/1d5ff3baa5/qcschema/dev/definitions.py#L43).

angular_momentum: Sequence[int]

The angular momenta of this electron shell as a list of integers.

coefficients: Sequence[Sequence[float | str]]

The general contraction coefficients of this contracted shell. The official spec stores these values as strings.

exponents: Sequence[float | str]

The exponents of this contracted shell. The official spec stores these values as strings.

classmethod from_dict(data)

Constructs a schema object from a dictionary of data.

The dictionary provided to this method corresponds to the format as obtained by json.load from a JSON representation of the schema object according to the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

data (dict[str, Any]) – the data dictionary.

Returns:

An instance of the schema object.

Return type:

_QCBase

classmethod from_hdf5(h5py_data)

Constructs a schema object from an HDF5 object.

While the QCSchema is officially tailored to support JSON, HDF5 is supported as a more high-performance alternative and considered the standard within Qiskit Nature. Due to its similarities with JSON a 1-to-1 correspondence can be made between the two.

For more details refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/tech_discussion.html#json-and-hdf5).

Parameters:

h5py_data (str | Path | Group) – can be either the path to a file or an h5py.Group.

Returns:

An instance of the schema object.

Return type:

_QCBase

classmethod from_json(json_data)

Constructs a schema object from JSON.

The JSON data must match the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

json_data (str | bytes | Path) – can be either the path to a file or the json data directly provided as a str.

Returns:

An instance of the schema object.

Return type:

_QCBase

harmonic_type: str

The type of this shell.

to_dict()

Converts the schema object to a dictionary.

Returns:

The dictionary representation of the schema object.

Return type:

dict[str, Any]

to_hdf5(group)[source]

Converts the schema object to HDF5.

Parameters:

group (Group) – the h5py group into which to store the object.

to_json()

Converts the schema object to JSON.

Returns:

The JSON representation of the schema object.

Return type:

str

class QCError(error_type, error_message)[source]

A dataclass to store the failure information contained in a QCSchema.

For more information refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/spec_components.html#success).

error_message: str

A description of the error that was raised.

error_type: str

The type of error that was raised.

classmethod from_dict(data)

Constructs a schema object from a dictionary of data.

The dictionary provided to this method corresponds to the format as obtained by json.load from a JSON representation of the schema object according to the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

data (dict[str, Any]) – the data dictionary.

Returns:

An instance of the schema object.

Return type:

_QCBase

classmethod from_hdf5(h5py_data)

Constructs a schema object from an HDF5 object.

While the QCSchema is officially tailored to support JSON, HDF5 is supported as a more high-performance alternative and considered the standard within Qiskit Nature. Due to its similarities with JSON a 1-to-1 correspondence can be made between the two.

For more details refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/tech_discussion.html#json-and-hdf5).

Parameters:

h5py_data (str | Path | Group) – can be either the path to a file or an h5py.Group.

Returns:

An instance of the schema object.

Return type:

_QCBase

classmethod from_json(json_data)

Constructs a schema object from JSON.

The JSON data must match the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

json_data (str | bytes | Path) – can be either the path to a file or the json data directly provided as a str.

Returns:

An instance of the schema object.

Return type:

_QCBase

to_dict()

Converts the schema object to a dictionary.

Returns:

The dictionary representation of the schema object.

Return type:

dict[str, Any]

to_hdf5(group)

Converts the schema object to HDF5.

Parameters:

group (Group) – the h5py group into which to store the object.

to_json()

Converts the schema object to JSON.

Returns:

The JSON representation of the schema object.

Return type:

str

class QCModel(method, basis)[source]

A dataclass to store the mathematical model information used in the original calculation.

For more information refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/spec_components.html#model).

basis: str | QCBasisSet

The basis set used during the computation. This can be either a simple string or a full QCBasisSet specification.

classmethod from_dict(data)[source]

Constructs a schema object from a dictionary of data.

The dictionary provided to this method corresponds to the format as obtained by json.load from a JSON representation of the schema object according to the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

data (dict[str, Any]) – the data dictionary.

Returns:

An instance of the schema object.

Return type:

QCModel

classmethod from_hdf5(h5py_data)

Constructs a schema object from an HDF5 object.

While the QCSchema is officially tailored to support JSON, HDF5 is supported as a more high-performance alternative and considered the standard within Qiskit Nature. Due to its similarities with JSON a 1-to-1 correspondence can be made between the two.

For more details refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/tech_discussion.html#json-and-hdf5).

Parameters:

h5py_data (str | Path | Group) – can be either the path to a file or an h5py.Group.

Returns:

An instance of the schema object.

Return type:

_QCBase

classmethod from_json(json_data)

Constructs a schema object from JSON.

The JSON data must match the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

json_data (str | bytes | Path) – can be either the path to a file or the json data directly provided as a str.

Returns:

An instance of the schema object.

Return type:

_QCBase

method: str

The method used for the computation of this object.

to_dict()

Converts the schema object to a dictionary.

Returns:

The dictionary representation of the schema object.

Return type:

dict[str, Any]

to_hdf5(group)[source]

Converts the schema object to HDF5.

Parameters:

group (Group) – the h5py group into which to store the object.

to_json()

Converts the schema object to JSON.

Returns:

The JSON representation of the schema object.

Return type:

str

class QCProperties(calcinfo_nbasis=None, calcinfo_nmo=None, calcinfo_nalpha=None, calcinfo_nbeta=None, calcinfo_natom=None, return_energy=None, scf_one_electron_energy=None, scf_two_electron_energy=None, nuclear_repulsion_energy=None, nuclear_dipole_moment=None, scf_vv10_energy=None, scf_xc_energy=None, scf_dispersion_correction_energy=None, scf_dipole_moment=None, scf_total_energy=None, scf_iterations=None, mp2_same_spin_correlation_energy=None, mp2_opposite_spin_correlation_energy=None, mp2_singles_energy=None, mp2_doubles_energy=None, mp2_correlation_energy=None, mp2_total_energy=None, mp2_dipole_moment=None, ccsd_same_spin_correlation_energy=None, ccsd_opposite_spin_correlation_energy=None, ccsd_singles_energy=None, ccsd_doubles_energy=None, ccsd_correlation_energy=None, ccsd_total_energy=None, ccsd_prt_pr_correlation_energy=None, ccsd_prt_pr_total_energy=None, ccsdt_correlation_energy=None, ccsdt_total_energy=None, ccsdtq_correlation_energy=None, ccsdtq_total_energy=None, ccsd_dipole_moment=None, ccsd_prt_pr_dipole_moment=None, ccsdt_dipole_moment=None, ccsdtq_dipole_moment=None, ccsd_iterations=None, ccsdt_iterations=None, ccsdtq_iterations=None)[source]

A dataclass to store the computed properties of the original calculation.

For more information refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/auto_props.html#properties-schema).

calcinfo_nalpha: int | None = None

The number of alpha-spin electrons in the computation.

calcinfo_natom: int | None = None

The number of atoms in the computation.

calcinfo_nbasis: int | None = None

The number of basis functions in the computation.

calcinfo_nbeta: int | None = None

The number of beta-spin electrons in the computation.

calcinfo_nmo: int | None = None

The number of molecular orbitals in the computation.

ccsd_correlation_energy: float | None = None

The total CCSD correlation energy.

ccsd_dipole_moment: tuple[float, float, float] | None = None

The total CCSD X, Y, and Z dipole components.

ccsd_doubles_energy: float | None = None

The total CCSD doubles correlation energy.

ccsd_iterations: int | None = None

The number of CCSD iterations taken during the computation.

ccsd_opposite_spin_correlation_energy: float | None = None

The CCSD doubles correlation energy contribution from opposite-spin (e.g. singlet) correlations, without any user scaling.

ccsd_prt_pr_correlation_energy: float | None = None

The total CCSD(T) correlation energy.

ccsd_prt_pr_dipole_moment: tuple[float, float, float] | None = None

The total CCSD(T) X, Y, and Z dipole components.

ccsd_prt_pr_total_energy: float | None = None

The total CCSD(T) energy (i.e. the sum of the SCF energy and CCSD(T) correlation energy).

ccsd_same_spin_correlation_energy: float | None = None

The CCSD doubles correlation energy contribution from same-spin (e.g. triplet) correlations, without any user scaling.

ccsd_singles_energy: float | None = None

The CCSD singles correlation energy. This value is 0.0 except in ROHF.

ccsd_total_energy: float | None = None

The total CCSD energy (i.e. the sum of the SCF energy and CCSD correlation energy).

ccsdt_correlation_energy: float | None = None

The total CCSDT correlation energy.

ccsdt_dipole_moment: tuple[float, float, float] | None = None

The total CCSDT X, Y, and Z dipole components.

ccsdt_iterations: int | None = None

The number of CCSDT iterations taken during the computation.

ccsdt_total_energy: float | None = None

The total CCSDT energy (i.e. the sum of the SCF energy and CCSDT correlation energy).

ccsdtq_correlation_energy: float | None = None

The total CCSDTQ correlation energy.

ccsdtq_dipole_moment: tuple[float, float, float] | None = None

The total CCSDTQ X, Y, and Z dipole components.

ccsdtq_iterations: int | None = None

The number of CCSDTQ iterations taken during the computation.

ccsdtq_total_energy: float | None = None

The total CCSDTQ energy (i.e. the sum of the SCF energy and CCSDTQ correlation energy).

classmethod from_dict(data)

Constructs a schema object from a dictionary of data.

The dictionary provided to this method corresponds to the format as obtained by json.load from a JSON representation of the schema object according to the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

data (dict[str, Any]) – the data dictionary.

Returns:

An instance of the schema object.

Return type:

_QCBase

classmethod from_hdf5(h5py_data)

Constructs a schema object from an HDF5 object.

While the QCSchema is officially tailored to support JSON, HDF5 is supported as a more high-performance alternative and considered the standard within Qiskit Nature. Due to its similarities with JSON a 1-to-1 correspondence can be made between the two.

For more details refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/tech_discussion.html#json-and-hdf5).

Parameters:

h5py_data (str | Path | Group) – can be either the path to a file or an h5py.Group.

Returns:

An instance of the schema object.

Return type:

_QCBase

classmethod from_json(json_data)

Constructs a schema object from JSON.

The JSON data must match the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

json_data (str | bytes | Path) – can be either the path to a file or the json data directly provided as a str.

Returns:

An instance of the schema object.

Return type:

_QCBase

mp2_correlation_energy: float | None = None

The total MP2 correlation energy.

mp2_dipole_moment: tuple[float, float, float] | None = None

The total MP2 X, Y, and Z dipole components.

mp2_doubles_energy: float | None = None

The total MP2 doubles correlation energy.

mp2_opposite_spin_correlation_energy: float | None = None

The MP2 doubles correlation energy contribution from opposite-spin (e.g. singlet) correlations, without any user scaling.

mp2_same_spin_correlation_energy: float | None = None

The MP2 doubles correlation energy contribution from same-spin (e.g. triplet) correlations, without any user scaling.

mp2_singles_energy: float | None = None

The MP2 singles correlation energy. This value is 0.0 except in ROHF.

mp2_total_energy: float | None = None

The total MP2 energy (i.e. the sum of the SCF energy and MP2 correlation energy).

nuclear_dipole_moment: tuple[float, float, float] | None = None

The nuclear X, Y, and Z dipole components.

nuclear_repulsion_energy: float | None = None

The nuclear repulsion energy contribution to the total SCF energy.

return_energy: float | None = None

The returned energy of the computation. When QCSchemaInput.driver is energy, this value is identical to QCSchema.return_result.

scf_dipole_moment: tuple[float, float, float] | None = None

The total SCF X, Y, and Z dipole components.

scf_dispersion_correction_energy: float | None = None

The dispersion correction appended to the underlying functional in a DFT-D method.

scf_iterations: int | None = None

The number of SCF iterations taken during the computation.

scf_one_electron_energy: float | None = None

The one-electron energy contribution to the total SCF energy.

scf_total_energy: float | None = None

The total SCF energy.

scf_two_electron_energy: float | None = None

The two-electron energy contribution to the total SCF energy.

scf_vv10_energy: float | None = None

The VV10 functional energy contribution to the total SCF energy.

scf_xc_energy: float | None = None

The XC functional energy contribution to the total SCF energy.

to_dict()

Converts the schema object to a dictionary.

Returns:

The dictionary representation of the schema object.

Return type:

dict[str, Any]

to_hdf5(group)

Converts the schema object to HDF5.

Parameters:

group (Group) – the h5py group into which to store the object.

to_json()

Converts the schema object to JSON.

Returns:

The JSON representation of the schema object.

Return type:

str

class QCProvenance(creator, version, routine)[source]

A dataclass to store the program information that generated the QCSchema file.

For more information refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/spec_components.html#provenance).

creator: str

The name of the creator of this object.

classmethod from_dict(data)

Constructs a schema object from a dictionary of data.

The dictionary provided to this method corresponds to the format as obtained by json.load from a JSON representation of the schema object according to the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

data (dict[str, Any]) – the data dictionary.

Returns:

An instance of the schema object.

Return type:

_QCBase

classmethod from_hdf5(h5py_data)

Constructs a schema object from an HDF5 object.

While the QCSchema is officially tailored to support JSON, HDF5 is supported as a more high-performance alternative and considered the standard within Qiskit Nature. Due to its similarities with JSON a 1-to-1 correspondence can be made between the two.

For more details refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/tech_discussion.html#json-and-hdf5).

Parameters:

h5py_data (str | Path | Group) – can be either the path to a file or an h5py.Group.

Returns:

An instance of the schema object.

Return type:

_QCBase

classmethod from_json(json_data)

Constructs a schema object from JSON.

The JSON data must match the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

json_data (str | bytes | Path) – can be either the path to a file or the json data directly provided as a str.

Returns:

An instance of the schema object.

Return type:

_QCBase

routine: str

The routine that was used to create this object.

to_dict()

Converts the schema object to a dictionary.

Returns:

The dictionary representation of the schema object.

Return type:

dict[str, Any]

to_hdf5(group)

Converts the schema object to HDF5.

Parameters:

group (Group) – the h5py group into which to store the object.

to_json()

Converts the schema object to JSON.

Returns:

The JSON representation of the schema object.

Return type:

str

version: str

The version of the creator of this object.

class QCSchema(schema_name, schema_version, molecule, driver, model, keywords, provenance, return_result, success, properties, error=None, wavefunction=None)[source]

The full QCSchema as a dataclass.

For more information refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/spec_components.html#output-components).

driver: str

The type of computation. Example values are energy, gradient, and hessian.

error: QCError | None = None

An instance of QCError if the computation was not successful (success = False).

classmethod from_dict(data)[source]

Constructs a schema object from a dictionary of data.

The dictionary provided to this method corresponds to the format as obtained by json.load from a JSON representation of the schema object according to the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

data (dict[str, Any]) – the data dictionary.

Returns:

An instance of the schema object.

Return type:

QCSchema

classmethod from_hdf5(h5py_data)

Constructs a schema object from an HDF5 object.

While the QCSchema is officially tailored to support JSON, HDF5 is supported as a more high-performance alternative and considered the standard within Qiskit Nature. Due to its similarities with JSON a 1-to-1 correspondence can be made between the two.

For more details refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/tech_discussion.html#json-and-hdf5).

Parameters:

h5py_data (str | Path | Group) – can be either the path to a file or an h5py.Group.

Returns:

An instance of the schema object.

Return type:

_QCBase

classmethod from_json(json_data)

Constructs a schema object from JSON.

The JSON data must match the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

json_data (str | bytes | Path) – can be either the path to a file or the json data directly provided as a str.

Returns:

An instance of the schema object.

Return type:

_QCBase

keywords: Mapping[str, Any]

Any additional program-specific parameters.

model: QCModel

An instance of QCModel.

molecule: QCTopology

An instance of QCTopology.

properties: QCProperties

An instance of QCProperties.

provenance: QCProvenance

An instance of QCProvenance.

return_result: float | Sequence[float]

The primary result of the computation. Its value depends on the type of computation (see also driver).

schema_name: str

The name of this schema. This value is expected to be qcschema or qc_schema.

schema_version: int

The version of this specific schema.

success: bool

Whether the computation was successful.

to_dict()

Converts the schema object to a dictionary.

Returns:

The dictionary representation of the schema object.

Return type:

dict[str, Any]

to_hdf5(group)[source]

Converts the schema object to HDF5.

Parameters:

group (Group) – the h5py group into which to store the object.

to_json()

Converts the schema object to JSON.

Returns:

The JSON representation of the schema object.

Return type:

str

wavefunction: QCWavefunction | None = None

An instance of QCWavefunction.

class QCSchemaInput(schema_name, schema_version, molecule, driver, model, keywords)[source]

A dataclass containing all classical input components of the QCSchema.

For more information refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/spec_components.html#input-components).

driver: str

The type of computation. Example values are energy, gradient, and hessian.

classmethod from_dict(data)[source]

Constructs a schema object from a dictionary of data.

The dictionary provided to this method corresponds to the format as obtained by json.load from a JSON representation of the schema object according to the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

data (dict[str, Any]) – the data dictionary.

Returns:

An instance of the schema object.

Return type:

QCSchemaInput

classmethod from_hdf5(h5py_data)

Constructs a schema object from an HDF5 object.

While the QCSchema is officially tailored to support JSON, HDF5 is supported as a more high-performance alternative and considered the standard within Qiskit Nature. Due to its similarities with JSON a 1-to-1 correspondence can be made between the two.

For more details refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/tech_discussion.html#json-and-hdf5).

Parameters:

h5py_data (str | Path | Group) – can be either the path to a file or an h5py.Group.

Returns:

An instance of the schema object.

Return type:

_QCBase

classmethod from_json(json_data)

Constructs a schema object from JSON.

The JSON data must match the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

json_data (str | bytes | Path) – can be either the path to a file or the json data directly provided as a str.

Returns:

An instance of the schema object.

Return type:

_QCBase

keywords: Mapping[str, Any]

Any additional program-specific parameters.

model: QCModel

An instance of QCModel.

molecule: QCTopology

An instance of QCTopology.

schema_name: str

The name of this schema. This value is expected to be qcschema or qc_schema.

schema_version: int

The version of this specific schema.

to_dict()

Converts the schema object to a dictionary.

Returns:

The dictionary representation of the schema object.

Return type:

dict[str, Any]

to_hdf5(group)[source]

Converts the schema object to HDF5.

Parameters:

group (Group) – the h5py group into which to store the object.

to_json()

Converts the schema object to JSON.

Returns:

The JSON representation of the schema object.

Return type:

str

class QCTopology(symbols, geometry, schema_name, schema_version, molecular_charge=None, molecular_multiplicity=None, fix_com=None, real=None, connectivity=None, fix_orientation=None, atom_labels=None, fragment_multiplicities=None, fix_symmetry=None, fragment_charges=None, mass_numbers=None, name=None, masses=None, comment=None, provenance=None, fragments=None, atomic_numbers=None)[source]

A dataclass to store the topological information of the physical system.

For more information refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/spec_components.html#topology).

atom_labels: Sequence[str] | None = None

A list of user-provided information for each atom. Its length must match that of the symbols list.

atomic_numbers: Sequence[int] | None = None

The atomic numbers of all atoms, indicating their nuclear charge. Its length must match that of the symbols list.

comment: str | None = None

Any additional (user-provided) comment.

connectivity: Sequence[tuple[int, int, int]] | None = None

A list indicating the bonds between the atoms in the molecule. Each item of this list must be a tuple of three integers, indicating the first atom index in the bond, the second atom index, and finally the order of the bond.

fix_com: bool | None = None

Whether translation of the geometry is allowed (False) or not (True).

fix_orientation: bool | None = None

Whether rotation of the geometry is allowed (False) or not (True).

fix_symmetry: str | None = None

The maximal point group symmetry at which the geometry should be treated.

fragment_charges: Sequence[float] | None = None

The list of charges associated with each fragment.

fragment_multiplicities: Sequence[int] | None = None

The list of multiplicities associated with each fragment.

fragments: Sequence[tuple[int, ...]] | None = None

The list of fragments. Each item of this list must be a tuple of integers with variable length (greater than 1). The first number indicates the fragment index, all following numbers refer to the (0-indexed) atom indices that constitute this fragment.

classmethod from_dict(data)[source]

Constructs a schema object from a dictionary of data.

The dictionary provided to this method corresponds to the format as obtained by json.load from a JSON representation of the schema object according to the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

data (dict[str, Any]) – the data dictionary.

Returns:

An instance of the schema object.

Return type:

QCTopology

classmethod from_hdf5(h5py_data)

Constructs a schema object from an HDF5 object.

While the QCSchema is officially tailored to support JSON, HDF5 is supported as a more high-performance alternative and considered the standard within Qiskit Nature. Due to its similarities with JSON a 1-to-1 correspondence can be made between the two.

For more details refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/tech_discussion.html#json-and-hdf5).

Parameters:

h5py_data (str | Path | Group) – can be either the path to a file or an h5py.Group.

Returns:

An instance of the schema object.

Return type:

_QCBase

classmethod from_json(json_data)

Constructs a schema object from JSON.

The JSON data must match the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

json_data (str | bytes | Path) – can be either the path to a file or the json data directly provided as a str.

Returns:

An instance of the schema object.

Return type:

_QCBase

geometry: Sequence[float]

The XYZ coordinates (in Bohr units) of the atoms. This is a flat list of three times the length of the symbols list.

mass_numbers: Sequence[int] | None = None

The mass numbers of all atoms. If it is an unknown isotope, the value should be -1. Its length must match that of the symbols list.

masses: Sequence[float] | None = None

The masses (in atomic units) of all atoms. Canonical weights are assumed if this is not given explicitly.

molecular_charge: int | None = None

The overall charge of the molecule.

molecular_multiplicity: int | None = None

The overall multiplicity of the molecule.

name: str | None = None

The (user-given) name of the molecule.

provenance: QCProvenance | None = None

An instance of QCProvenance.

real: Sequence[bool] | None = None

A list indicating whether each atom is real (True) or a ghost (False). Its length must match that of the symbols list.

schema_name: str

The name of this schema. This value is expected to be qcschema_molecule.

schema_version: int

The version of this specific schema.

symbols: Sequence[str]

The list of atom symbols in this topology.

to_dict()

Converts the schema object to a dictionary.

Returns:

The dictionary representation of the schema object.

Return type:

dict[str, Any]

to_hdf5(group)

Converts the schema object to HDF5.

Parameters:

group (Group) – the h5py group into which to store the object.

to_json()

Converts the schema object to JSON.

Returns:

The JSON representation of the schema object.

Return type:

str

class QCWavefunction(basis, overlap=None, orbitals_a=None, orbitals_b=None, density_a=None, density_b=None, density_mo_a=None, density_mo_b=None, fock_a=None, fock_b=None, fock_mo_a=None, fock_mo_b=None, eigenvalues_a=None, eigenvalues_b=None, occupations_a=None, occupations_b=None, eri=None, eri_mo_aa=None, eri_mo_ab=None, eri_mo_ba=None, eri_mo_bb=None, dipole_x=None, dipole_y=None, dipole_z=None, dipole_mo_x_a=None, dipole_mo_y_a=None, dipole_mo_z_a=None, dipole_mo_x_b=None, dipole_mo_y_b=None, dipole_mo_z_b=None, scf_overlap=None, scf_orbitals_a=None, scf_orbitals_b=None, scf_density_a=None, scf_density_b=None, scf_density_mo_a=None, scf_density_mo_b=None, scf_fock_a=None, scf_fock_b=None, scf_fock_mo_a=None, scf_fock_mo_b=None, scf_coulomb_a=None, scf_coulomb_b=None, scf_exchange_a=None, scf_exchange_b=None, scf_eigenvalues_a=None, scf_eigenvalues_b=None, scf_occupations_a=None, scf_occupations_b=None, scf_eri=None, scf_eri_mo_aa=None, scf_eri_mo_ab=None, scf_eri_mo_ba=None, scf_eri_mo_bb=None, scf_dipole_x=None, scf_dipole_y=None, scf_dipole_z=None, scf_dipole_mo_x_a=None, scf_dipole_mo_y_a=None, scf_dipole_mo_z_a=None, scf_dipole_mo_x_b=None, scf_dipole_mo_y_b=None, scf_dipole_mo_z_b=None, localized_orbitals_a=None, localized_orbitals_b=None, localized_fock_a=None, localized_fock_b=None, h_core_a=None, h_core_b=None, h_effective_a=None, h_effective_b=None, restricted=None)[source]

A dataclass to store any additional computed wavefunction properties.

Matrix quantities are stored as flat, column-major arrays.

For more information refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/auto_wf.html#wavefunction-schema).

basis: str | QCBasisSet

The basis set used during the computation. This can be either a simple string or a full QCBasisSet specification.

Note: This deviates slightly from the official QCSchema spec, where a QCBasisSet instance is required. However, since this is data not relevant in the routines of Qiskit Nature, we are a bit more lenient here, in order to enable a migration path from legacy HDF5 files generated by Qiskit Nature.

density_a: str | None = None

The name of the alpha-spin density in the AO basis.

density_b: str | None = None

The name of the beta-spin density in the AO basis.

density_mo_a: str | None = None

The name of the alpha-spin density in the MO basis.

density_mo_b: str | None = None

The name of the beta-spin density in the MO basis.

dipole_mo_x_a: str | None = None

The name of alpha-spin x-axis dipole moment integrals in the MO basis.

dipole_mo_x_b: str | None = None

The name of beta-spin x-axis dipole moment integrals in the MO basis.

dipole_mo_y_a: str | None = None

The name of alpha-spin y-axis dipole moment integrals in the MO basis.

dipole_mo_y_b: str | None = None

The name of beta-spin y-axis dipole moment integrals in the MO basis.

dipole_mo_z_a: str | None = None

The name of alpha-spin z-axis dipole moment integrals in the MO basis.

dipole_mo_z_b: str | None = None

The name of beta-spin z-axis dipole moment integrals in the MO basis.

dipole_x: str | None = None

The name of x-axis dipole moment integrals in the AO basis.

dipole_y: str | None = None

The name of y-axis dipole moment integrals in the AO basis.

dipole_z: str | None = None

The name of z-axis dipole moment integrals in the AO basis.

eigenvalues_a: str | None = None

The name of the alpha-spin orbital eigenvalues.

eigenvalues_b: str | None = None

The name of the beta-spin orbital eigenvalues.

eri: str | None = None

The name of the electron-repulsion integrals in the AO basis.

eri_mo_aa: str | None = None

The name of the alpha-alpha electron-repulsion integrals in the MO basis.

eri_mo_ab: str | None = None

The name of the alpha-beta electron-repulsion integrals in the MO basis.

eri_mo_ba: str | None = None

The name of the beta-alpha electron-repulsion integrals in the MO basis.

eri_mo_bb: str | None = None

The name of the beta-beta electron-repulsion integrals in the MO basis.

fock_a: str | None = None

The name of the alpha-spin Fock matrix in the AO basis.

fock_b: str | None = None

The name of the beta-spin Fock matrix in the AO basis.

fock_mo_a: str | None = None

The name of the alpha-spin Fock matrix in the MO basis.

fock_mo_b: str | None = None

The name of the beta-spin Fock matrix in the MO basis.

classmethod from_dict(data)[source]

Constructs a schema object from a dictionary of data.

The dictionary provided to this method corresponds to the format as obtained by json.load from a JSON representation of the schema object according to the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

data (dict[str, Any]) – the data dictionary.

Returns:

An instance of the schema object.

Return type:

QCWavefunction

classmethod from_hdf5(h5py_data)

Constructs a schema object from an HDF5 object.

While the QCSchema is officially tailored to support JSON, HDF5 is supported as a more high-performance alternative and considered the standard within Qiskit Nature. Due to its similarities with JSON a 1-to-1 correspondence can be made between the two.

For more details refer to [here](https://molssi-qc-schema.readthedocs.io/en/latest/tech_discussion.html#json-and-hdf5).

Parameters:

h5py_data (str | Path | Group) – can be either the path to a file or an h5py.Group.

Returns:

An instance of the schema object.

Return type:

_QCBase

classmethod from_json(json_data)

Constructs a schema object from JSON.

The JSON data must match the latest standard as documented [here](https://molssi-qc-schema.readthedocs.io/en/latest/).

Parameters:

json_data (str | bytes | Path) – can be either the path to a file or the json data directly provided as a str.

Returns:

An instance of the schema object.

Return type:

_QCBase

h_core_a: Sequence[float] | None = None

The alpha-spin core (one-electron) Hamiltonian matrix in the AO basis.

h_core_b: Sequence[float] | None = None

The beta-spin core (one-electron) Hamiltonian matrix in the AO basis.

h_effective_a: Sequence[float] | None = None

The effective alpha-spin core (one-electron) Hamiltonian matrix in the AO basis.

h_effective_b: Sequence[float] | None = None

The effective beta-spin core (one-electron) Hamiltonian matrix in the AO basis.

localized_fock_a: Sequence[float] | None = None

The alpha-spin Fock matrix in the localized basis. All nmo orbitals are included, even if only a subset were localized.

localized_fock_b: Sequence[float] | None = None

The beta-spin Fock matrix in the localized basis. All nmo orbitals are included, even if only a subset were localized.

localized_orbitals_a: Sequence[float] | None = None

The localized alpha-spin orbitals. All nmo orbitals are included, even if only a subset were localized.

localized_orbitals_b: Sequence[float] | None = None

The localized beta-spin orbitals. All nmo orbitals are included, even if only a subset were localized.

occupations_a: str | None = None

The name of the alpha-spin orbital occupations.

occupations_b: str | None = None

The name of the beta-spin orbital occupations.

orbitals_a: str | None = None

The name of the alpha-spin orbitals in the AO basis.

orbitals_b: str | None = None

The name of the beta-spin orbitals in the AO basis.

overlap: str | None = None

The name of the overlap matrix in the AO basis.

restricted: bool | None = None

Whether the computation used restricted spin orbitals.

scf_coulomb_a: Sequence[float] | None = None

The SCF alpha-spin Coulomb matrix in the AO basis.

scf_coulomb_b: Sequence[float] | None = None

The SCF beta-spin Coulomb matrix in the AO basis.

scf_density_a: Sequence[float] | None = None

The SCF alpha-spin density in the AO basis.

scf_density_b: Sequence[float] | None = None

The SCF beta-spin density in the AO basis.

scf_density_mo_a: Sequence[float] | None = None

The SCF alpha-spin density in the MO basis.

scf_density_mo_b: Sequence[float] | None = None

The SCF beta-spin density in the MO basis.

scf_dipole_mo_x_a: Sequence[float] | None = None

The SCF alpha-spin x-axis dipole moment integrals in the MO basis.

scf_dipole_mo_x_b: Sequence[float] | None = None

The SCF beta-spin x-axis dipole moment integrals in the MO basis.

scf_dipole_mo_y_a: Sequence[float] | None = None

The SCF alpha-spin y-axis dipole moment integrals in the MO basis.

scf_dipole_mo_y_b: Sequence[float] | None = None

The SCF beta-spin y-axis dipole moment integrals in the MO basis.

scf_dipole_mo_z_a: Sequence[float] | None = None

The SCF alpha-spin z-axis dipole moment integrals in the MO basis.

scf_dipole_mo_z_b: Sequence[float] | None = None

The SCF beta-spin z-axis dipole moment integrals in the MO basis.

scf_dipole_x: Sequence[float] | None = None

The SCF x-axis dipole moment integrals in the AO basis.

scf_dipole_y: Sequence[float] | None = None

The SCF y-axis dipole moment integrals in the AO basis.

scf_dipole_z: Sequence[float] | None = None

The SCF z-axis dipole moment integrals in the AO basis.

scf_eigenvalues_a: Sequence[float] | None = None

The SCF alpha-spin orbital eigenvalues.

scf_eigenvalues_b: Sequence[float] | None = None

The SCF beta-spin orbital eigenvalues.

scf_eri: Sequence[float] | None = None

The SCF electron-repulsion integrals in the AO basis.

scf_eri_mo_aa: Sequence[float] | None = None

The SCF alpha-alpha electron-repulsion integrals in the MO basis.

scf_eri_mo_ab: Sequence[float] | None = None

The SCF alpha-beta electron-repulsion integrals in the MO basis.

scf_eri_mo_ba: Sequence[float] | None = None

The SCF beta-alpha electron-repulsion integrals in the MO basis.

scf_eri_mo_bb: Sequence[float] | None = None

The SCF beta-beta electron-repulsion integrals in the MO basis.

scf_exchange_a: Sequence[float] | None = None

The SCF alpha-spin Exchange matrix in the AO basis.

scf_exchange_b: Sequence[float] | None = None

The SCF beta-spin Exchange matrix in the AO basis.

scf_fock_a: Sequence[float] | None = None

The SCF alpha-spin Fock matrix in the AO basis.

scf_fock_b: Sequence[float] | None = None

The SCF beta-spin Fock matrix in the AO basis.

scf_fock_mo_a: Sequence[float] | None = None

The SCF alpha-spin Fock matrix in the MO basis.

scf_fock_mo_b: Sequence[float] | None = None

The SCF beta-spin Fock matrix in the MO basis.

scf_occupations_a: Sequence[float] | None = None

The SCF alpha-spin orbital occupations.

scf_occupations_b: Sequence[float] | None = None

The SCF beta-spin orbital occupations.

scf_orbitals_a: Sequence[float] | None = None

The SCF alpha-spin orbitals in the AO basis.

scf_orbitals_b: Sequence[float] | None = None

The SCF beta-spin orbitals in the AO basis.

scf_overlap: Sequence[float] | None = None

The SCF overlap matrix in the AO basis.

to_dict()

Converts the schema object to a dictionary.

Returns:

The dictionary representation of the schema object.

Return type:

dict[str, Any]

to_hdf5(group)[source]

Converts the schema object to HDF5.

Parameters:

group (Group) – the h5py group into which to store the object.

to_json()

Converts the schema object to JSON.

Returns:

The JSON representation of the schema object.

Return type:

str