free_energy_liquid.py

Calculation functions

free_energy_liquid(lammps_command: str, system: System, potential: Potential, temperature: float, mpi_command: str | None = None, p: int = 50, sigma: float = 1.5, equilsteps: int = 25000, switchsteps: int = 50000, pressure: float = 0.0, createvelocities: bool = True, randomseed: int | None = None) dict

Performs a full dynamic relax on a given system at the given temperature to the specified pressure state.

Parameters:
  • lammps_command (str) – Command for running LAMMPS.

  • system (atomman.System) – The system to perform the calculation on.

  • potential (atomman.lammps.Potential) – The LAMMPS implemented potential to use.

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

  • mpi_command (str, optional) – The MPI command for running LAMMPS in parallel. If not given, LAMMPS will run serially.

  • p (int, optional) – The Uhlenbeck-Ford energy scale multiplier. Allowed values are 1, 25, 50, 75, and 100. Default value is 50.

  • sigma (float, optional) – The Uhlenbeck-Ford length scale parameter. Default value is 1.5.

  • equilsteps (int, optional) – The number of equilibration timesteps at the beginning of simulations to ignore before evaluations. This is used before each thermo switch run. Default value is 25000.

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

  • 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! Default value is 0.0.

  • randomseed (int or None, optional) – Random number seed used by LAMMPS. Default is None which will select a random int between 1 and 900000000.

Returns:

Dictionary of results consisting of keys:

  • ’work_forward’ (float) - The work/atom during the forward switching step.

  • ’work_reverse’ (float) - The work/atom during the reverse switching step.

  • ’work’ (float) - The reversible work/atom.

  • ’Helmholtz_reference’ (float) - The Helmholtz free energy/atom for the reference Einstein solid.

  • ’Helmholtz’ (float) - The Helmholtz free energy/atom.

  • ’Gibbs’ (float) - The Gibbs free energy/atom.

Return type:

dict

ideal_gas_free_energy(temperature, volume, masses, natoms)

Get the free energy of an ideal gas

Parameters:
  • temperature (float) – The temperature to use.

  • volume (float) – The total volume of the system.

  • masses (float or list) – The atomic masses for each atom type.

  • natoms (float or list) – The number of atoms for each atom type.

Returns:

Computed free energy of the ideal gas.

Return type:

float

integrate_for_work(hamil_forward, hamil_reverse)
modify_hybrid_pair_info_ufm(pair_info, ufm, energy_unit='eV', length_unit='angstrom')
modify_pair_info_ufm(pair_info, ufm, energy_unit='eV', length_unit='angstrom')

Transforms pair_info for a potential into a hybrid/scaled with ufm for thermodynamic integration