# pymatgen.analysis.energy_models module

This module implements a EnergyModel abstract class and some basic implementations. Basically, an EnergyModel is any model that returns an “energy” for any given structure.

class EnergyModel

  Bases: `monty.json.MSONable`

  Abstract structure filter class.

  classmethod from_dict(d)
    Parameters

      d – Dict representation

    Returns

      EnergyModel

  abstract get_energy(structure) → float
    Parameters

      structure – Structure

    Returns

      Energy value

class EwaldElectrostaticModel(real_space_cut=None, recip_space_cut=None, eta=None, acc_factor=8.0)

  Bases: `pymatgen.analysis.energy_models.EnergyModel`

  Wrapper around EwaldSum to calculate the electrostatic energy.

  Initializes the model. Args have the same definitions as in `pymatgen.analysis.ewald.EwaldSummation`.

  Parameters

    - real_space_cut (float) – Real space cutoff radius dictating how many terms are used in the real space sum. Defaults to None, which means determine automagically using the formula given in gulp 3.1 documentation.

    - recip_space_cut (float) – Reciprocal space cutoff radius. Defaults to None, which means determine automagically using the formula given in gulp 3.1 documentation.

    - eta (float) – Screening parameter. Defaults to None, which means determine automatically.

    - acc_factor (float) – No. of significant figures each sum is converged to.

  as_dict()
    Returns

      MSONable dict

  get_energy(structure)
    Parameters

      structure – Structure

    Returns

      Energy value

class IsingModel(j, max_radius)

  Bases: `pymatgen.analysis.energy_models.EnergyModel`

  A very simple Ising model, with r^2 decay.

  Parameters

    - j (float) – The interaction parameter. E = J * spin1 * spin2.

    - radius (float) – max_radius for the interaction.

  as_dict()
    Returns

      MSONable dict

  get_energy(structure)
    Parameters

      structure – Structure

    Returns

      Energy value

class NsitesModel

  Bases: `pymatgen.analysis.energy_models.EnergyModel`

  Sets the energy to the number of sites. More sites => higher “energy”. Used to rank structures from smallest number of sites to largest number of sites after enumeration.

  as_dict()
    Returns

      MSONable dict

  get_energy(structure)
    Parameters

      structure – Structure

    Returns

      Energy value

class SymmetryModel(symprec=0.1, angle_tolerance=5)

  Bases: `pymatgen.analysis.energy_models.EnergyModel`

  Sets the energy to the -ve of the spacegroup number. Higher symmetry => lower “energy”.

  Args have same meaning as in `pymatgen.symmetry.finder.SpacegroupAnalyzer`.

  Parameters

    - symprec (float) – Symmetry tolerance. Defaults to 0.1.

    - angle_tolerance (float) – Tolerance for angles. Defaults to 5 degrees.

  as_dict()
    Returns

      MSONable dict

  get_energy(structure)
    Parameters

      structure – Structure

    Returns

      Energy value