energies

Energies class for storing calculated energies.

This module contains the Energies class, which is used for storing the calculated energies of a molecule. The class gives access to the total energy, as well as the electronic energy and the sum of all ‘initialized’ energies. Also contains a __str__ method for printing the energies in a nice format.

class Energies(mol: Mole | None = None, **energies_dict: float)[source]

Class for storing calculated energies.

mol

The molecule. This is used to calculate the nuclear repulsion energy.

Type:

pyscf.gto.mole.Mole | None

energies_dict

The stored energies.

Type:

dict[str, float]

__getitem__(key: str) float[source]

Returns the energy corresponding to the given key.

__init__(mol: Mole | None = None, **energies_dict: float) None[source]

Initializes the Energies class.

Parameters:
  • mol – The molecule. This is used to calculate the nuclear repulsion energy.

  • **energies_dict – The energies to be stored. The keys should be the names of the energies, the values the energies themselves.

__setitem__(key: str, value: float) None[source]

Sets the energy corresponding to the given key.

__str__() str[source]

Returns a string representation of the energies, formatted as a table.

comparison_table(other: Energies, names=('self', 'other'), as_string=True) Table | str[source]

Returns a comparison table of the energies.

Parameters:
  • other – The other Energies object to compare to.

  • names – The names of the two Energies objects. Default is (‘self’, ‘other’).

  • as_string – Whether to return the table as a string. Default is True.

property electronic_energy: float

Calculates the sum of the electronic energies.

property sum: float

Calculates the sum of all initialized energies.

property total_energy: float

Electronic + nuclear repulsion.

Type:

Calculates the total energy

_format_energies(energies: list[float]) list[str][source]

Formats a list of energies.

_format_energy(energy: float) str[source]

Formats an energy.