Skip to content

Formation Energy

FormationEnergyAnalyzer

FormationEnergyAnalyzer(
    calculator: BaseCalculator | None = None,
    formation_energy_transformation: FormationEnergyTransformation
    | None = None,
)

A class used to calculate the formation energy of materials.

The FormationEnergyAnalyzer class computes the formation energy of a material from its composition and structure.

Initializes the FormationEnergyAnalyzer object.

Parameters:

Name Type Description Default
calculator BaseCalculator | None

The calculator object used for energy calculations.

None
formation_energy_transformation FormationEnergyTransformation

The transformation object used to generate structures required for the calculation of formation energies.

None

calculate

calculate(
    structure: Atoms | Structure, is_relaxed: bool = False
) -> dict[
    str,
    float | dict[str, dict[str, float | bool | Structure]],
]

Calculates the formation energy of the given structure.

For elemental references, each element's known experimental ground-state structure (see FormationEnergyTransformation) is relaxed with the same calculator. For the few elements whose ground state can't be constructed directly, several candidate crystal structures are relaxed instead and the lowest energy per atom is used. Each element's reference energy is cached on this analyzer instance, so calling calculate() again (even on a different structure) reuses it instead of relaxing it again; construct a new analyzer to force fresh relaxations.

Parameters:

Name Type Description Default
structure Atoms | Structure

The structure for which the formation energy is calculated.

required
is_relaxed bool

If True, the structure is assumed to be already relaxed and only a single-point energy calculation is performed. Defaults to False.

False

Returns:

Type Description
dict[str, float | dict[str, dict[str, float | bool | Structure]]]

dict[str, float]: Dictionary with keys: - formation_energy: Formation energy per atom (eV/atom). - elemental_references: Per-element dict of {"structure": Structure, "energy_per_atom": float, "is_guessed": bool}, where is_guessed is True if the element has no known experimental ground state and a guessed high-symmetry candidate was used instead.

formation_energy_transformation

formation_energy_transformation() -> (
    FormationEnergyTransformation
)

Returns the transformation object used to apply distortions.

Returns:

Name Type Description
FormationEnergyTransformation FormationEnergyTransformation

The transformation object used to generate structures.