relax_liquid.py

Calculation functions

relax_liquid(lammps_command: str, system: System, potential: Potential, temperature: float, mpi_command: str | None = None, pressure: float = 0.0, temperature_melt: float = 3000.0, rdfcutoff: float | None = None, meltsteps: int = 50000, coolsteps: int = 10000, equilvolumesteps: int = 50000, equilvolumesamples: int = 300, equilenergysteps: int = 10000, equilenergysamples: int = 100, equilenergystyle: str = 'pe', runsteps: int = 50000, dumpsteps: int | None = None, restartsteps: int | None = None, createvelocities: bool = True, randomseed: int | None = None) dict

Performs a multi-stage simulation to obtain a liquid phase configuration at a given temperature. Radial displacement functions and mean squared displacements are automatically computed for the system.

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 target temperature to relax to.

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

  • pressure (float, optional) – The target hydrostatic pressure to relax to. Default value is 0. GPa.

  • temperature_melt (float, optional) – The elevated temperature to first use to hopefully melt the initial configuration.

  • rdfcutoff (float, optional) – The cutoff distance to use for the RDF cutoff. If not given then will use 4 * r0, where r0 is the shortest atomic distance found in the given system configuration.

  • meltsteps (int, optional) – The number of npt integration steps to perform during the melting stage at the melt temperature to create an amorphous liquid structure. Default value is 50000.

  • coolsteps (int, optional) – The number of npt integration steps to perform during the cooling stage where the temperature is reduced from the melt temperature to the target temperature. Default value is 10000.

  • equilvolumesteps (int, optional) – The number of npt integration steps to perform during the volume equilibration stage where the system is held at the target temperature and pressure to obtain an estimate for the relaxed volume. Default value is 50000.

  • equilvolumesamples (int, optional) – The number of thermo samples from the end of the volume equilibration stage to use in computing the average volume. Cannot be larger than equilvolumesteps / 100. It is recommended to set smaller than the max to allow for some convergence time. Default value is 300.

  • equilenergysteps (int, optional) – The number of nvt integration steps to perform during the energy equilibration stage where the system is held at the target temperature to obtain an estimate for the total energy. Default value is 10000.

  • equilenergysamples (int, optional) – The number of thermo samples from the end of the energy equilibrium stage to use in computing the target total energy. Cannot be larger than equilenergysteps / 100. Default value is 100.

  • equilenergystyle (str, optional) – Indicates which scheme to use for computing the target total energy. Allowed values are ‘pe’ or ‘te’. For ‘te’, the average total energy from the equilenergysamples is used as the target energy. For ‘pe’, the average potential energy plus 3/2 N kB T is used as the target energy. Default value is ‘pe’.

  • runsteps (int or None, optional) – The number of nve integration steps to perform on the system to obtain measurements of MSD and RDF of the liquid. Default value is 50000.

  • dumpsteps (int or None, optional) – Dump files will be saved every this many steps during the runsteps simulation. Default is None, which sets dumpsteps equal to the sum of all “steps” terms above so that only the final configuration is saved.

  • restartsteps (int or None, optional) – Restart files will be saved every this many steps. Default is None, which sets dumpsteps equal to the sum of all “steps” terms above so that only the final configuration is saved.

  • createvelocities (bool, optional) – If True (default), velocities will be created for the atoms prior to running the simulations. Setting this to False can be useful if the initial system already has velocity information.

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

Returns:

Dictionary of results consisting of keys:

  • ’dumpfile_final’ (str) - The name of the final dump file created.

  • ’symbols_final’ (list) - The symbols associated with the final dump file.

  • ’volume’ (float) - The volume per atom identified after the volume equilibration stage.

  • ’volume_stderr’ (float) - The standard error in the volume per atom measured during the volume equilibration stage.

  • ’E_total’ (float) - The total energy of the system used during the nve stage.

  • ’E_total_stderr’ (float) - The standard error in the mean total energy computed during the energy equilibration stage.

  • ’E_pot’ (float) - The mean measured potential energy during the energy equilibration stage.

  • ’E_pot_stderr’ (float) - The standard error in the mean potential energy during the energy equilibration stage.

  • ’measured_temp’ (float) - The mean measured temperature during the nve stage.

  • ’measured_temp_stderr’ (float) - The standard error in the measured temperature values of the nve stage.

  • ’measured_press’ (float) - The mean measured pressure during the nve stage.

  • ’measured_press_stderr’ (float) - The standard error in the measured pressure values of the nve stage.

  • ’time_values’ (numpy.array of float) - The values of time that correspond to the mean squared displacement values.

  • ’msd_x_values’ (numpy.array of float) - The mean squared displacement values only in the x direction.

  • ’msd_y_values’ (numpy.array of float) - The mean squared displacement values only in the y direction.

  • ’msd_z_values’ (numpy.array of float) - The mean squared displacement values only in the z direction.

  • ’msd_values’ (numpy.array of float) - The total mean squared displacement values.

  • ’lammps_output’ (atomman.lammps.Log) - The LAMMPS logfile output. Can be useful for checking the thermo data at each simulation stage.

Return type:

dict