qrunch.chemistry.molecule.molecular_energy_contributions

Protocols for ground state problem builders.

Classes

MolecularEnergyContribution

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

MolecularEnergyContributions

Class containing all energy contributions for ground state problems.

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]) None

Initialize an instance of energy contributions.

Parameters:

energy_contributions (dict[MolecularEnergyContribution, float])

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

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