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 (
thermostateorlistofthermostate) – State(s) for which the thermodynamic integration should be performedninstance (: 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 performedpair_style (
str) – pair_style for the LAMMPS inputpair_coeff (
strorlistofstr) – pair_coeff for the LAMMPS inputdt (
int(optional)) – Timestep for the simulations, in fs. Default1.5nsteps (
int(optional)) – Number of production steps. Default10000.nsteps_eq (
int(optional)) – Number of equilibration steps. Default5000.nsteps_averaging (
int(optional)) – Number of step for equilibrate ideal structure at zero or finite pressure. Default10000.rng (
RNG object) – Rng object to be used with the Langevin thermostat. Default correspond tonumpy.random.default_rng()logfile (
str(optional)) – Name of the file for logging the MLMD trajectory. IfNone, no log file is created. DefaultNone.trajfile (
str(optional)) – Name of the file for saving the MLMD trajectory. IfNone, no log file is created. DefaultNone.interval (
int(optional)) – Number of steps between log and traj writing. Override loginterval. Default50.loginterval (
int(optional)) – Number of steps between MLMD logging. Default50.workdir (
str(optional)) – Working directory for the LAMMPS MLMD simulations. IfNone, a LammpsMLMD directory is createdblocks (
LammpsBlockInputorlist(optional)) – Custom block input class. Can be a list of blocks. IfNone, nothing is added in the input. DefaultNone.
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 performedpair_style (
str) – pair_style for the LAMMPS inputpair_coeff (
strorlistofstr) – pair_coeff for the LAMMPS inputtemperature (
float) – Temperature of the simulationpressure (
float) – Pressure. None default valuefcorr1 (
floatorNone) – First order cumulant correction to the free energy, in eV/at, to be added to the results. IfNone, no value is added. DefaultNone.fcorr2 (
floatorNone) – Second order cumulant correction to the free energy, in eV/at, to be added to the results. IfNone, no value is added. DefaultNone.k (
floatorlistof :class:float` orNone) – 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. IfNone, a short simulation is run to determine the optimal value. DefaultNonedt (
int(optional)) – Timestep for the simulations, in fs. Default1damp (
float(optional)) – Damping parameter. IfNone, 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. Default10000.nsteps_eq (
int(optional)) – Number of equilibration steps. Default5000.nsteps_md (
int(optional)) – Number of steps used to compute the spring constants. Default 25000nsteps_averaging (
int(optional)) – Number of step for equilibrate ideal structure at zero or finite pressure. Default10000.rng (
RNG object) – Rng object to be used with the Langevin thermostat. Default correspond tonumpy.random.default_rng()langevin (
bool) – Whether to use a langevin thermostat. Default Truelogfile (
Bool(optional)) – Activate file for logging the MLMD trajectory. IfNone, no log file is created. DefaultNone.trajfile (
str(optional)) – Activate Name of the file for saving the MLMD trajectory dump. IfNone, no dump file is created. DefaultNone.interval (
int(optional)) – Number of steps between log and traj writing. Override loginterval. Default50.loginterval (
int(optional)) – Number of steps between MLMD logging. Default50.
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 performedpair_style (
str) – pair_style for the LAMMPS inputpair_coeff (
strorlistofstr) – pair_coeff for the LAMMPS inputtemperature (
float) – Temperature of the simulationpressure (:class:float) – Pressure. None default value
fcorr1 (
floatorNone) – First order cumulant correction to the free energy, in eV/at, to be added to the results. IfNone, no value is added. DefaultNone.fcorr2 (
floatorNone) – Second order cumulant correction to the free energy, in eV/at, to be added to the results. IfNone, no value is added. DefaultNone.p (
int) – p parameter of the Uhlenbeck-Ford potential. Should be1,25,50,75or100. Default50sigma (
float) – sigma parameter of the Uhlenbeck-Ford potential. Default2.0.dt (
int(optional)) – Timestep for the simulations, in fs. Default1damp (
float(optional)) – Damping parameter. IfNone, 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. Default10000.nsteps_eq (
int(optional)) – Number of equilibration steps. Default5000.nsteps_averaging (
int(optional)) – Number of step for equilibrate ideal structure at zero or finite pressure. Default10000.rng (
RNG object) – Rng object to be used with the Langevin thermostat. Default correspond tonumpy.random.default_rng()langevin (
Bool) – Settle or not a langevin thermostat to equilibrate an ideal structure at zero or finite pressure. DefaultTruelogfile (
str(optional)) – Name of the file for logging the MLMD trajectory. IfNone, no log file is created. DefaultNone.trajfile (
str(optional)) – Name of the file for saving the MLMD trajectory. IfNone, no log file is created. DefaultNone.interval (
int(optional)) – Number of steps between log and traj writing. Override loginterval. Default50.loginterval (
int(optional)) – Number of steps between MLMD logging. Default50.
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 performedpair_style (
str) – pair_style for the LAMMPS inputpair_coeff (
strorlistofstr) – pair_coeff for the LAMMPS inputfcorr1 (
floatorNone) – First order cumulant correction to the free energy, in eV/at, to be added to the results. IfNone, no value is added. DefaultNone.fcorr2 (
floatorNone) – Second order cumulant correction to the free energy, in eV/at, to be added to the results. IfNone, no value is added. DefaultNone.t_start (
float(optional)) – Initial temperature of the simulation, in Kelvin. Default300.t_end (
float(optional)) – Final temperature of the simulation, in Kelvin. Default1200.fe_init (
float(optional)) – Free energy of the initial temperature, in eV/at. DefaultNone.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. Default1.dt (
int(optional)) – Timestep for the simulations, in fs. Default1.5damp (
float(optional)) – Damping parameter. IfNone, a damping parameter of a hundred time the timestep is used.pressure (
floatorNone) – Pressure of the simulation. IfNone, simulations are performed in the NVT ensemble. DefaultNone.pdamp (
float(optional)) – Damping parameter for the barostat. Default 1000 timesdtis used. DefaultNone.nsteps (
int(optional)) – Number of production steps. Default10000.nsteps_eq (
int(optional)) – Number of equilibration steps. Default5000.gjf (
bool) – Whether to use the GJF integrator, if the Langevin thermostat is used. Default Truerng (
RNG object) – Rng object to be used with the Langevin thermostat. Default correspond tonumpy.random.default_rng()langevin (
bool) – Whether to use a langevin thermostat. Default Truelogfile (
str(optional)) – Name of the file for logging the MLMD trajectory. IfNone, no log file is created. DefaultNone.trajfile (
str(optional)) – Name of the file for saving the MLMD trajectory. IfNone, no traj file is created. DefaultNone.interval (
int(optional)) – Number of steps between log and traj writing. Override loginterval. Default50.loginterval (
int(optional)) – Number of steps between MLMD logging. Default50.