qrunch.chemistry.molecule.molecular_energy_contributions

Protocols for ground state problem builders.

Classes

AuxiliaryEnergyContribution

Energy values stored for reference only — not included in sum_of_contributions.

MolecularEnergyContribution

Enum for all the different energy contributions added to ground state problems.

MolecularEnergyContributions

Class containing all energy contributions for ground state problems.

class AuxiliaryEnergyContribution

Bases: Enum

Energy values stored for reference only — not included in sum_of_contributions.

These are additional energy values that provide context about how the main energy contributions were determined, but should not be summed into the total energy.

ProjectiveEmbeddingEmbeddedMOCalculatorEnergy = 'Projective embedding molecular orbital calculator energy'
ProjectiveEmbeddingEmbeddedSubSystemMeanFieldEnergy = 'Projective embedding embedded sub-system mean-field energy'
ProjectiveEmbeddingFullSystemMeanFieldEnergy = 'Projective embedding full system mean-field energy'
class MolecularEnergyContribution

Bases: Enum

Enum for all the different energy contributions added to ground state problems.

EnvironmentElectronsEnergy = 'Environment electrons energy'
InactiveElectronsEnergy = 'Inactive electrons energy'
NuclearRepulsionEnergy = 'Nuclear repulsion energy'
class MolecularEnergyContributions

Bases: HasCustomEncoding

Class containing all energy contributions for ground state problems.

__init__(energy_contributions: dict[MolecularEnergyContribution, float], auxiliary_energies: dict[AuxiliaryEnergyContribution, float] | None = None) None

Initialize an instance of energy contributions.

Parameters:
  • energy_contributions (dict[MolecularEnergyContribution, float]) – The main energy contributions that participate in sum_of_contributions.

  • auxiliary_energies (dict[AuxiliaryEnergyContribution, float] | None) – Optional reference energies that are not included in sum_of_contributions.

Return type:

None

classmethod decode(data: dict[str, Any]) MolecularEnergyContributions

Decode a dictionary to an instance of MolecularEnergyContributions.

Parameters:

data (dict[str, Any]) – The dictionary representation of a MolecularEnergyContributions instance.

Return type:

MolecularEnergyContributions

encode() dict[str, Any]

Encode the instance into a dictionary.

Parameters:

self – The MolecularEnergyContributions instance.

Return type:

dict[str, Any]

get(key: MolecularEnergyContribution | str) float

Get energy contribution for the given key.

If the energy contribution is not present; 0.0 is returned.

Parameters:

key (MolecularEnergyContribution | str) – Energy contribution to return value of.

Raises:

KeyError – If a given string does not correspond to an energy contribution.

Return type:

float

get_auxiliary(key: AuxiliaryEnergyContribution) float

Get an auxiliary (non-summed) energy value.

Parameters:

key (AuxiliaryEnergyContribution) – The auxiliary energy contribution to return the value of.

Return type:

float

items() Iterable[tuple[MolecularEnergyContribution, float]]

Get iterator over energy contribution type and value.

Return type:

Iterable[tuple[MolecularEnergyContribution, float]]

nuclear_repulsion() float

Get sum of all nuclear energy contributions, i.e., nuclear repulsion.

Return type:

float

sum_of_contributions() float

Calculate sum of all energy contributions.

Return type:

float

sum_of_electronic_contributions() float

Calculate sum of all electronic energy contributions.

Return type:

float