Thermodynamic Integration

Modules to handle thermodynamic integration

ThermodynamicIntegration

class mlacs.ti.ThermodynamicIntegration(thermostate, ninstance=1, logfile='ThermoInt.log', workdir='ThermoInt', **kwargs)

Class to handle a series of thermodynamic integration on sampled states

Parameters:
  • thermostate (thermostate or list of thermostate) – State(s) for which the thermodynamic integration should be performed

  • ninstance (: class:int) – Numer of forward and backward to be performed per state, default 1

  • logfile (str (optional)) – Name of the logfile. Default "ThermoInt.log"

  • workdir (:class:`str`(optional)) – Name of the root folder in which the simulations will be performed. Default ThermoInt

ThermoState

class mlacs.ti.thermostate.ThermoState(atoms, pair_style, pair_coeff, dt=1.5, nsteps=10000, nsteps_eq=5000, nsteps_averaging=10000, rng=None, langevin=False, logfile=None, trajfile=None, interval=500, loginterval=50, blocks=None, neti=True, **kwargs)

Parent class for the thermodynamic state used in thermodynamic integration

Parameters:
  • atoms (ase.Atoms) – ASE atoms object on which the simulation will be performed

  • pair_style (str) – pair_style for the LAMMPS input

  • pair_coeff (str or list of str) – pair_coeff for the LAMMPS input

  • dt (int (optional)) – Timestep for the simulations, in fs. Default 1.5

  • nsteps (int (optional)) – Number of production steps. Default 10000.

  • nsteps_eq (int (optional)) – Number of equilibration steps. Default 5000.

  • nsteps_averaging (int (optional)) – Number of step for equilibrate ideal structure at zero or finite pressure. Default 10000.

  • rng (RNG object) – Rng object to be used with the Langevin thermostat. Default correspond to numpy.random.default_rng()

  • logfile (str (optional)) – Name of the file for logging the MLMD trajectory. If None, no log file is created. Default None.

  • trajfile (str (optional)) – Name of the file for saving the MLMD trajectory. If None, no log file is created. Default None.

  • interval (int (optional)) – Number of steps between log and traj writing. Override loginterval. Default 50.

  • loginterval (int (optional)) – Number of steps between MLMD logging. Default 50.

  • workdir (str (optional)) – Working directory for the LAMMPS MLMD simulations. If None, a LammpsMLMD directory is created

  • blocks (LammpsBlockInput or list (optional)) – Custom block input class. Can be a list of blocks. If None, nothing is added in the input. Default None.

EinsteinSolidState

class mlacs.ti.solids.EinsteinSolidState(atoms, pair_style, pair_coeff, temperature, pressure=None, fcorr1=None, fcorr2=None, k=None, dt=1, damp=None, pdamp=None, nsteps=50000, nsteps_eq=5000, nsteps_msd=25000, nsteps_averaging=10000, rng=None, langevin=True, logfile=None, trajfile=None, interval=500, loginterval=50, **kwargs)

Class for performing thermodynamic integration from an Einstein crystal reference

Parameters:
  • atoms (ase.Atoms) – ASE atoms object on which the simulation will be performed

  • pair_style (str) – pair_style for the LAMMPS input

  • pair_coeff (str or list of str) – pair_coeff for the LAMMPS input

  • temperature (float) – Temperature of the simulation

  • pressure (float) – Pressure. None default value

  • fcorr1 (float or None) – First order cumulant correction to the free energy, in eV/at, to be added to the results. If None, no value is added. Default None.

  • fcorr2 (float or None) – Second order cumulant correction to the free energy, in eV/at, to be added to the results. If None, no value is added. Default None.

  • k (float or list of :class:float` or None) – Spring constant for the Einstein crystal reference. If a float, all atoms type have the same spring constant. If a list, a value for each atoms type should be provided. If None, a short simulation is run to determine the optimal value. Default None

  • dt (int (optional)) – Timestep for the simulations, in fs. Default 1

  • damp (float (optional)) – Damping parameter. If None, a damping parameter of 1000 x dt is used.

  • pdamp (float (optional)) – Pressure damping parameter, used is the pressure is not None By default, this correspond to 1000 times the timestep.

  • nsteps (int (optional)) – Number of production steps. Default 10000.

  • nsteps_eq (int (optional)) – Number of equilibration steps. Default 5000.

  • nsteps_md (int (optional)) – Number of steps used to compute the spring constants. Default 25000

  • nsteps_averaging (int (optional)) – Number of step for equilibrate ideal structure at zero or finite pressure. Default 10000.

  • rng (RNG object) – Rng object to be used with the Langevin thermostat. Default correspond to numpy.random.default_rng()

  • langevin (bool) – Whether to use a langevin thermostat. Default True

  • logfile (Bool (optional)) – Activate file for logging the MLMD trajectory. If None, no log file is created. Default None.

  • trajfile (str (optional)) – Activate Name of the file for saving the MLMD trajectory dump. If None, no dump file is created. Default None.

  • interval (int (optional)) – Number of steps between log and traj writing. Override loginterval. Default 50.

  • loginterval (int (optional)) – Number of steps between MLMD logging. Default 50.

UFLiquidState

class mlacs.ti.liquids.UFLiquidState(atoms, pair_style, pair_coeff, temperature, pressure=None, fcorr1=None, fcorr2=None, p=50, sigma=2.0, dt=1, damp=None, pdamp=None, nsteps=10000, nsteps_eq=5000, nsteps_averaging=10000, rng=None, langevin=True, logfile=None, trajfile=None, interval=500, loginterval=50, **kwargs)

Class for performing thermodynamic integration from a Uhlenbeck-Ford potential reference

Parameters:
  • atoms (ase.Atoms) – ASE atoms object on which the simulation will be performed

  • pair_style (str) – pair_style for the LAMMPS input

  • pair_coeff (str or list of str) – pair_coeff for the LAMMPS input

  • temperature (float) – Temperature of the simulation

  • pressure (:class:float) – Pressure. None default value

  • fcorr1 (float or None) – First order cumulant correction to the free energy, in eV/at, to be added to the results. If None, no value is added. Default None.

  • fcorr2 (float or None) – Second order cumulant correction to the free energy, in eV/at, to be added to the results. If None, no value is added. Default None.

  • p (int) – p parameter of the Uhlenbeck-Ford potential. Should be 1, 25, 50, 75 or 100. Default 50

  • sigma (float) – sigma parameter of the Uhlenbeck-Ford potential. Default 2.0.

  • dt (int (optional)) – Timestep for the simulations, in fs. Default 1

  • damp (float (optional)) – Damping parameter. If None, a damping parameter of 100 x dt is used.

  • pdamp (float (optional)) – Pressure damping parameter, used is the pressure is not None By default, this correspond to 1000 times the timestep.

  • nsteps (int (optional)) – Number of production steps. Default 10000.

  • nsteps_eq (int (optional)) – Number of equilibration steps. Default 5000.

  • nsteps_averaging (int (optional)) – Number of step for equilibrate ideal structure at zero or finite pressure. Default 10000.

  • rng (RNG object) – Rng object to be used with the Langevin thermostat. Default correspond to numpy.random.default_rng()

  • langevin (Bool) – Settle or not a langevin thermostat to equilibrate an ideal structure at zero or finite pressure. Default True

  • logfile (str (optional)) – Name of the file for logging the MLMD trajectory. If None, no log file is created. Default None.

  • trajfile (str (optional)) – Name of the file for saving the MLMD trajectory. If None, no log file is created. Default None.

  • interval (int (optional)) – Number of steps between log and traj writing. Override loginterval. Default 50.

  • loginterval (int (optional)) – Number of steps between MLMD logging. Default 50.

ReversibleScalingState

class mlacs.ti.reversible_scaling.ReversibleScalingState(atoms, pair_style, pair_coeff, fcorr1=None, fcorr2=None, t_start=300, t_end=1200, fe_init=None, phase=None, ninstance=1, dt=1, damp=None, pressure=None, pdamp=None, nsteps=10000, nsteps_eq=5000, gjf=True, rng=None, langevin=True, logfile=None, trajfile=None, interval=500, loginterval=50, **kwargs)

Class for performing thermodynamic integration for a range of temperature using reversible scaling.

Parameters:
  • atoms (ase.Atoms) – ASE atoms object on which the simulation will be performed

  • pair_style (str) – pair_style for the LAMMPS input

  • pair_coeff (str or list of str) – pair_coeff for the LAMMPS input

  • fcorr1 (float or None) – First order cumulant correction to the free energy, in eV/at, to be added to the results. If None, no value is added. Default None.

  • fcorr2 (float or None) – Second order cumulant correction to the free energy, in eV/at, to be added to the results. If None, no value is added. Default None.

  • t_start (float (optional)) – Initial temperature of the simulation, in Kelvin. Default 300.

  • t_end (float (optional)) – Final temperature of the simulation, in Kelvin. Default 1200.

  • fe_init (float (optional)) – Free energy of the initial temperature, in eV/at. Default None.

  • phase (str) – The phase of the system for which the free energy is computed. This input is used to compute the reference free energy at the starting pressure using a EinsteinSolidState object for solids and a UFLiquidState object for liquids. Can be either ‘solid’ or ‘liquid’

  • ninstance (int (optional)) – If Free energy calculation has to be done before temperature sweep, settles the number of forward and backward runs. Default 1.

  • dt (int (optional)) – Timestep for the simulations, in fs. Default 1.5

  • damp (float (optional)) – Damping parameter. If None, a damping parameter of a hundred time the timestep is used.

  • pressure (float or None) – Pressure of the simulation. If None, simulations are performed in the NVT ensemble. Default None.

  • pdamp (float (optional)) – Damping parameter for the barostat. Default 1000 times dt is used. Default None.

  • nsteps (int (optional)) – Number of production steps. Default 10000.

  • nsteps_eq (int (optional)) – Number of equilibration steps. Default 5000.

  • gjf (bool) – Whether to use the GJF integrator, if the Langevin thermostat is used. Default True

  • rng (RNG object) – Rng object to be used with the Langevin thermostat. Default correspond to numpy.random.default_rng()

  • langevin (bool) – Whether to use a langevin thermostat. Default True

  • logfile (str (optional)) – Name of the file for logging the MLMD trajectory. If None, no log file is created. Default None.

  • trajfile (str (optional)) – Name of the file for saving the MLMD trajectory. If None, no traj file is created. Default None.

  • interval (int (optional)) – Number of steps between log and traj writing. Override loginterval. Default 50.

  • loginterval (int (optional)) – Number of steps between MLMD logging. Default 50.