FreeEnergy

Calculation class

class FreeEnergy(model: str | Path | IOBase | DataModelDict | None = None, name: str | None = None, database=None, params: str | Path | IOBase | dict = None, **kwargs: any)

Bases: Calculation

Class for managing dynamic relaxations

build_model() DataModelDict

Generates and returns model content based on the values set to object.

calc_inputs() dict

Builds calculation inputs from the class’s attributes

property commands: LammpsCommands

LammpsCommands subset

property compare_fterms: dict

The terms to compare metadata values using a tolerance.

Type:

dict

property compare_terms: list

The terms to compare metadata values absolutely.

Type:

list

property equilsteps: int

The number of ignored equilibration steps at the beginning of simulations

Type:

int

property filenames: list

the names of each file used by the calculation.

Type:

list

property gibbs: float

The Gibbs free energy/atom.

Type:

float

property helmholtz: float

The Helmholtz free energy/atom.

Type:

float

property helmholtz_reference: float

The Helmholtz free energy/atom for the reference Einstein solid.

Type:

float

load_model(model: str | DataModelDict, name: str | None = None)

Loads record contents from a given model.

Parameters:
  • model (str or DataModelDict) – The model contents of the record to load.

  • name (str, optional) – The name to assign to the record. Often inferred from other attributes if not given.

load_parameters(params: dict | str | IOBase, key: str | None = None)

Reads in and sets calculation parameters.

Parameters:
  • params (dict, str or file-like object) – The parameters or parameter file to read in.

  • key (str, optional) – A new key value to assign to the object. If not given, will use calc_key field in params if it exists, or leave the key value unchanged.

master_prepare_inputs(branch: str = 'main', **kwargs: any) dict

Utility method that build input parameters for prepare according to the workflows used by the NIST Interatomic Potentials Repository. In other words, transforms inputs from master_prepare into inputs for prepare.

Parameters:
  • branch (str, optional) – Indicates the workflow branch to prepare calculations for. Default value is ‘main’.

  • **kwargs (any) – Any parameter modifications to make to the standard workflow prepare scripts.

Returns:

params – The full set of prepare parameters based on the workflow branch

Return type:

dict

metadata() dict

Generates a dict of simple metadata values associated with the record. Useful for quickly comparing records and for building pandas.DataFrames for multiple records of the same style.

property modelroot: str

The root element of the content

Type:

str

property multikeys: list

Calculation key sets that can have multiple values during prepare.

Type:

list

property natoms: float

The total number of atoms in the system.

Type:

int

property potential: LammpsPotential

LammpsPotential subset

process_results(results_dict: dict)

Processes calculation results and saves them to the object’s results attributes.

Parameters:

results_dict (dict) – The dictionary returned by the calc() method.

property queries: dict

Query objects and their associated parameter names.

Type:

dict

property randomseed: int

Random number seed used by LAMMPS.

Type:

int

set_values(name: str | None = None, **kwargs: any)

Set calculation values directly. Any terms not given will be set or reset to the calculation’s default values.

Parameters:
  • name (str, optional) – The name to assign to the calculation. By default, this is set as the calculation’s key.

  • temperature (float, optional) – The temperature to run at.

  • spring_constants (float, array-like object or None, optional) – The Einstein solid spring constants to assign to each atom type. If None (default), then a separate simulation will estimate them using mean squared displacements.

  • equilsteps (int, optional) – The number of equilibration timesteps at the beginning of simulations to ignore before evaluations. This is used at the beginning of both the spring constant estimate and before each thermo switch run.

  • switchsteps (int, optional) – The number of integration steps to perform during the two switch runs.

  • springsteps (int, optional) – The number of integration steps to perform for the spring constants estimation, which is only done if spring_constants is None.

  • pressure (float, optional) – A value of pressure to use for computing the Gibbs free energy from the Helmholtz free energy. NOTE: this is not used to equilibrate the system during this calculation!

  • randomseed (int, optional) – Random number seed used by LAMMPS.

  • **kwargs (any, optional) – Any keyword parameters supported by the set_values() methods of the parent Calculation class and the subset classes.

property singularkeys: list

Calculation keys that can have single values during prepare.

Type:

list

property spring_constants: ndarray | None

The Einstein spring constants for each temperature

Type:

numpy.ndarray or None

property springsteps: int

The number of steps to perform to evaluate the spring constants.

Type:

int

property switchsteps: int

The number of steps to perform during the two switch runs.

Type:

int

property system: AtommanSystemLoad

AtommanSystemLoad subset

property system_mods: AtommanSystemManipulate

AtommanSystemManipulate subset

property temperature: float

Target temperature

Type:

float

property templatekeys: dict

The calculation-specific input keys and their descriptions.

Type:

dict

property units: Units

Units subset

property volume: float

The total volume of the system.

Type:

float

property work: float

The reversible work/atom.

Type:

float

property work_forward: float

The work/atom during the forward switching step.

Type:

float

property work_reverse: float

The work/atom during the reverse switching step.

Type:

float