generate_temperature_profile

generate_temperature_profile#

autoplex.data.md.utils.generate_temperature_profile(temperature_list, eqm_step_list=None, rate_list=None, ramp_step_list=None)[source]#

Build a per-step temperature schedule for a multi-stage MD run.

Stage i holds temperature_list[i] for eqm_step_list[i] steps and then ramps linearly to the next temperature. The length of each ramp is either given directly (ramp_step_list, MD steps per ramp, like in LAMMPS) or follows from rate_list (MD steps per kelvin). Heating and cooling are treated identically, so the same function covers isothermal runs, multi-stage quenches and heating/cooling cycles.

Parameters:
  • temperature_list (list[float]) – Stage temperatures in K, e.g. [3000, 1500, 300] for a two-stage quench.

  • eqm_step_list (list[int] | None) – MD steps to hold each temperature (one entry per temperature). Defaults to 10,000 steps per stage.

  • rate_list (list[float] | None) – MD steps per kelvin for each ramp (one entry per ramp, i.e. len(temperature_list) - 1); a ramp over dT kelvin takes dT * rate MD steps. 0 jumps straight to the next temperature. With a 1 fs time step, rate=10 is 10^14 K/s and rate=100 is 10^13 K/s. None, [] or only zeros run without any ramps. Ignored if ramp_step_list is given.

  • ramp_step_list (list[int] | None) – MD steps for each ramp (one entry per ramp), like in LAMMPS; 0 jumps straight to the next temperature. Alternative to rate_list, used instead of it if both are given.

Returns:

The temperature at every MD step (length n_steps + 1) and n_steps, ready for ForceFieldMDMaker.temperature and .n_steps.

Return type:

tuple[np.ndarray, int]