lammps_step package#

Submodules#

lammps_step.custom module#

A custom script for LAMMPS

class lammps_step.custom.Custom(flowchart=None, title='Custom', extension=None)[source]#

Bases: Node

description_text(P=None)[source]#

Create the text description of what this step will do.

get_input(extras=None)[source]#

Get the custom input for LAMMPS

property git_revision#

The git version of this module.

property header#

A printable header for this section of output

property version#

The semantic version of this module.

lammps_step.custom_parameters module#

Control parameters for a custom step in LAMMPS

class lammps_step.custom_parameters.CustomParameters(defaults={}, data=None)[source]#

Bases: Parameters

The control parameters for Custom dynamics in LAMMPS

parameters = {'script': {'default': {}, 'default_units': None, 'description': 'Script:', 'enumeration': (), 'format_string': '', 'help_text': 'The custom script.', 'kind': 'string'}}#

lammps_step.custom_step module#

Main module.

class lammps_step.custom_step.CustomStep(flowchart=None, gui=None)[source]#

Bases: object

create_node(flowchart=None, **kwargs)[source]#

Return the new node object

create_tk_node(canvas=None, **kwargs)[source]#

Return the graphical Tk node object

description()[source]#

Return a description of what this extension does

my_description = {'description': 'A custom step for LAMMPS, where the user types in LAMMPS commmands directly', 'group': 'Customize', 'name': 'Custom'}#

lammps_step.energy module#

A single-point energy in LAMMPS

class lammps_step.energy.Energy(flowchart=None, title='Energy', extension=None, logger=<Logger lammps_step.energy (WARNING)>)[source]#

Bases: Node

Handle a singlepoint energy calculation in LAMMPS

analyze(indent='', data={}, table=None, output=[], **kwargs)[source]#

Parse the output and generating the text output and store the data in variables for other stages to access

calculate_enthalpy_of_formation(data)[source]#

Calculate the enthalpy of formation from the results of a calculation.

This uses tabulated values of the enthalpy of formation of the atoms for the elements and tabulated energies calculated for atoms with the current method.

Parameters:

data (dict) – The results of the calculation.

description_text(P=None)[source]#

Create the text description of what this step will do.

get_input(extras=None)[source]#

Get the input for an energy calculation for LAMMPS

property git_revision#

The git version of this module.

property header#

A printable header for this section of output

property model#

The full driver:task|level provenance label for this operation.

Composed from the parent’s model chemistry and this step’s task – e.g. LAMMPS:MD|MOPAC:SQM@PM6-ORG – so results are labeled (and made comparable) by what was actually done.

property results#

The storage for the results in the main LAMMPS step.

task = 'SP'#
property version#

The semantic version of this module.

lammps_step.energy.subscript(n)[source]#

Return the number using Unicode subscript characters.

lammps_step.energy_parameters module#

Control parameters for a single-point energy (SPE) in LAMMPS

class lammps_step.energy_parameters.EnergyParameters(defaults={}, data=None)[source]#

Bases: Parameters

The control parameters for Energy dynamics in LAMMPS

applies(key, values=None, _seen=None)[source]#

As seamm.Parameters.applies, plus: the pressure applies only when a pressure, not a general stress, is applied.

not_applicable_reason(key, values=None)[source]#

Why a parameter does not apply, for the builder’s messages.

not_implemented = ()#

Parameters that are defined but not yet implemented, so never apply.

parameters = {'create tables': {'default': 'yes', 'default_units': None, 'description': 'Create tables as needed:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to create tables as needed for results being saved into tables.', 'kind': 'boolean'}, 'results': {'default': {}, 'default_units': None, 'description': 'results', 'enumeration': (), 'format_string': '', 'help_text': 'The results to save to variables or in tables. ', 'kind': 'dictionary'}}#
pressure_keys = ()#

The parameters for the (isotropic) pressure, which apply only when a pressure rather than a general stress is applied.

lammps_step.energy_step module#

Main module.

class lammps_step.energy_step.EnergyStep(flowchart=None, gui=None)[source]#

Bases: object

create_node(flowchart=None, **kwargs)[source]#

Return the new node object

create_tk_node(canvas=None, **kwargs)[source]#

Return the graphical Tk node object

description()[source]#

Return a description of what this extension does

my_description = {'description': 'A single-point energy calculation', 'group': 'Calculations', 'name': 'Energy'}#

lammps_step.gpu_memory_parser module#

gpu_memory_parser.py

Parse nvidia-smi memory monitor logs produced by gpu_bind.sh and summarize GPU memory usage and utilization, including multi-GPU summaries.

The command for nvidia-smi looks like this:

# Start background memory monitor, writing peak to a log file
MEMORY_LOG="${SEAMM_MEMORY_LOG:-./gpu_${GPU_ID}_rank_${LOCAL_RANK}.log}"

nvidia-smi --query-gpu=timestamp,memory.used,memory.free,utilization.gpu                --format=csv -l 5 -i "$GPU_ID" > "$MEMORY_LOG" &
lammps_step.gpu_memory_parser.parse_gpu_memory_log(log_path)[source]#

Parse a gpu_bind.sh memory monitor log file and return summary statistics.

Initialization phase: samples before GPU utilization first becomes non-zero AND memory has stabilized (no longer growing significantly). Production phase: all samples after initialization.

Parameters:

log_path – Path to the nvidia-smi log file

Returns:

dict with statistics, or None if file cannot be parsed

lammps_step.gpu_memory_parser.print_gpu_summary(stats, label=None, fd=None)[source]#

Print summary for a single GPU log.

lammps_step.gpu_memory_parser.print_multi_gpu_summary(log_paths, fd=None)[source]#

Parse multiple GPU log files and print per-GPU and combined summary.

Parameters:

log_paths – list of paths to log files

lammps_step.heat_flux module#

Non-graphical part of the Heat Flux step in a LAMMPS flowchart

class lammps_step.heat_flux.HeatFlux(flowchart=None, title='Heat Flux', extension=None, logger=<Logger lammps_step.heat_flux (WARNING)>)[source]#

Bases: NVE

The non-graphical part of a Heat Flux step in a flowchart.

parser#

The parser object.

Type:

configargparse.ArgParser

options#

It contains a two item tuple containing the populated namespace and the list of remaining argument strings.

Type:

tuple

subflowchart#

A SEAMM Flowchart object that represents a subflowchart, if needed.

Type:

seamm.Flowchart

parameters#

The control parameters for Heat Flux.

Type:

HeatFluxParameters

See also

TkHeatFlux, HeatFlux, HeatFluxParameters

description_text(P=None)[source]#

Create the text description of what this step will do. The dictionary of control values is passed in as P so that the code can test values, etc.

Parameters:

P (dict) – An optional dictionary of the current values of the control parameters.

Returns:

A description of the current step.

Return type:

str

get_input(extras=None)[source]#

Get the input for a heat flux run in LAMMPS

property git_revision#

The git version of this module.

property header#

A printable header for this section of output

md_provides()[source]#

What this run will write to md.h5md: the heat flux every two steps.

property version#

The semantic version of this module.

lammps_step.heat_flux_parameters module#

Control parameters for the Heat Flux step in a SEAMM flowchart

class lammps_step.heat_flux_parameters.HeatFluxParameters(defaults={}, data=None)[source]#

Bases: NVE_Parameters

The control parameters for Heat Flux.

You need to replace the “time” entry in dictionary below these comments with the definitions of parameters to control this step. The keys are parameters for the current plugin,the values are dictionaries as outlined below.

Examples

parameters = {
    "time": {
        "default": 100.0,
        "kind": "float",
        "default_units": "ps",
        "enumeration": tuple(),
        "format_string": ".1f",
        "description": "Simulation time:",
        "help_text": ("The time to simulate in the dynamics run.")
    },
}
parameters{str: {str: str}}

A dictionary containing the parameters for the current step. Each key of the dictionary is a dictionary that contains the the following keys

parameters[“default”] :

The default value of the parameter, used to reset it.

parameters[“kind”]enum()

Specifies the kind of a variable. One of “integer”, “float”, “string”, “boolean”, or “enum”

While the “kind” of a variable might be a numeric value, it may still have enumerated custom values meaningful to the user. For instance, if the parameter is a convergence criterion for an optimizer, custom values like “normal”, “precise”, etc, might be adequate. In addition, any parameter can be set to a variable of expression, indicated by having “$” or “=” as the first character in the field. For example, $OPTIMIZER_CONV.

parameters[“default_units”]str

The default units, used for resetting the value.

parameters[“enumeration”]: tuple

A tuple of enumerated values.

parameters[“format_string”]: str

A format string for “pretty” output.

parameters[“description”]: str

A short string used as a prompt in the GUI.

parameters[“help_text”]: str

A longer string to display as help for the user.

See also

HeatFlux, TkHeatFlux, HeatFlux, Heat

parameters = {'filter': {'default': 'none', 'default_units': None, 'description': 'Filter the heat flux:', 'enumeration': ('none', 'per-atom averages'), 'format_string': '', 'help_text': "Whether to remove the constant parts of the per-atom energies and stresses from the heat flux. 'per-atom averages' subtracts each atom's average energy and stress, from a preliminary 5 ps run (Pereverzev & Sewell 2022). In a crystal, where each atom stays on its site, that removes noise without changing the thermal conductivity. In a liquid the atoms move, and it makes the thermal conductivity too large (about 20% for water), so use 'none' for liquids.", 'kind': 'enum'}, 'use centroid stress': {'applies_when': {'filter': 'none', 'heat flux': {'not': 'never'}}, 'default': 'yes', 'default_units': None, 'description': 'Use centroid/stress/atom:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to use the centroid form of the stress for the bonded terms and the constraints (SHAKE), which is the correct one.', 'kind': 'boolean'}}#

lammps_step.heat_flux_step module#

class lammps_step.heat_flux_step.HeatFluxStep(flowchart=None, gui=None)[source]#

Bases: object

Helper class needed for the stevedore integration.

This must provide a description() method that returns a dict containing a description of this node, and create_node() and create_tk_node() methods for creating the graphical and non-graphical nodes.

The dictionary for the description is the class variable just below these comments. The felds are as follows:

my_description{str, str}

A human-readable description of this step. It can be several lines long, and needs to be clear to non-expert users. It contains the following keys: description, group, name.

my_description[“description”]tuple

A description of the Heat Flux step. It must be clear to non-experts.

my_description[“group”]str

Which group in the menus to put this step. If the group does not exist it will be created. Common groups are “Building”, “Control”, “Custom”, “Data”, and “Simulations”.

my_description[“name”]str

The name of this step, to be displayed in the menus.

create_node(flowchart=None, **kwargs)[source]#

Create and return the new node object.

Parameters:
  • flowchart (seamm.Node) – A non-graphical SEAMM node

  • **kwargs (keyword arguments) – Various keyword arguments such as title, namespace or extension representing the title displayed in the flowchart, the namespace for the plugins of a subflowchart and the extension, respectively.

Return type:

HeatFlux

create_tk_node(canvas=None, **kwargs)[source]#

Create and return the graphical Tk node object.

Parameters:
  • canvas (tk.Canvas) – The Tk Canvas widget

  • **kwargs (keyword arguments) – Various keyword arguments such as tk_flowchart, node, x, y, w, h representing a graphical flowchart object, a non-graphical node for a step, and dimensions of the graphical node.

Return type:

TkHeatFlux

description()[source]#

Return a description of what this step does.

Returns:

description

Return type:

dict(str, str)

my_description = {'description': 'A LAMMPS step for calculating the heat flux', 'group': 'Calculations', 'name': 'Heat Flux'}#

lammps_step.initialization module#

A single-point initialization in LAMMPS

class lammps_step.initialization.Initialization(flowchart=None, title='Initialization', extension=None)[source]#

Bases: Node

MDI_QM_input()[source]#

Initialization input for QM-MD driven over MDI (e.g. MOPAC).

The QM engine computes the energy and forces for the whole system, so LAMMPS needs no pair_style – only fix mdi/qm, which ships the atoms to the engine and receives the forces back, exactly as the machine-learned forcefield path does. The engine itself is launched by lammps.py; here we only write the input deck. See campaigns/2026-06-22/NOTES_C.rst.

OpenKIM_energy_expression()[source]#

Create the (simple) energy expression for OpenKIM models.

OpenKIM_input()[source]#

Create the initialization input for a calculation using OpenKIM.

PyTorch_energy_expression()[source]#

Create the (simple) energy expression for PyTorch models.

PyTorch_input()[source]#

Create the initialization input for a calculation using MACE/PyTorch.

description_text(P=None)[source]#

Return a short description of this step.

Return a nicely formatted string describing what this step will do.

Keyword Arguments:

P – a dictionary of parameter values, which may be variables or final values. If None, then the parameters values will be used as is.

get_input(extras=None)[source]#

Get the input for the initialization of LAMMPS

property git_revision#

The git version of this module.

property header#

A printable header for this section of output

property kspace_methods#

The list of avilable methods

property version#

The semantic version of this module.

lammps_step.initialization.explicit_kspace(method, pair_style_base, n_charged_atoms, P)[source]#

The pair style and k-space style for an explicitly chosen k-space method.

Parameters:
  • method (str) – The k-space method, a key of lammps_step.kspace_methods.

  • pair_style_base (str) – The van der Waals pair style, e.g. “lj/cut”.

  • n_charged_atoms (int) – The number of atoms with a charge above the ‘small q’ threshold.

  • P (dict) – The step’s parameter values (for the accuracy and ‘small q’).

Returns:

The pair style, and the arguments of kspace_style (’’ for none).

Return type:

(str, str)

lammps_step.initialization_parameters module#

Control parameters for the initialization in LAMMPS

class lammps_step.initialization_parameters.InitializationParameters(defaults={}, data=None)[source]#

Bases: Parameters

The control parameters for the initialization in LAMMPS

obsolete = ('rigid_waters',)#

Parameters no longer used. “rigid_waters” made waters rigid by finding them in the structure; now the forcefield says which bonds and angles are rigid.

parameters = {'atomic charges': {'default': 'default for forcefield', 'default_units': '', 'description': 'Atomic charge handling:', 'enumeration': ('default for forcefield', 'no charges', 'charge equilibration (QEq), older reaxff implementation', 'charge equilibration (QEq) with point charges', 'charge equilibration (QEq) with shielded charges', 'charge equilibration with atom-condensed Kohn–Sham DFT (ACKS2)', 'charge transfer with polarization current equilibration (QTPIE)'), 'format_string': '', 'help_text': 'The method for handling atomic charges.', 'kind': 'enumeration'}, 'charged_atom_fraction_cutoff': {'default': 0.1, 'default_units': '', 'description': 'Cutoff for charged atoms:', 'enumeration': (), 'format_string': '.2f', 'help_text': 'The upper limit of the fraction of charged atoms for using methods that exploit sparsity of charges.', 'kind': 'float'}, 'cutoff': {'default': 10.0, 'default_units': 'Å', 'description': 'Cutoff:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'The cutoff used for non-bonded and similar interactions.', 'kind': 'float'}, 'ewald_atom_cutoff': {'default': 1000, 'default_units': '', 'description': 'Atom limit for using Ewald summations:', 'enumeration': (), 'format_string': 'd', 'help_text': 'The upper limit of the number of atoms for using Ewald summations by default.', 'kind': 'integer'}, 'fix_XH_bond_lengths': {'default': 'none', 'default_units': '', 'description': 'Fix X-H bond lengths', 'enumeration': ('none', 'all', 'CH'), 'format_string': '', 'help_text': 'Fix the bond lengths for H bonded to X.', 'kind': 'enumeration'}, 'kspace_accuracy': {'applies_when': {'kspace_method': {'not': 'none'}}, 'default': 1e-05, 'default_units': '', 'description': 'K-space accuracy:', 'enumeration': (), 'format_string': '.2e', 'help_text': 'The target accuracy for the k-space method.', 'kind': 'float'}, 'kspace_method': {'default': 'automatic', 'default_units': '', 'description': 'K-space method:', 'enumeration': ('automatic', 'none', 'Ewald summation method', 'PPPM (Particle-particle particle-mesh) method', 'PPPM method for few charged atoms', 'PPPM method with a staggered mesh', 'PPPM method including dispersion terms', 'MSM (Multilevel summation method)', 'MSM method for few charged atoms'), 'format_string': '', 'help_text': 'The method for handling long-range interactions.', 'kind': 'enumeration'}, 'kspace_smallq': {'applies_when': {'kspace_method': {'not': 'none'}}, 'default': 1e-05, 'default_units': '', 'description': 'K-space negligable charge:', 'enumeration': (), 'format_string': '.1e', 'help_text': 'The cutoff for the charge on an atom to be considered not zero. It decides whether there are charges needing a long-range method, and is the cutoff for the methods for few charged atoms.', 'kind': 'float'}, 'msm_atom_cutoff': {'default': 5000, 'default_units': '', 'description': 'Lower atom limit for using the MSM method:', 'enumeration': (), 'format_string': 'd', 'help_text': 'The lower limit of the number of atoms for using the MSM method by default.', 'kind': 'integer'}, 'qeq convergence': {'applies_when': {'atomic charges': ('default for forcefield', 'charge equilibration (QEq), older reaxff implementation', 'charge equilibration (QEq) with point charges', 'charge equilibration (QEq) with shielded charges', 'charge equilibration with atom-condensed Kohn–Sham DFT (ACKS2)', 'charge transfer with polarization current equilibration (QTPIE)')}, 'default': 1e-06, 'default_units': '', 'description': 'QEq convergence:', 'enumeration': (), 'format_string': '.2e', 'help_text': "The covergence goal for the charge equilibration, including the forcefield's default method if it equilibrates the charges.", 'kind': 'float'}, 'qeq iterations': {'applies_when': {'atomic charges': ('default for forcefield', 'charge equilibration (QEq), older reaxff implementation', 'charge equilibration (QEq) with point charges', 'charge equilibration (QEq) with shielded charges', 'charge equilibration with atom-condensed Kohn–Sham DFT (ACKS2)', 'charge transfer with polarization current equilibration (QTPIE)')}, 'default': 100, 'default_units': '', 'description': 'QEq iterations:', 'enumeration': (), 'format_string': 'd', 'help_text': 'The maximun number of iterations for the charge equilibration.', 'kind': 'integer'}, 'shift_nonbond': {'default': 'no', 'description': 'Shift nonbonded interactions to zero at the cutoff', 'enumeration': ('no', 'yes'), 'format_string': 's', 'help_text': 'Shift the nonbonded interactions to zero at the cutoff distance to avoid energy jumps.', 'kind': 'boolean'}, 'tail_correction': {'applies_when': {'kspace_method': {'not': 'PPPM method including dispersion terms'}}, 'default': 'yes', 'description': 'Add tail corrections', 'enumeration': ('no', 'yes'), 'format_string': 's', 'help_text': 'Add tail corrections for neglected long-range van der Waals terms.', 'kind': 'boolean'}}#
update(data)[source]#

Update the values, ignoring obsolete parameters from older flowcharts.

lammps_step.initialization_step module#

Main module.

class lammps_step.initialization_step.InitializationStep(flowchart=None, gui=None)[source]#

Bases: object

create_node(flowchart=None, **kwargs)[source]#

Return the new node object

create_tk_node(canvas=None, **kwargs)[source]#

Return the graphical Tk node object

description()[source]#

Return a description of what this extension does

my_description = {'description': 'The initialization of LAMMPS, specifying e.g. nonbond methods and cutoffs', 'group': 'Calculations', 'name': 'Initialization'}#

lammps_step.installer module#

Installer for the LAMMPS plug-in.

This handles any further installation needed after installing the Python package lammps-step.

class lammps_step.installer.Installer(*args: Any, **kwargs: Any)[source]#

Bases: InstallerBase

Handle further installation needed after installing lammps-step.

The Python package lammps-step should already be installed, using pip, conda, or similar. This plug-in-specific installer then checks for the LAMMPS executables, installing them if need be, and registers their location in seamm.ini.

Note

The LAMMPS step and this assume that the LAMMPS executables, if present, are in the same directory. In addition, for the parallel version using MPI it is assumed that mpiexec is either in that same directory, or the correct mpiexec can be found in the PATH.

There are a number of ways to determine which are the correct LAMMPS executables to use. The aim of this installer is to help the user locate the executables. There are a number of possibilities

  1. The correct executables are already available.

    1. If they are already registered in seamm.ini there is nothing else to do.

    2. They may be in the current path, in which case they need to be added to seamm.ini.

    3. If a module system is in use, a module may need to be loaded to give access to LAMMPS.

    4. They cannot be found automatically, so the user needs to locate the executables for the installer.

  2. LAMMPS is not installed on the machine. In this case they can be installed in a Conda environment. There is one choice

    1. They can be installed in a separate environment, seamm-lammps by default.

exe_version(config)[source]#

Get the version of the LAMMPS executable.

Parameters:

config (dict) – Dictionary of options for running LAMMPS

Returns:

The version reported by LAMMPS, or ‘unknown’.

Return type:

“LAMMPS”, str

lammps_step.lammps module#

A node or step for LAMMPS in a flowchart

class lammps_step.lammps.LAMMPS(flowchart=None, namespace='org.molssi.seamm.lammps', extension=None)[source]#

Bases: Node

FORCEFIELD_TYPES = ('FF', 'ReaxFF')#

Model-chemistry types that are forcefields LAMMPS evaluates itself

analyze(indent='', nodes=None, values={}, **kwargs)[source]#

Analyze the output of the calculation

analyze_trajectory(path, sampling_rate=20, control_properties=None, node=None)[source]#

Read a trajectory file and do the statistical analysis

angle_table(key, values)[source]#

Create a section of the tabulated angle file.

Parameters:
  • key (str) – The name for this section in the file.

  • values ({str: int, float, or str}) –

    The dictionary of the constants for this angle term. It looks like this:

    {
        'reference': '5',
        'Eqn': 'K/8*(1-cos(n*Theta)) + A/(2*Rb*sin(Theta/2))**12',
        'K': 278.4416826003824,
        'n': 4,
        'Rb': 1.606,
        'A': 11.950286806883364,
        'zero-shift': 0.001
    }
    

Returns:

A list of lines of the tabulated angle file.

Return type:

[str]

static box_to_cell(lx, ly, lz, xy, xz, yz)[source]#

Convert the LAMMPS box definition to cell parameters.

static cell_to_box(a, b, c, alpha, beta, gamma)[source]#

Convert cell parameters to the LAMMPS box.

check_barostats(nodes)[source]#

Check that the box suits the barostats, before running LAMMPS.

LAMMPS writes one box for all the steps, and press/berendsen cannot work with a triclinic box, which a later step allowing shear or a cell that is not orthorhombic requires.

check_following_analyses(configuration)[source]#

Ask the analysis steps that will read this MD whether the structure suits.

Each step after this one, up to the next LAMMPS step, that has a check_configuration method is asked. One that cannot use the structure, e.g. an analysis needing a periodic system, raises an exception, so the job stops before the MD rather than after it.

Parameters:

configuration (molsystem._Configuration) – The structure about to be simulated.

check_for_lammps_error(result=None)[source]#

Raise an error, with a readable message, if LAMMPS failed.

create_parser()[source]#

Setup the command-line / config file parser

description_text(P=None)[source]#

Return a short description of this step.

Return a nicely formatted string describing what this step will do.

Keyword Arguments:

P – a dictionary of parameter values, which may be variables or final values. If None, then the parameters values will be used as is.

display_title = {'DfH0_reax': 'Reax ΔfH⁰', 'E_hbond': 'Energy of H-bonds', 'Eke': 'Kinetic Energy', 'Emol': 'Molecular Energy, Valence Terms', 'Epair': 'Pair (Nonbond) Energy', 'Epe': 'Potential Energy', 'Etot': 'Total Energy', 'Jx': 'heat flux in x', 'Jy': 'heat flux in y', 'Jz': 'heat flux in z', 'Kappa': 'thermal conductivity', 'Kappa_x': 'thermal conductivity in x', 'Kappa_y': 'thermal conductivity in y', 'Kappa_z': 'thermal conductivity in z', 'N_hbond': 'Number of H-bonds', 'P': 'Pressure', 'Sxx': 'Sxx', 'Sxy': 'Sxy', 'Sxz': 'Sxz', 'Syy': 'Syy', 'Syz': 'Syz', 'Szz': 'Szz', 'T': 'Temperature', 'V': 'Volume', 'a': 'a lattice parameter', 'b': 'b lattice parameter', 'c': 'c lattice parameter', 'density': 'Density', 't': 'Time', 'u': 'atom PE'}#
display_units = {'DfH0_reax': 'kcal/mol', 'E_hbond': 'kcal/mol', 'Eke': 'kcal/mol', 'Emol': 'kcal/mol', 'Epair': 'kcal/mol', 'Epe': 'kcal/mol', 'Etot': 'kcal/mol', 'Jx': 'W/m^2', 'Jy': 'W/m^2', 'Jz': 'W/m^2', 'Kappa': 'W/K/m', 'Kappa_x': 'W/K/m', 'Kappa_y': 'W/K/m', 'Kappa_z': 'W/K/m', 'N_hbond': '', 'P': 'atm', 'Sxx': 'atm', 'Sxy': 'atm', 'Sxz': 'atm', 'Syy': 'atm', 'Syz': 'atm', 'Szz': 'atm', 'T': 'K', 'V': 'Å^3', 'a': 'Å', 'alpha': 'º', 'b': 'Å', 'beta': 'º', 'c': 'Å', 'density': 'g/mL', 'gamma': 'º', 't': 'fs', 'u': 'kcal/mol'}#
property eex#

The energy expression.

ff_form()[source]#

Return the form of the forcefield.

following_nodes()[source]#

The steps after this one in execution order, up to the next LAMMPS step.

Loop bodies after this step are not entered; a loop around this step is left through its exit. Only the flowchart’s edges are followed, so no step’s state changes.

property force_triclinic#

Whether to force a triclinic cell.

forcefield()[source]#

The forcefield for this run.

From a forcefield model chemistry (FF@oplsaa, ReaxFF@...), built by the step that offers it (forcefield_step) and kept for the next run with the same model chemistry; otherwise the Forcefield step’s _forcefield: a seamm_ff_util forcefield, or “OpenKIM” or “PyTorch”.

forcefield_model_chemistry()[source]#

The model chemistry, if it is a forcefield (FF or ReaxFF), else None.

get_dump(dumpfile)[source]#

Read the LAMMPS dumpfile and return the data.

Parameters:

dumpfile (str) – The filename (or path) to the dumpfile.

property git_revision#

The git version of this module.

property have_dreiding_hbonds#

Whether the system has Dreiding hydrogen bonds.

mlff_model_chemistry()[source]#

The model chemistry, if it is a machine-learned forcefield (MLFF), else None.

model_chemistry(task)[source]#

Compose the full driver:task|level provenance label for a task.

task is the LAMMPS operation – "SP", "OPT", "MD". For a QM-MD-over-MDI run the level (owner/type/method/…) comes from the _model_chemistry variable, giving e.g. "LAMMPS:MD|MOPAC:SQM@PM6-ORG" (or, classical, the owner collapses to "LAMMPS:MD|FF@oplsaa"). For classical / MLFF / OpenKIM runs the level is not yet classified into type@method, so the legacy bare label (self.model) is returned unchanged. See model_chemistry_naming.rst.

pytorch_model()[source]#

The machine-learned forcefield’s checkpoint: an MLFF model chemistry’s, else the Forcefield step’s _pytorch_model.

read_dump(dumpfile)[source]#

Read the LAMMPS dumpfile and update the system.

Parameters:

dumpfile (str) – The filename (or path) to the dumpfile.

record_timing(ce, wall, result)[source]#

Append this run’s timing record (~/.seamm.d/timing/lammps.csv) with timing_descriptors(); never raises.

property results#

The storage for results.

run()[source]#

Run a LAMMPS simulation

set_id(node_id)[source]#

Set the id for node to a given tuple

shake_fix(P, eex)[source]#

Create the ‘fix shake’ line for rigid bonds and angles and X-H bonds.

Parameters:
  • P (dict) – The parameters for the initialization step as a dict.

  • eex (dict) – The energy expression for this calculation

Returns:

line – The correct fix line for LAMMPS

Return type:

str

structure_data()[source]#

Create the LAMMPS structure file from the energy expression

property version#

The semantic version of this module.

lammps_step.lammps.MLFF_PAIR = 'mpirun --bind-to none -np 1 {bind} {engine} : -np 1 {bind} lmp -mdi "-role DRIVER -name LAMMPS -method MPI"'#

The launch of an MLFF engine and the LAMMPS driver as an MPI pair. {bind} is mdi_bind.sh and {engine} the engine’s command; “-in input.dat” is appended. lammps.ini’s “mlff-code” replaces it, e.g. to give mpirun other options.

lammps_step.lammps.MLFF_TCP_DRIVER = 'lmp -mdi "-role DRIVER -name LAMMPS -method TCP -port {port}"'#

the two meet over TCP on localhost. The engine’s command carries its own conda run. Each side runs through mdi_bind.sh ({bind}), which stops the other when one fails – otherwise LAMMPS would wait forever for an engine that died starting. The engine dials until LAMMPS listens, so it may start first. lammps.ini’s “mlff-tcp-code” replaces the LAMMPS line, e.g. to name another executable.

Type:

The launch of an MLFF engine in another environment than LAMMPS

lammps_step.lammps.TIMING_SPEC = {'default_alpha': 0.8, 'klass': ['ff_form', 'model'], 'multiplier': None, 'size': ['n_atoms'], 'task': None, 'units': 'md_steps'}#

atoms as the size variable, MD steps as the unit, and the forcefield as the class – its form (PyTorch, OpenKIM, MDI/QM, or a classical form) and the model itself, since an MLFF and a classical forcefield differ by orders of magnitude per atom-step. Written beside the records when a run is recorded.

Type:

What the cost model is made of (seamm_exec.timing_model.Spec as plain data)

lammps_step.lammps.lammps_error(log, screen='')[source]#

Find the error, if any, in LAMMPS’s log (log.lammps) or screen output.

Parameters:
  • log (str) – The text of log.lammps.

  • screen (str) – The screen output (stdout), which has errors raised by processes other than the first, which are not in the log.

Returns:

The error “message”, the “step” running (from the “# Step …” comments in the input), the “last command”, and any “advice”; or None if there was no error.

Return type:

dict or None

lammps_step.lammps.lammps_error_message(error, directory=None)[source]#

A readable message for an error found by lammps_error.

lammps_step.lammps.logging_disabled(highest_level=50)[source]#

A context manager that will prevent any logging messages triggered during the body from being processed.

Parameters:

highest_level – the maximum logging level in use. This would only need to be changed if a custom level greater than CRITICAL is defined.

From Simon Weber https://gist.github.com/simon-weber/7853144

lammps_step.lammps.pline(i, function, values, keys, types, rtypes, fmt='10.4f', default='n/a')[source]#

Create a line for the parameters in structure.dat

lammps_step.lammps.pvalue(values, key, fmt='9.4f', default='n/a')[source]#

Return the formatted value and original value of a parameter.

Parameters:
  • values ([str: str]) – The dictionary of parameter values.

  • key (str) – The parameter name

  • fmt (str = "9.4f") – The format for the parameter

  • default (str = "n/a") – The default value for the original parameter, if not find.

Returns:

The formatted parameter value and the original form it came from.

Return type:

(str, str)

lammps_step.lammps.timing_descriptors(control, log_text=None, configuration=None)[source]#

The descriptors of a LAMMPS run for its timing record (seamm_exec’s campaign of 2026-10-05): the structure, the kinds of calculation in the run (the sub-steps’ names), and from the log the Loop time lines – MD steps, atoms, processes and LAMMPS’s own time summed over the runs – whose product of steps and atoms is the unit of cost.

lammps_step.lammps_step module#

Helper class needed for the stevedore integration. Needs to provide a description() method that returns a dict containing a description of this node, and a factory() method for creating the graphical and non-graphical nodes.

class lammps_step.lammps_step.LAMMPSStep(flowchart=None, gui=None)[source]#

Bases: object

create_node(flowchart=None, **kwargs)[source]#

Return the new node object

create_tk_node(canvas=None, **kwargs)[source]#

Return the graphical Tk node object

description()[source]#

Return a description of what this extension does

my_description = {'description': 'An interface for the LAMMPS molecular dynamics code', 'group': 'Simulations', 'name': 'LAMMPS'}#

lammps_step.lammps_units module#

Definition of unit systems in LAMMPS.

lammps_step.lammps_units.from_lammps_units(value, units, quantity=None, unit_system=None)[source]#

Convert the scalar value from LAMMPS units to requested units

lammps_step.lammps_units.get_lammps_unit_system()[source]#

Get the default unit system for LAMMPS.

lammps_step.lammps_units.lammps_units(quantity, unit_system=None)[source]#

Return the current LAMMPS units for the given quantity.

lammps_step.lammps_units.set_lammps_unit_system(value)[source]#

Set the default unit system for LAMMPS.

lammps_step.lammps_units.to_lammps_units(value, units=None, quantity=None, unit_system=None)[source]#

Convert the value with units to the current LAMMPS units.

lammps_step.md_h5md module#

Convert the output of an MD sub-step to SEAMM’s H5MD file, md.h5md.

LAMMPS writes its usual text files during the run. When the run ends, the NVE, NVT and NPT sub-steps (and Heat Flux, an NVE run) stream them into md.h5md in the sub-step’s directory, with the layout described in seamm_md_analysis (“The H5MD file”), and add a record of the run to the workspace variable _md_runs. The native files are kept.

class lammps_step.md_h5md.MDH5MDConverter(node, P, configuration, directory=None, wall_time=None)[source]#

Bases: object

Write md.h5md for one MD sub-step.

Parameters:
  • node (lammps_step.NVE) – The sub-step (NVE, NVT, NPT or Heat Flux).

  • P (dict) – Its parameters, as values.

  • configuration (molsystem._Configuration) – The configuration at the start of the run.

  • directory (str or pathlib.Path = None) – The sub-step’s directory, by default node.directory.

  • wall_time (float = None) – The wall time of the run in seconds (LAMMPS’s loop time).

property ensemble#
property path#
record()[source]#

The record of this run for the workspace variable _md_runs.

write()[source]#

Write md.h5md from the native files.

Returns:

The record of the run for _md_runs.

Return type:

dict

lammps_step.md_h5md.h5md_units(unit_system=None)[source]#

The H5MD unit strings for a LAMMPS unit system.

Parameters:

unit_system (str = None) – The LAMMPS unit system, by default the current one.

Returns:

{str – The unit for each LAMMPS quantity (“time”, “distance”, “energy”, …).

Return type:

str}

lammps_step.md_h5md.periodic_only = ('pressure', 'pressure_tensor', 'volume', 'density', 'heat_flux')#

The observables that need the volume of a periodic cell

lammps_step.md_h5md.state_observables = {'E_hbond': ('hbond_energy', 'energy'), 'Eke': ('kinetic_energy', 'energy'), 'Emol': ('molecular_energy', 'energy'), 'Epair': ('pair_energy', 'energy'), 'Epe': ('potential_energy', 'energy'), 'Etot': ('total_energy', 'energy'), 'N_hbond': ('hbond_count', None), 'P': ('pressure', 'pressure'), 'T': ('temperature', 'temperature'), 'V': ('volume', 'volume'), 'density': ('density', 'density')}#

The columns of the state files and the observables they become, with the LAMMPS quantity that gives their units.

lammps_step.md_h5md.write_md_h5md(node, P, configuration, directory=None, wall_time=None)[source]#

Write md.h5md for an MD sub-step and record it in _md_runs.

A failure is reported, not raised: the native files are still there.

Parameters:
  • node (lammps_step.NVE) – The sub-step.

  • P (dict) – Its parameters, as values.

  • configuration (molsystem._Configuration) – The configuration at the start of the run.

  • directory (str or pathlib.Path = None) – The sub-step’s directory, by default node.directory.

  • wall_time (float = None) – The wall time of the run in seconds.

Returns:

Text for the output.

Return type:

str

lammps_step.md_provides module#

What the LAMMPS MD sub-steps will write to md.h5md, known from their parameters.

The NVE, NVT, NPT and Heat Flux sub-steps use these to tell analysis steps what a run will provide (md_provides) before it runs, and to turn on sampling an analysis needs (request_sampling). The names are those of the H5MD file (see seamm_md_analysis, “The H5MD file”).

lammps_step.md_provides.md_provides(node)[source]#

What an NVE, NVT or NPT sub-step will write to md.h5md.

Parameters:

node (lammps_step.NVE) – The sub-step.

Return type:

seamm_md_analysis.Provides

lammps_step.md_provides.request_sampling(node, need)[source]#

Turn on the sampling a need asks for, if possible.

Parameters:
  • node (lammps_step.NVE) – The sub-step to change.

  • need (seamm_md_analysis.Need) – What is needed; its first name that this step can sample is used.

Returns:

A description of the change for the output, or None if the step could not provide it (e.g. the interval is in steps and the timestep is not known).

Return type:

str or None

lammps_step.md_provides.sampling_parameters = {'all/position': ('atomic positions', 'atomic positions rate', 'atomic positions number of samples'), 'all/velocity': ('atomic velocities', 'atomic velocities rate', 'atomic velocities number of samples'), 'heat_flux': ('heat flux', 'heat flux rate', 'heat flux number of samples'), 'molecules/position': ('com positions', 'com positions rate', 'com positions number of samples'), 'molecules/velocity': ('com velocities', 'com velocities rate', 'com velocities number of samples'), 'pressure_tensor': ('pressure tensor', 'pressure tensor rate', 'pressure tensor number of samples')}#

(choice, rate, number of samples)

Type:

The sampling parameters for each name

lammps_step.md_provides.state_observables = ('temperature', 'pressure', 'pressure_tensor', 'total_energy', 'kinetic_energy', 'potential_energy', 'pair_energy')#

The observables in the state files, and those of NPT runs

lammps_step.md_provides.static_value(node, key)[source]#

A parameter’s value before the run, or None if it cannot be known yet.

A variable or expression is evaluated if the flowchart’s variables already define it (at run time); otherwise it is unknown.

lammps_step.metadata module#

This file contains metadata to help describe the results of LAMMPS calculations, etc.

lammps_step.metadata.metadata = {'results': {'DfE0': {'description': 'the energy of formation', 'dimensionality': 'scalar', 'format': '.2f', 'property': 'DfE0#LAMMPS#{model}', 'type': 'float', 'units': 'kcal/mol'}, 'DfH0_reax': {'calculation': ['energy', 'minimization'], 'description': 'the Reax approximation to the enthalpy of formation', 'dimensionality': 'scalar', 'format': '.2f', 'property': 'DfH0_reax#LAMMPS#{model}', 'type': 'float', 'units': 'kcal/mol'}, 'E atomization': {'description': 'the energy of formation from atoms', 'dimensionality': 'scalar', 'format': '.2f', 'property': 'E atomization#LAMMPS#{model}', 'type': 'float', 'units': 'kcal/mol'}, 'Eke': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'kinetic energy', 'dimensionality': 'scalar', 'property': 'kinetic energy#LAMMPS#{model}', 'type': 'float', 'units': 'kcal/mol'}, 'Eke,inefficiency': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'statistical inefficiency of kinetic energy sampling', 'dimensionality': 'scalar', 'property': 'kinetic energy, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'Eke,stderr': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'stderr of kinetic energy', 'dimensionality': 'scalar', 'property': 'kinetic energy, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'kcal/mol'}, 'Eke,tau': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'autocorrelation time of kinetic energy', 'dimensionality': 'scalar', 'property': 'kinetic energy, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'Epair': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'nonbonded (vdW & electrostatic) energy', 'dimensionality': 'scalar', 'type': 'float', 'units': 'kcal/mol'}, 'Epair,inefficiency': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'statistical inefficiency of nonbond energy sampling', 'dimensionality': 'scalar', 'type': 'float', 'units': ''}, 'Epair,stderr': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'stderr of nonbond energy', 'dimensionality': 'scalar', 'type': 'float', 'units': 'kcal/mol'}, 'Epair,tau': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'autocorrelation time of nonbond energy', 'dimensionality': 'scalar', 'type': 'float', 'units': 'fs'}, 'Epe': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'potential energy', 'dimensionality': 'scalar', 'property': 'potential energy#LAMMPS#{model}', 'type': 'float', 'units': 'kcal/mol'}, 'Epe,inefficiency': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'statistical inefficiency of potential energy sampling', 'dimensionality': 'scalar', 'property': 'potential energy, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'Epe,stderr': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'stderr of potential energy', 'dimensionality': 'scalar', 'property': 'potential energy, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'kcal/mol'}, 'Epe,tau': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'autocorrelation time of potential energy', 'dimensionality': 'scalar', 'property': 'potential energy, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'Etot': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'total energy', 'dimensionality': 'scalar', 'property': 'total energy#LAMMPS#{model}', 'type': 'float', 'units': 'kcal/mol'}, 'Etot,inefficiency': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'statistical inefficiency of total energy sampling', 'dimensionality': 'scalar', 'property': 'total energy, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'Etot,stderr': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'stderr of total energy', 'dimensionality': 'scalar', 'property': 'total energy, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'kcal/mol'}, 'Etot,tau': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'autocorrelation time of total energy', 'dimensionality': 'scalar', 'property': 'total energy, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'N force evaluations': {'calculation': ['minimization'], 'description': 'number of force evaluations', 'dimensionality': 'scalar', 'type': 'integer'}, 'N steps optimization': {'calculation': ['minimization'], 'description': 'number of optimization steps', 'dimensionality': 'scalar', 'type': 'integer'}, 'P': {'description': 'pressure', 'dimensionality': 'scalar', 'property': 'pressure#LAMMPS#{model}', 'type': 'float', 'units': 'atm'}, 'P,inefficiency': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'statistical inefficiency of pressure sampling', 'dimensionality': 'scalar', 'property': 'pressure, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'P,stderr': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'stderr of pressure', 'dimensionality': 'scalar', 'property': 'pressure, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'atm'}, 'P,tau': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'autocorrelation time of pressure', 'dimensionality': 'scalar', 'property': 'pressure, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'RMSD': {'calculation': ['minimization'], 'description': 'RMSD with H removed', 'dimensionality': 'scalar', 'type': 'float', 'units': 'Å'}, 'RMSD with H': {'calculation': ['minimization'], 'description': 'RMSD including H atoms', 'dimensionality': 'scalar', 'type': 'float', 'units': 'Å'}, 'SEAMM elapsed time': {'description': 'total elapsed time for LAMMPS', 'dimensionality': 'scalar', 'format': '.1f', 'type': 'float', 'units': 's'}, 'SEAMM np': {'description': 'number of processors for LAMMPS', 'dimensionality': 'scalar', 'format': 'd', 'type': 'integer'}, 'Sxx': {'description': 'Sxx', 'dimensionality': 'scalar', 'property': 'Sxx#LAMMPS#{model}', 'type': 'float', 'units': 'atm'}, 'Sxx,inefficiency': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'statistical inefficiency of Sxx sampling', 'dimensionality': 'scalar', 'property': 'Sxx, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'Sxx,stderr': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'stderr of Sxx', 'dimensionality': 'scalar', 'property': 'Sxx, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'atm'}, 'Sxx,tau': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'autocorrelation time of Sxx', 'dimensionality': 'scalar', 'property': 'Sxx, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'Sxy': {'description': 'Sxy', 'dimensionality': 'scalar', 'property': 'Sxy#LAMMPS#{model}', 'type': 'float', 'units': 'atm'}, 'Sxy,inefficiency': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'statistical inefficiency of Sxy sampling', 'dimensionality': 'scalar', 'property': 'Sxy, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'Sxy,stderr': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'stderr of Sxy', 'dimensionality': 'scalar', 'property': 'Sxy, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'atm'}, 'Sxy,tau': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'autocorrelation time of Sxy', 'dimensionality': 'scalar', 'property': 'Sxy, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'Sxz': {'description': 'Sxz', 'dimensionality': 'scalar', 'property': 'Sxz#LAMMPS#{model}', 'type': 'float', 'units': 'atm'}, 'Sxz,inefficiency': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'statistical inefficiency of Sxz sampling', 'dimensionality': 'scalar', 'property': 'Sxz, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'Sxz,stderr': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'stderr of Sxz', 'dimensionality': 'scalar', 'property': 'Sxz, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'atm'}, 'Sxz,tau': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'autocorrelation time of Sxz', 'dimensionality': 'scalar', 'property': 'Sxz, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'Syy': {'description': 'Syy', 'dimensionality': 'scalar', 'property': 'Syy#LAMMPS#{model}', 'type': 'float', 'units': 'atm'}, 'Syy,inefficiency': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'statistical inefficiency of Syy sampling', 'dimensionality': 'scalar', 'property': 'Syy, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'Syy,stderr': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'stderr of Syy', 'dimensionality': 'scalar', 'property': 'Syy, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'atm'}, 'Syy,tau': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'autocorrelation time of Syy', 'dimensionality': 'scalar', 'property': 'Syy, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'Syz': {'description': 'Syz', 'dimensionality': 'scalar', 'property': 'Syz#LAMMPS#{model}', 'type': 'float', 'units': 'atm'}, 'Syz,inefficiency': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'statistical inefficiency of Syz sampling', 'dimensionality': 'scalar', 'property': 'Syz, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'Syz,stderr': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'stderr of Syz', 'dimensionality': 'scalar', 'property': 'Syz, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'atm'}, 'Syz,tau': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'autocorrelation time of Syz', 'dimensionality': 'scalar', 'property': 'Syz, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'Szz': {'description': 'Szz', 'dimensionality': 'scalar', 'property': 'Szz#LAMMPS#{model}', 'type': 'float', 'units': 'atm'}, 'Szz,inefficiency': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'statistical inefficiency of Szz sampling', 'dimensionality': 'scalar', 'property': 'Szz, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'Szz,stderr': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'stderr of Szz', 'dimensionality': 'scalar', 'property': 'Szz, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'atm'}, 'Szz,tau': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'autocorrelation time of Szz', 'dimensionality': 'scalar', 'property': 'Szz, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'T': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'temperature', 'dimensionality': 'scalar', 'property': 'temperature#LAMMPS#{model}', 'type': 'float', 'units': 'K'}, 'T,inefficiency': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'statistical inefficiency of temperature sampling', 'dimensionality': 'scalar', 'property': 'temperature, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'T,stderr': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'stderr of temperature', 'dimensionality': 'scalar', 'property': 'temperature, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'K'}, 'T,tau': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'autocorrelation time of temperature', 'dimensionality': 'scalar', 'property': 'temperature, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'V': {'description': 'V', 'dimensionality': 'scalar', 'property': 'volume#LAMMPS#{model}', 'type': 'float', 'units': 'Å^3'}, 'V,inefficiency': {'calculation': ['npt'], 'description': 'statistical inefficiency of V sampling', 'dimensionality': 'scalar', 'property': 'volume, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'V,stderr': {'calculation': ['npt'], 'description': 'stderr of V', 'dimensionality': 'scalar', 'property': 'volume, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'Å^3'}, 'V,tau': {'calculation': ['npt'], 'description': 'autocorrelation time of V', 'dimensionality': 'scalar', 'property': 'volume, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'a': {'description': "cell parameter 'a'", 'dimensionality': 'scalar', 'property': 'cell_a#LAMMPS#{model}', 'type': 'float', 'units': 'Å'}, 'a,inefficiency': {'calculation': ['npt'], 'description': "statistical inefficiency of cell 'a' sampling", 'dimensionality': 'scalar', 'property': 'cell_a, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'a,stderr': {'calculation': ['npt'], 'description': "stderr of cell 'a'", 'dimensionality': 'scalar', 'property': 'cell_a, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'Å'}, 'a,tau': {'calculation': ['npt'], 'description': "autocorrelation time of cell 'a'", 'dimensionality': 'scalar', 'property': 'cell_a, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'alpha': {'description': "cell parameter 'alpha'", 'dimensionality': 'scalar', 'property': 'cell_alpha#LAMMPS#{model}', 'type': 'float', 'units': 'degree'}, 'alpha,inefficiency': {'calculation': ['npt'], 'description': "statistical inefficiency of cell 'alpha' sampling", 'dimensionality': 'scalar', 'property': 'cell_alpha, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'alpha,stderr': {'calculation': ['npt'], 'description': "stderr of cell 'alpha'", 'dimensionality': 'scalar', 'property': 'cell_alpha, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'degree'}, 'alpha,tau': {'calculation': ['npt'], 'description': "autocorrelation time of cell 'alpha'", 'dimensionality': 'scalar', 'property': 'cell_alpha, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'average gpu utilization': {'description': 'GPU utilization', 'dimensionality': 'scalar', 'format': '.1f', 'type': 'float'}, 'b': {'description': "cell parameter 'b'", 'dimensionality': 'scalar', 'property': 'cell_b#LAMMPS#{model}', 'type': 'float', 'units': 'Å'}, 'b,inefficiency': {'calculation': ['npt'], 'description': "statistical inefficiency of cell 'b' sampling", 'dimensionality': 'scalar', 'property': 'cell_b, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'b,stderr': {'description': "stderr of cell 'b'", 'dimensionality': 'scalar', 'property': 'cell_b, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'Å'}, 'b,tau': {'calculation': ['npt'], 'description': "autocorrelation time of cell 'b'", 'dimensionality': 'scalar', 'property': 'cell_b, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'beta': {'description': "cell parameter 'beta'", 'dimensionality': 'scalar', 'property': 'cell_beta#LAMMPS#{model}', 'type': 'float', 'units': 'degree'}, 'beta,inefficiency': {'calculation': ['npt'], 'description': "statistical inefficiency of cell 'beta' sampling", 'dimensionality': 'scalar', 'property': 'cell_beta, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'beta,stderr': {'calculation': ['npt'], 'description': "stderr of cell 'beta'", 'dimensionality': 'scalar', 'property': 'cell_beta, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'degree'}, 'beta,tau': {'calculation': ['npt'], 'description': "autocorrelation time of cell 'beta'", 'dimensionality': 'scalar', 'property': 'cell_beta, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'c': {'description': "cell parameter 'c'", 'dimensionality': 'scalar', 'property': 'cell_c#LAMMPS#{model}', 'type': 'float', 'units': 'Å'}, 'c,inefficiency': {'calculation': ['npt'], 'description': "statistical inefficiency of cell 'c' sampling", 'dimensionality': 'scalar', 'property': 'cell_c, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'c,stderr': {'calculation': ['npt'], 'description': "stderr of cell 'c'", 'dimensionality': 'scalar', 'property': 'cell_c, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'Å'}, 'c,tau': {'calculation': ['npt'], 'description': "autocorrelation time of cell 'c'", 'dimensionality': 'scalar', 'property': 'cell_c, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'delta V': {'description': 'change in V', 'dimensionality': 'scalar', 'type': 'float', 'units': 'Å^3'}, 'delta a': {'description': "change in 'a'", 'dimensionality': 'scalar', 'type': 'float', 'units': 'Å'}, 'delta alpha': {'description': "change in 'alpha'", 'dimensionality': 'scalar', 'type': 'float', 'units': 'degree'}, 'delta b': {'description': "change in 'b'", 'dimensionality': 'scalar', 'type': 'float', 'units': 'Å'}, 'delta beta': {'description': "change in 'beta'", 'dimensionality': 'scalar', 'type': 'float', 'units': 'degree'}, 'delta c': {'description': "change in 'c'", 'dimensionality': 'scalar', 'type': 'float', 'units': 'Å'}, 'delta density': {'description': 'change in density', 'dimensionality': 'scalar', 'type': 'float', 'units': 'g/ml'}, 'delta gamma': {'description': "change in 'gamma'", 'dimensionality': 'scalar', 'type': 'float', 'units': 'degree'}, 'density': {'description': 'density', 'dimensionality': 'scalar', 'property': 'density#LAMMPS#{model}', 'type': 'float', 'units': 'g/ml'}, 'density,inefficiency': {'calculation': ['npt'], 'description': 'statistical inefficiency of density sampling', 'dimensionality': 'scalar', 'property': 'density, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'density,stderr': {'calculation': ['npt'], 'description': 'stderr of density', 'dimensionality': 'scalar', 'property': 'density, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'g/ml'}, 'density,tau': {'calculation': ['npt'], 'description': 'autocorrelation time of density', 'dimensionality': 'scalar', 'property': 'density, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'displaced atom': {'calculation': ['minimization'], 'description': 'Atom index with largest displacement', 'dimensionality': 'scalar', 'type': 'integer'}, 'displaced atom with H': {'calculation': ['minimization'], 'description': 'Atom index with largest displacement, including H', 'dimensionality': 'scalar', 'type': 'integer'}, 'energy': {'calculation': ['energy', 'minimization'], 'description': 'The total energy', 'dimensionality': 'scalar', 'property': 'total energy#LAMMPS#{model}', 'type': 'float', 'units': 'kcal/mol'}, 'energy change': {'calculation': ['minimization'], 'description': 'the last energy change', 'dimensionality': 'scalar', 'format': '.2f', 'type': 'float', 'units': 'kcal/mol'}, 'energy change threshold': {'calculation': ['minimization'], 'description': 'the threshold for the energy change', 'dimensionality': 'scalar', 'format': '.2f', 'type': 'float', 'units': 'kcal/mol/Å'}, 'force norm': {'calculation': ['minimization'], 'description': 'the l2 norm of the force vector', 'dimensionality': 'scalar', 'format': '.2f', 'type': 'float', 'units': 'kcal/mol/Å'}, 'force norm threshold': {'calculation': ['minimization'], 'description': 'the l2 norm of the force vector threshold', 'dimensionality': 'scalar', 'format': '.2f', 'type': 'float', 'units': 'kcal/mol/Å'}, 'gamma': {'description': "cell parameter 'gamma'", 'dimensionality': 'scalar', 'property': 'cell_gamma#LAMMPS#{model}', 'type': 'float', 'units': 'degree'}, 'gamma,inefficiency': {'calculation': ['npt'], 'description': "statistical inefficiency of cell 'gamma' sampling", 'dimensionality': 'scalar', 'property': 'cell_gamma, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'gamma,stderr': {'calculation': ['npt'], 'description': "stderr of cell 'gamma'", 'dimensionality': 'scalar', 'property': 'cell_gamma, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'degree'}, 'gamma,tau': {'calculation': ['npt'], 'description': "autocorrelation time of cell 'gamma'", 'dimensionality': 'scalar', 'property': 'cell_gamma, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 'gpu maximum atoms': {'description': 'GPU maximum atoms', 'dimensionality': 'scalar', 'type': 'integer'}, 'gpu memory free': {'description': 'GPU memory free', 'dimensionality': 'scalar', 'format': '.1f', 'type': 'float', 'units': 'GiB'}, 'gpu memory used': {'description': 'GPU memory used', 'dimensionality': 'scalar', 'format': '.1f', 'type': 'float', 'units': 'GiB'}, 'gradients': {'description': 'The gradients', 'dimensionality': '[3, n_atoms]', 'property': 'gradients#LAMMPS#{model}', 'type': 'float', 'units': 'kcal/mol/Å'}, 'katom-steps/s': {'description': 'Rate of simulation', 'dimensionality': 'scalar', 'format': '.2f', 'type': 'float', 'units': '1/s'}, 'maximum displacement': {'calculation': ['minimization'], 'description': 'Maximum displacement of an atom', 'dimensionality': 'scalar', 'type': 'float', 'units': 'Å'}, 'maximum displacement with H': {'calculation': ['minimization'], 'description': 'Maximum displacement of an atom, including H', 'dimensionality': 'scalar', 'type': 'float', 'units': 'Å'}, 'minimizer': {'calculation': ['minimization'], 'description': 'the minimizer used', 'dimensionality': 'scalar', 'type': 'string'}, 'model': {'description': 'The model used', 'dimensionality': 'scalar', 'type': 'string'}, 'natoms_npt': {'calculation': ['npt'], 'description': 'The number of atoms in the NPT step', 'dimensionality': 'scalar', 'type': 'integer', 'units': 's'}, 'natoms_nve': {'calculation': ['nve'], 'description': 'The number of atoms in the NVE step', 'dimensionality': 'scalar', 'type': 'integer', 'units': 's'}, 'natoms_nvt': {'calculation': ['nvt'], 'description': 'The number of atoms in the NVT step', 'dimensionality': 'scalar', 'type': 'integer', 'units': 's'}, 'np_npt': {'calculation': ['npt'], 'description': 'The number of processors for the NPT step', 'dimensionality': 'scalar', 'type': 'integer', 'units': 's'}, 'np_nve': {'calculation': ['nve'], 'description': 'The number of processors for the NVE step', 'dimensionality': 'scalar', 'type': 'integer', 'units': 's'}, 'np_nvt': {'calculation': ['nvt'], 'description': 'The number of processors for the NVT step', 'dimensionality': 'scalar', 'type': 'integer', 'units': 's'}, 'nsteps_npt': {'calculation': ['npt'], 'description': 'The number of steps in the NPT step', 'dimensionality': 'scalar', 'type': 'integer', 'units': 's'}, 'nsteps_nve': {'calculation': ['nve'], 'description': 'The number of steps in the NVE step', 'dimensionality': 'scalar', 'type': 'integer', 'units': 's'}, 'nsteps_nvt': {'calculation': ['nvt'], 'description': 'The number of steps in the NVT step', 'dimensionality': 'scalar', 'type': 'integer', 'units': 's'}, 'optimization is converged': {'calculation': ['minimization'], 'description': 'whether the geometry optimization converged', 'dimensionality': 'scalar', 'format': 's', 'type': 'boolean'}, 'rate per day': {'description': 'Simulation time per day', 'dimensionality': 'scalar', 'format': '.2f', 'type': 'float', 'units': 'ns/day'}, 'rate timesteps/s': {'description': 'Timesteps per second', 'dimensionality': 'scalar', 'format': '.2f', 'type': 'float', 'units': '1/s'}, 'stress': {'description': 'Stress Voigt vector', 'dimensionality': '[6]', 'property': 'stress#LAMMPS#{model}', 'type': 'float', 'units': 'atm'}, 'stress,inefficiency': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'statistical inefficiency of stress sampling', 'dimensionality': '[6]', 'property': 'stress, inefficiency#LAMMPS#{model}', 'type': 'float', 'units': ''}, 'stress,stderr': {'description': 'stderr of stress', 'dimensionality': '[6]', 'property': 'stress, stderr#LAMMPS#{model}', 'type': 'float', 'units': 'atm'}, 'stress,tau': {'calculation': ['nve', 'nvt', 'npt'], 'description': 'autocorrelation time of stress', 'dimensionality': '[6]', 'property': 'stress, tau#LAMMPS#{model}', 'type': 'float', 'units': 'fs'}, 't_lammps_wall': {'description': 'The wall clock time for LAMMPS', 'dimensionality': 'scalar', 'format': '.1f', 'type': 'float', 'units': 's'}, 't_npt': {'calculation': ['npt'], 'description': 'The time for the NPT step', 'dimensionality': 'scalar', 'type': 'float', 'units': 's'}, 't_nve': {'calculation': ['nve'], 'description': 'The time for the NVE step', 'dimensionality': 'scalar', 'type': 'float', 'units': 's'}, 't_nvt': {'calculation': ['nvt'], 'description': 'The time for the NVT step', 'dimensionality': 'scalar', 'type': 'float', 'units': 's'}}}#

Properties that LAMMPS produces, depending on the type of calculation.

lammps_step.minimization module#

Minimization step in LAMMPS

class lammps_step.minimization.Minimization(flowchart=None, title='Minimization', extension=None)[source]#

Bases: Energy

analyze(data={}, properties=None, table=None, output='')[source]#

Analyze the results of the simulation.

description_text(P=None)[source]#

Create the text description of what this step will do.

get_input(extras=None)[source]#

Get the input for a minimization in LAMMPS

get_pressure_text(_P)[source]#

Work out and return the pressure/stress part of the ‘fix npt’ or ‘fix berendsen’ or minimization in LAMMPS

static shear_allowed(P)[source]#

Whether the cell may shear: ‘allow shear’ applies only when optimizing the cell of a solid, so it is ignored otherwise, as the dialog hides it.

task = 'OPT'#

lammps_step.minimization_parameters module#

Control parameters for minimization

class lammps_step.minimization_parameters.MinimizationParameters(defaults={}, data=None)[source]#

Bases: EnergyParameters

The control parameters for minimization in LAMMPS

parameters = {'P': {'applies_when': {'optimize cell': 'yes'}, 'default': 1.0, 'default_units': 'atm', 'description': 'Pressure:', 'enumeration': (), 'format_string': '.2f', 'help_text': 'The applied pressure.', 'kind': 'float'}, 'Sxx': {'applies_when': {'use_stress': 'general stress'}, 'default': -1.0, 'default_units': 'atm', 'description': 'Sxx:', 'enumeration': ('fixed',), 'format_string': 's', 'help_text': 'The components of the stress tensor.', 'kind': 'float'}, 'Sxy': {'applies_when': {'allow shear': 'yes', 'use_stress': 'general stress'}, 'default': 'fixed', 'default_units': 'atm', 'description': 'Sxy:', 'enumeration': ('fixed',), 'format_string': 's', 'help_text': 'The components of the stress tensor.', 'kind': 'float'}, 'Sxz': {'applies_when': {'allow shear': 'yes', 'use_stress': 'general stress'}, 'default': 'fixed', 'default_units': 'atm', 'description': 'Sxz:', 'enumeration': ('fixed',), 'format_string': 's', 'help_text': 'The components of the stress tensor.', 'kind': 'float'}, 'Syy': {'applies_when': {'couple': ('x and z', 'y and z', 'none'), 'use_stress': 'general stress'}, 'default': -1.0, 'default_units': 'atm', 'description': 'Syy:', 'enumeration': ('fixed',), 'format_string': 's', 'help_text': 'The components of the stress tensor.', 'kind': 'float'}, 'Syz': {'applies_when': {'allow shear': 'yes', 'use_stress': 'general stress'}, 'default': 'fixed', 'default_units': 'atm', 'description': 'Syz:', 'enumeration': ('fixed',), 'format_string': 's', 'help_text': 'The components of the stress tensor.', 'kind': 'float'}, 'Szz': {'applies_when': {'couple': ('x and y', 'none'), 'use_stress': 'general stress'}, 'default': -1.0, 'default_units': 'atm', 'description': 'Szz:', 'enumeration': ('fixed',), 'format_string': 's', 'help_text': 'The components of the stress tensor.', 'kind': 'float'}, 'allow shear': {'applies_when': {'system type': 'solid'}, 'default': 'no', 'description': 'Allow the cell to shear', 'enumeration': ('no', 'yes'), 'format_string': 's', 'help_text': 'Whether the cell angles can change.', 'kind': 'boolean'}, 'convergence': {'default': 'normal', 'description': 'Convergence:', 'enumeration': ('crude', 'loose', 'normal', 'tight', 'custom'), 'format_string': 's', 'help_text': 'The convergence criterion for the minimization.', 'kind': 'string'}, 'couple': {'applies_when': {'system type': 'solid'}, 'default': 'x, y and z', 'description': 'Directions to couple:', 'enumeration': ('x, y and z', 'x and y', 'x and z', 'y and z', 'none'), 'format_string': 's', 'help_text': 'The stress in these directions will be averaged and the cell dilated in fixed proportions in these directions.', 'kind': 'enumeration'}, 'etol': {'applies_when': {'convergence': 'custom'}, 'default': 0.0, 'default_units': 'kcal/mol', 'description': 'Energy change:', 'format_string': '.2f', 'help_text': 'Converged when the change in energy is less than this.', 'kind': 'float'}, 'ftol': {'applies_when': {'convergence': 'custom'}, 'default': 0.1, 'default_units': 'kcal/mol/Å', 'description': 'Force convergence:', 'format_string': '.2f', 'help_text': 'Converged when the norm of the forces is less than this.', 'kind': 'float'}, 'minimizer': {'default': 'Conjugate Gradient', 'description': 'Minimizer:', 'enumeration': ('Conjugate Gradient', 'Steepest Descent', 'Hessian-Free truncated Newton', 'QuickMin', 'Fire'), 'format_string': '', 'help_text': 'Which minimizer to use', 'kind': 'string'}, 'nevaluations': {'default': '3*nSteps', 'description': 'Maximum evaluations:', 'format_string': '', 'help_text': 'The maximum number of energy evaluations.', 'kind': 'string'}, 'nreset': {'applies_when': {'optimize cell': 'yes'}, 'default': 'never', 'default_units': None, 'description': 'Frequency to reset reference cell:', 'enumeration': ('never',), 'format_string': 'd', 'help_text': 'How often, in number of steps, to reset the reference cell for the strain energy.', 'kind': 'integer'}, 'nsteps': {'default': '30*nAtoms', 'description': 'Maximum steps:', 'format_string': '', 'help_text': 'The maximum number of steps.', 'kind': 'string'}, 'optimize cell': {'default': 'yes', 'description': 'Optimize cell', 'enumeration': ('no', 'yes'), 'format_string': 's', 'help_text': 'Whether to optimize the unit cell.', 'kind': 'boolean'}, 'system type': {'applies_when': {'optimize cell': 'yes'}, 'default': 'fluid', 'description': 'Type of system:', 'enumeration': ('fluid', 'solid'), 'format_string': 's', 'help_text': 'Whether the system is a fluid, which flows under shear stress, or a solid, which can resist small shear stresses.', 'kind': 'string'}, 'timestep': {'applies_when': {'minimizer': ['Fire', 'QuickMin']}, 'default': '10', 'default_units': 'fs', 'description': 'Timestep:', 'enumeration': ('normal', 'accurate but slow', 'coarse but fast'), 'format_string': '.1f', 'help_text': 'The time step for the numerical integration in the dynamics. About 10x that used in MD works well.', 'kind': 'float'}, 'use_stress': {'applies_when': {'system type': 'solid'}, 'default': 'isotropic pressure', 'description': 'Apply', 'enumeration': ('isotropic pressure', 'general stress'), 'format_string': 's', 'help_text': 'Specify whether to apply (isotropic) pressure to the system or explicit stresses for each different direction.', 'kind': 'enumeration'}}#
pressure_keys = ('P',)#

The parameters for the (isotropic) pressure, which apply only when a pressure rather than a general stress is applied.

lammps_step.minimization_step module#

Main module.

class lammps_step.minimization_step.MinimizationStep(flowchart=None, gui=None)[source]#

Bases: object

create_node(flowchart=None, **kwargs)[source]#

Return the new node object

create_tk_node(canvas=None, **kwargs)[source]#

Return the graphical Tk node object

description()[source]#

Return a description of what this extension does

my_description = {'description': 'Minimization', 'group': 'Calculations', 'name': 'Minimization'}#

lammps_step.npt module#

NPT (canonical) dynamics in LAMMPS

class lammps_step.npt.NPT(flowchart=None, title='NPT dynamics', extension=None)[source]#

Bases: NVT

describe(indent='', json_dict=None)[source]#

Write out information about what this node will do If json_dict is passed in, add information to that dictionary so that it can be written out by the controller as appropriate.

description_text(P=None)[source]#

Create the text description of what this step will do. The dictionary of control values is passed in as P so that the code can test values, etc.

get_input(extras=None)[source]#

Get the input for an NPT dynamics run in LAMMPS

get_pressure_text(_P)[source]#

Work out and return the pressure/stress part of the ‘fix npt’ or ‘fix berendsen’ in LAMMPS

methods = {'Berendsen': {'documentation': 'https://lammps.sandia.gov/doc/fix_press_berendsen.html', 'references': ['Berendsen']}, 'Nose-Hoover': {'documentation': 'https://lammps.sandia.gov/doc/fix_nh.html#fix-npt-command', 'references': ['Shinoda', 'Tuckerman']}}#
static nose_hoover_barostat_options(P)[source]#

The ‘mtk’ and ‘nreset’ keywords of fix npt for the Nose-Hoover barostat.

static shear_allowed(P)[source]#

Whether the cell may shear: ‘allow shear’ applies only to a solid with the Nose-Hoover barostat (press/berendsen cannot control a triclinic cell), so it is ignored otherwise, as the dialog hides it.

lammps_step.npt_parameters module#

Control parameters for NPT (canonical) dynamics

class lammps_step.npt_parameters.NPT_Parameters(defaults={}, data=None)[source]#

Bases: NVT_Parameters

The control parameters for NPT dynamics in LAMMPS

parameters = {'Panneal': {'default': 'no', 'description': 'Change pressure with time', 'enumeration': ('no', 'yes'), 'format_string': 's', 'help_text': 'Change the pressure linearly with time during the run, i.e. anneal the system.', 'kind': 'boolean'}, 'Pdamp': {'default': 1000.0, 'default_units': 'fs', 'description': 'Damping time:', 'format_string': '.1f', 'help_text': 'The damping time constant for the barostat. Typically a value around 1000 timesteps works well.', 'kind': 'float'}, 'Pfinal': {'applies_when': {'Panneal': 'yes'}, 'default': 1.0, 'default_units': 'atm', 'description': 'Final pressure:', 'enumeration': (), 'format_string': '.2f', 'help_text': 'The final pressure.', 'kind': 'float'}, 'Pinitial': {'default': 1.0, 'default_units': 'atm', 'description': 'Initial pressure:', 'enumeration': (), 'format_string': '.2f', 'help_text': 'The initial pressure.', 'kind': 'float'}, 'Sxx damp': {'applies_when': {'use_stress': 'general stress'}, 'default': 1000.0, 'default_units': 'fs', 'description': 'Sxx damping time:', 'format_string': '.1f', 'help_text': 'The damping time constant for the barostat. Typically a value around 1000 timesteps works well.', 'kind': 'float'}, 'Sxx,final': {'applies_when': {'Panneal': 'yes', 'use_stress': 'general stress'}, 'default': -1.0, 'default_units': 'atm', 'description': 'Sxx final:', 'enumeration': ('fixed',), 'format_string': '.2f', 'help_text': 'The final components of the stress tensor.', 'kind': 'float'}, 'Sxx,initial': {'applies_when': {'use_stress': 'general stress'}, 'default': -1.0, 'default_units': 'atm', 'description': 'Sxx initial:', 'enumeration': ('fixed',), 'format_string': '.2f', 'help_text': 'The initial components of the stress tensor.', 'kind': 'float'}, 'Sxy damp': {'applies_when': {'allow shear': 'yes', 'use_stress': 'general stress'}, 'default': 1000.0, 'default_units': 'fs', 'description': 'Sxy damping time:', 'format_string': '.1f', 'help_text': 'The damping time constant for the barostat. Typically a value around 1000 timesteps works well.', 'kind': 'float'}, 'Sxy,final': {'applies_when': {'Panneal': 'yes', 'allow shear': 'yes', 'use_stress': 'general stress'}, 'default': 0.0, 'default_units': 'atm', 'description': 'Sxy final:', 'enumeration': ('fixed',), 'format_string': '.2f', 'help_text': 'The final components of the stress tensor.', 'kind': 'float'}, 'Sxy,initial': {'applies_when': {'allow shear': 'yes', 'use_stress': 'general stress'}, 'default': 0.0, 'default_units': 'atm', 'description': 'Sxy initial:', 'enumeration': ('fixed',), 'format_string': '.2f', 'help_text': 'The initial components of the stress tensor.', 'kind': 'float'}, 'Sxz damp': {'applies_when': {'allow shear': 'yes', 'use_stress': 'general stress'}, 'default': 1000.0, 'default_units': 'fs', 'description': 'Sxz damping time:', 'format_string': '.1f', 'help_text': 'The damping time constant for the barostat. Typically a value around 1000 timesteps works well.', 'kind': 'float'}, 'Sxz,final': {'applies_when': {'Panneal': 'yes', 'allow shear': 'yes', 'use_stress': 'general stress'}, 'default': 0.0, 'default_units': 'atm', 'description': 'Sxz final:', 'enumeration': ('fixed',), 'format_string': '.2f', 'help_text': 'The final components of the stress tensor.', 'kind': 'float'}, 'Sxz,initial': {'applies_when': {'allow shear': 'yes', 'use_stress': 'general stress'}, 'default': 0.0, 'default_units': 'atm', 'description': 'Sxz initial:', 'enumeration': ('fixed',), 'format_string': '.2f', 'help_text': 'The initial components of the stress tensor.', 'kind': 'float'}, 'Syy damp': {'applies_when': {'couple': ('x and z', 'y and z', 'none'), 'use_stress': 'general stress'}, 'default': 1000.0, 'default_units': 'fs', 'description': 'Syy damping time:', 'format_string': '.1f', 'help_text': 'The damping time constant for the barostat. Typically a value around 1000 timesteps works well.', 'kind': 'float'}, 'Syy,final': {'applies_when': {'Panneal': 'yes', 'couple': ('x and z', 'y and z', 'none'), 'use_stress': 'general stress'}, 'default': -1.0, 'default_units': 'atm', 'description': 'Syy final:', 'enumeration': ('fixed',), 'format_string': '.2f', 'help_text': 'The final components of the stress tensor.', 'kind': 'float'}, 'Syy,initial': {'applies_when': {'couple': ('x and z', 'y and z', 'none'), 'use_stress': 'general stress'}, 'default': -1.0, 'default_units': 'atm', 'description': 'Syy initial:', 'enumeration': ('fixed',), 'format_string': '.2f', 'help_text': 'The initial components of the stress tensor.', 'kind': 'float'}, 'Syz damp': {'applies_when': {'allow shear': 'yes', 'use_stress': 'general stress'}, 'default': 1000.0, 'default_units': 'fs', 'description': 'Syz damping time:', 'format_string': '.1f', 'help_text': 'The damping time constant for the barostat. Typically a value around 1000 timesteps works well.', 'kind': 'float'}, 'Syz,final': {'applies_when': {'Panneal': 'yes', 'allow shear': 'yes', 'use_stress': 'general stress'}, 'default': 0.0, 'default_units': 'atm', 'description': 'Syz final:', 'enumeration': ('fixed',), 'format_string': '.2f', 'help_text': 'The final components of the stress tensor.', 'kind': 'float'}, 'Syz,initial': {'applies_when': {'allow shear': 'yes', 'use_stress': 'general stress'}, 'default': 0.0, 'default_units': 'atm', 'description': 'Syz initial:', 'enumeration': ('fixed',), 'format_string': '.2f', 'help_text': 'The initial components of the stress tensor.', 'kind': 'float'}, 'Szz damp': {'applies_when': {'couple': ('x and y', 'none'), 'use_stress': 'general stress'}, 'default': 1000.0, 'default_units': 'fs', 'description': 'Szz damping time:', 'format_string': '.1f', 'help_text': 'The damping time constant for the barostat. Typically a value around 1000 timesteps works well.', 'kind': 'float'}, 'Szz,final': {'applies_when': {'Panneal': 'yes', 'couple': ('x and y', 'none'), 'use_stress': 'general stress'}, 'default': -1.0, 'default_units': 'atm', 'description': 'Szz final:', 'enumeration': ('fixed',), 'format_string': '.2f', 'help_text': 'The final components of the stress tensor.', 'kind': 'float'}, 'Szz,initial': {'applies_when': {'couple': ('x and y', 'none'), 'use_stress': 'general stress'}, 'default': -1.0, 'default_units': 'atm', 'description': 'Szz initial:', 'enumeration': ('fixed',), 'format_string': '.2f', 'help_text': 'The initial components of the stress tensor.', 'kind': 'float'}, 'allow shear': {'applies_when': {'barostat': 'Nose-Hoover', 'system type': 'solid'}, 'default': 'no', 'description': 'Allow the cell to shear', 'enumeration': ('no', 'yes'), 'format_string': 's', 'help_text': 'Whether the cell angles can change. Only the Nose-Hoover barostat can change them.', 'kind': 'boolean'}, 'barostat': {'default': 'Nose-Hoover', 'description': 'Barostat:', 'enumeration': ('Nose-Hoover', 'Berendsen'), 'format_string': 's', 'help_text': 'The barostat used to control the pressure', 'kind': 'string'}, 'couple': {'applies_when': {'system type': 'solid'}, 'default': 'x, y and z', 'description': 'Directions to couple:', 'enumeration': ('x, y and z', 'x and y', 'x and z', 'y and z', 'none'), 'format_string': 's', 'help_text': 'The stress in these directions will be averaged and the cell dilated in fixed proportions in these directions.', 'kind': 'enumeration'}, 'modulus': {'applies_when': {'barostat': {'not': 'Nose-Hoover'}}, 'default': 50.0, 'default_units': 'GPa', 'description': 'Bulk modulus:', 'enumeration': (), 'format_string': '.2f', 'help_text': 'The bulk modulus. For liquids a typical modulus ranges from a fraction of a GPa to a few GPa. For crystalline solids, 25-500 GPa is a reasonable range.', 'kind': 'float'}, 'mtk': {'applies_when': {'barostat': 'Nose-Hoover'}, 'default': 'yes', 'description': 'Use corrected Hoover barostat', 'enumeration': ('no', 'yes'), 'format_string': 's', 'help_text': 'Include the correction terms due to Martyna, Tuckerman, and Klein in the equations of motion. If not, the original Hoover barostat is used, whose volume probability distribution function differs from the true NPT and NPH ensembles by a factor of 1/V. By default the correct equations are used, but in many cases the difference is negligible.', 'kind': 'boolean'}, 'nreset': {'applies_when': {'barostat': 'Nose-Hoover'}, 'default': 'never', 'default_units': None, 'description': 'Frequency to reset reference cell:', 'enumeration': ('never',), 'format_string': 'd', 'help_text': 'How often, in number of steps, to reset the reference cell for the strain energy.', 'kind': 'integer'}, 'system type': {'default': 'fluid', 'description': 'Type of system:', 'enumeration': ('fluid', 'solid'), 'format_string': 's', 'help_text': 'Whether the system is a fluid, which flows under shear stress, or a solid, which can resist small shear stresses.', 'kind': 'string'}, 'use_stress': {'applies_when': {'system type': 'solid'}, 'default': 'isotropic pressure', 'description': 'Apply', 'enumeration': ('isotropic pressure', 'general stress'), 'format_string': 's', 'help_text': 'Specify whether to apply (isotropic) pressure to the system or explicit stresses for each different direction.', 'kind': 'enumeration'}}#
pressure_keys = ('Pinitial', 'Pfinal', 'Pdamp')#

The parameters for the (isotropic) pressure, which apply only when a pressure rather than a general stress is applied.

lammps_step.npt_step module#

Main module.

class lammps_step.npt_step.NPTStep(flowchart=None, gui=None)[source]#

Bases: object

create_node(flowchart=None, **kwargs)[source]#

Return the new node object

create_tk_node(canvas=None, **kwargs)[source]#

Return the graphical Tk node object

description()[source]#

Return a description of what this extension does

my_description = {'description': 'NPT (isothermal–isobaric) dynamics', 'group': 'Calculations', 'name': 'NPT dynamics'}#

lammps_step.nve module#

NVE (microcanonical) dynamics in LAMMPS

class lammps_step.nve.NVE(flowchart=None, title='NVE dynamics', extension=None, logger=<Logger lammps_step.nve (WARNING)>)[source]#

Bases: Energy

analyze(data={}, properties=None, table=None, output='')[source]#

Analyze the results of the simulation.

description_text(P=None)[source]#

Return a short description of this step.

Return a nicely formatted string describing what this step will do.

Keyword Arguments:

P – a dictionary of parameter values, which may be variables or final values. If None, then the parameters values will be used as is.

get_input(extras=None)[source]#

Get the input for an NVE dynamics run in LAMMPS

heat_flux_cleanup(P, ff_form=None)[source]#

The lines removing what heat_flux_input() defined.

heat_flux_input(P, ff_form=None)[source]#

The computes and variables giving the heat flux, in W/m^2, as the variables Jx, Jy and Jz.

The flux is J = sum_i e_i v_i - sum_i S_i.v_i over the atoms, with e_i the per-atom energy and S_i the per-atom stress. The bonded terms and the constraint forces (SHAKE) need the centroid form of the stress, which compute centroid/stress/atom gives (Surblys et al., J. Appl. Phys. 2021); it does not handle kspace, so the pair and kspace terms are a second compute, and since both computes include the convective term sum_i e_i v_i, one copy is removed. Class2 forcefields, or “use centroid stress” off, use the ordinary per-atom stress of all the terms.

Parameters:
  • P (dict) – The step’s parameter values (“use centroid stress”).

  • ff_form (str, optional) – The form of the forcefield. Default: the forcefield’s.

Returns:

The LAMMPS input, to be undone by heat_flux_cleanup().

Return type:

str

md_provides()[source]#

What this run will write to md.h5md, from its parameters.

Return type:

seamm_md_analysis.Provides

request_sampling(need)[source]#

Turn on the sampling an analysis needs, if possible.

Parameters:

need (seamm_md_analysis.Need)

Returns:

A description of the change, or None if it could not be made.

Return type:

str or None

task = 'MD'#
timestep(value)[source]#

Get the timestep in the correct units.

This handles the ‘normal’, ‘accurate’ and ‘coarse’ values, which depend on the mass in an empirical fashion.

Parameters:

value (str or Pint quantity) – The desired timestep, which may be a Pint quantity with units or one of ‘notmal’, ‘accurate but slow’, or ‘coarse but fast’

Returns:

timestep – The magnitude of the time step in the appropriate LAMMPS units

Return type:

float

trajectory_input(P, timestep, nsteps, ncomputes, ndumps, nfixes)[source]#

Create the part of the input handling the trajectories.

Parameters:
  • P (dict) – The dictionary of options

  • timestep (int) – The timestep in LAMMPS units

  • nsteps (int) – Total number of steps in the run

  • ncomputes (int) – The counter for the computes

  • ndumps (int) – The counter for the dumps

  • nfixes (int) – The counter for the fixes

Returns:

  • [str] – The input lines as array

  • int – The counter for the computes

  • int – The counter for the dumps

  • int – The counter for the fixes

lammps_step.nve_parameters module#

Control parameters for NVE (microcanonical) dynamics

class lammps_step.nve_parameters.NVE_Parameters(defaults={}, data=None)[source]#

Bases: EnergyParameters

The control parameters for NVE dynamics in LAMMPS

not_implemented = ('run_control', 'maximum_time', 'control_properties')#

Parameters that are defined but not yet implemented, so never apply.

parameters = {'constrain X-H bonds': {'default': 'no', 'default_units': None, 'description': 'Constrain (shake) X-H bonds:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to fix the length of X-H bonds using SHAKE/RATTLE', 'kind': 'boolean'}, 'control_properties': {'applies_when': {'run_control': 'Until properties converge to the requested accuracy.'}, 'default': {}, 'default_units': None, 'description': 'Convergence properties', 'enumeration': (), 'format_string': '', 'help_text': 'The properties to converge when controlling the run automatically.', 'kind': 'special', 'widget': 'seamm_widgets.PropertyTable'}, 'maximum_time': {'applies_when': {'run_control': 'Until properties converge to the requested accuracy.'}, 'default': 1.0, 'default_units': 'ns', 'description': 'Maximum simulation time:', 'format_string': '.1f', 'help_text': 'The maximum time to simulate when converging properties.', 'kind': 'float'}, 'run_control': {'default': 'For a fixed length of simulated time.', 'default_units': None, 'description': 'How long to run? ', 'enumeration': ('Until properties converge to the requested accuracy.', 'For a fixed length of simulated time.'), 'format_string': '', 'help_text': 'How to determine when to stop the simulation. You can give a fixed length of simulation time, e.g. 15 ps, or you can ask to run long enough to determine one or more properties to a given accuracy.', 'kind': 'enumeration'}, 'sampling': {'default': '50', 'default_units': 'fs', 'description': 'Sampling frequency:', 'enumeration': ('none',), 'format_string': '.1f', 'help_text': 'How often to sample the energy, temperature, etc. during the dynamics run. This controls writing to the trajectory files. Faster gives more fidelity to a point, but increases the file size and slows the calculation down.\nYou can ask for no sampling, give a specific interval, or allow the system the choose for you.', 'kind': 'float'}, 'time': {'default': 100.0, 'default_units': 'ps', 'description': 'Simulation time:', 'format_string': '.1f', 'help_text': 'The time to simulate in the dynamics run.', 'kind': 'float'}, 'timestep': {'default': 'normal', 'default_units': 'fs', 'description': 'Timestep:', 'enumeration': ('normal', 'accurate but slow', 'coarse but fast'), 'format_string': '.1f', 'help_text': 'The time step for the numerical integration in the dynamics. 1 fs is safe for most systems, except perhaps at high temperatures. For systems without hydrogen, helium, lithium or other light elements, 2-4 fs steps are reasonable. The timestep needs to be less than 1/10 the highest frequency. 10^14 Hz is a period of 10 fs, and corresponds to a frequency of 3,300 wavenumbers or a wavelength of 3 micrometers.\nYou can enter a value or use the choices, which pick a reasonable timestep based on the calculation.', 'kind': 'float'}}#
renamed = {'shear stress': 'pressure tensor', 'shear stress number of samples': 'pressure tensor number of samples', 'shear stress rate': 'pressure tensor rate'}#

new}. The shear stress (three components) became the full pressure tensor.

Type:

Parameters renamed since older flowcharts were written

Type:

{old

trajectories = {'atomic positions': {'default': 'never', 'description': 'Sample the atom positions:', 'enumeration': ('never', 'by number of samples', 'by time interval'), 'format_string': '', 'help_text': 'How to sample the positions of the atoms, which can be used for diffusion calculations.', 'kind': 'string'}, 'atomic positions number of samples': {'applies_when': {'atomic positions': 'by number of samples'}, 'default': 1000, 'description': 'Number of samples:', 'enumeration': (), 'format_string': '', 'help_text': 'How many samples of the positions of the atoms to collect', 'kind': 'integer'}, 'atomic positions rate': {'applies_when': {'atomic positions': 'by time interval'}, 'default': 100, 'default_units': 'fs', 'description': 'Time interval:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'How often to sample the positions of the atoms', 'kind': 'float'}, 'atomic velocities': {'default': 'never', 'description': 'Sample the atom velocities:', 'enumeration': ('never', 'by number of samples', 'by time interval'), 'format_string': '', 'help_text': 'How to sample the velocities of the atoms, which can be used for diffusion calculations.', 'kind': 'string'}, 'atomic velocities number of samples': {'applies_when': {'atomic velocities': 'by number of samples'}, 'default': 1000, 'description': 'Number of samples:', 'enumeration': (), 'format_string': '', 'help_text': 'How many samples of the velocities of the atoms to collect', 'kind': 'integer'}, 'atomic velocities rate': {'applies_when': {'atomic velocities': 'by time interval'}, 'default': 100, 'default_units': 'fs', 'description': 'Time interval:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'How often to sample the velocities of the atoms', 'kind': 'float'}, 'com positions': {'default': 'never', 'description': "Sample the positions of the molecules' COM:", 'enumeration': ('never', 'by number of samples', 'by time interval'), 'format_string': '', 'help_text': "How to sample the positions of the molecules' COM, which can be used for diffusion calculations.", 'kind': 'string'}, 'com positions number of samples': {'applies_when': {'com positions': 'by number of samples'}, 'default': 1000, 'description': 'Number of samples:', 'enumeration': (), 'format_string': '', 'help_text': 'How many samples of the positions of the centers of mass of the molecules to collect', 'kind': 'integer'}, 'com positions rate': {'applies_when': {'com positions': 'by time interval'}, 'default': 100, 'default_units': 'fs', 'description': 'Time interval:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'How often to sample the positions of the centers of mass of the molecules', 'kind': 'float'}, 'com velocities': {'default': 'never', 'description': "Sample the velocities of the molecules' COM:", 'enumeration': ('never', 'by number of samples', 'by time interval'), 'format_string': '', 'help_text': "How to sample the velocities of the molecules' COM, which can be used for diffusion calculations.", 'kind': 'string'}, 'com velocities number of samples': {'applies_when': {'com velocities': 'by number of samples'}, 'default': 1000, 'description': 'Number of samples:', 'enumeration': (), 'format_string': '', 'help_text': 'How many samples of the velocities of the centers of mass of the molecules to collect', 'kind': 'integer'}, 'com velocities rate': {'applies_when': {'com velocities': 'by time interval'}, 'default': 100, 'default_units': 'fs', 'description': 'Time interval:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'How often to sample the velocities of the centers of mass of the molecules', 'kind': 'float'}, 'heat flux': {'default': 'never', 'description': 'Sample the heat flux:', 'enumeration': ('never', 'by number of samples', 'by time interval'), 'format_string': '', 'help_text': 'How to sample the heat flux, usually used for thermal conductivity calculations. However, it is recommended to use the heat-flux step instead of using this.', 'kind': 'string'}, 'heat flux number of samples': {'applies_when': {'heat flux': 'by number of samples'}, 'default': 1000, 'description': 'Number of samples:', 'enumeration': (), 'format_string': '', 'help_text': 'How many samples of the heat flux to collect', 'kind': 'integer'}, 'heat flux rate': {'applies_when': {'heat flux': 'by time interval'}, 'default': 100, 'default_units': 'fs', 'description': 'Time interval:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'How often to sample the heat flux', 'kind': 'float'}, 'make current': {'applies_when': {'trajectory save': 'yes'}, 'default': 'no', 'description': 'Make it the current system:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to make the system the current system.', 'kind': 'boolean'}, 'pressure tensor': {'default': 'never', 'description': 'Sample the pressure tensor:', 'enumeration': ('never', 'by number of samples', 'by time interval'), 'format_string': '', 'help_text': 'How to sample the full pressure tensor, usually for the viscosity. Periodic systems only.', 'kind': 'string'}, 'pressure tensor number of samples': {'applies_when': {'pressure tensor': 'by number of samples'}, 'default': 1000, 'description': 'Number of samples:', 'enumeration': (), 'format_string': '', 'help_text': 'How many samples of the pressure tensor to collect', 'kind': 'integer'}, 'pressure tensor rate': {'applies_when': {'pressure tensor': 'by time interval'}, 'default': 100, 'default_units': 'fs', 'description': 'Time interval:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'How often to sample the pressure tensor', 'kind': 'float'}, 'trajectory': {'default': 'never', 'description': 'Sample the trajectory:', 'enumeration': ('never', 'by number of samples', 'by time interval'), 'format_string': '', 'help_text': 'How to sample the trajectory.', 'kind': 'string'}, 'trajectory export': {'applies_when': {'trajectory': {'not': 'never'}}, 'default': 'no', 'description': 'Export the trajectory:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to export the trajectory in other formats.', 'kind': 'boolean'}, 'trajectory extxyz': {'applies_when': {'trajectory export': 'yes'}, 'default': 'no', 'description': 'ASE extxyz:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Write the trajectory in the ASE extended xyz format', 'kind': 'string'}, 'trajectory extxyz append': {'applies_when': {'trajectory export': 'yes'}, 'default': 'no', 'description': 'Append:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Append to the extended xyz file', 'kind': 'string'}, 'trajectory extxyz filename': {'applies_when': {'trajectory export': 'yes'}, 'default': 'trajectory.extxyz.gz', 'description': 'Filename:', 'enumeration': (), 'format_string': '', 'help_text': 'File for the extended xyz trajectory', 'kind': 'string'}, 'trajectory extxyz skip frames': {'applies_when': {'trajectory export': 'yes'}, 'default': '0', 'description': 'Skip first n frames:', 'enumeration': (), 'format_string': '', 'help_text': 'The number of frames to ignore', 'kind': 'integer'}, 'trajectory forces': {'applies_when': {'trajectory': {'not': 'never'}}, 'default': 'no', 'default_units': None, 'description': 'Include forces:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to include the forces in the trajectory', 'kind': 'boolean'}, 'trajectory number of samples': {'applies_when': {'trajectory': 'by number of samples'}, 'default': 1000, 'description': 'Number of samples:', 'enumeration': (), 'format_string': '', 'help_text': 'How many samples of the trajectory to collect', 'kind': 'integer'}, 'trajectory rate': {'applies_when': {'trajectory': 'by time interval'}, 'default': 100, 'default_units': 'fs', 'description': 'Time interval:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'How often to sample the trajectory', 'kind': 'float'}, 'trajectory save': {'applies_when': {'trajectory': {'not': 'never'}}, 'default': 'no', 'description': 'Save the trajectory in a system:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to save the trajectory to a system.', 'kind': 'boolean'}, 'trajectory system name': {'applies_when': {'trajectory save': 'yes'}, 'default': 'trajectory', 'description': 'System name:', 'enumeration': ('current',), 'format_string': '', 'help_text': 'The name of the system for the trajectory', 'kind': 'string'}, 'trajectory velocities': {'applies_when': {'trajectory': {'not': 'never'}}, 'default': 'no', 'default_units': None, 'description': 'Include velocities:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to include the velocities in the trajectory', 'kind': 'boolean'}, 'use centroid stress': {'applies_when': {'heat flux': {'not': 'never'}}, 'default': 'yes', 'default_units': None, 'description': 'Use centroid/stress/atom:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to use centroid/stress/atom', 'kind': 'boolean'}}#

lammps_step.nve_step module#

Main module.

class lammps_step.nve_step.NVEStep(flowchart=None, gui=None)[source]#

Bases: object

create_node(flowchart=None, **kwargs)[source]#

Return the new node object

create_tk_node(canvas=None, **kwargs)[source]#

Return the graphical Tk node object

description()[source]#

Return a description of what this extension does

my_description = {'description': 'NVE (microcanonical) dynamics', 'group': 'Calculations', 'name': 'NVE dynamics'}#

lammps_step.nvt module#

NVT (canonical) dynamics in LAMMPS

class lammps_step.nvt.NVT(flowchart=None, title='NVT dynamics', extension=None, logger=<Logger lammps_step.nvt (WARNING)>)[source]#

Bases: NVE

describe(indent='', json_dict=None)[source]#

Write out information about what this node will do If json_dict is passed in, add information to that dictionary so that it can be written out by the controller as appropriate.

description_text(P=None)[source]#

Return a short description of this step.

Return a nicely formatted string describing what this step will do.

Keyword Arguments:

P – a dictionary of parameter values, which may be variables or final values. If None, then the parameters values will be used as is.

get_input(extras=None)[source]#

Get the input for an NVT dynamics run in LAMMPS

lammps_step.nvt_parameters module#

Control parameters for NVT (canonical) dynamics

class lammps_step.nvt_parameters.NVT_Parameters(defaults={}, data=None)[source]#

Bases: NVE_Parameters

The control parameters for NVT dynamics in LAMMPS

parameters = {'T0': {'default': 298.15, 'default_units': 'K', 'description': 'Temperature:', 'format_string': '.2f', 'help_text': 'The temperature, or initial temperature for simulated annealing.', 'kind': 'float'}, 'T1': {'default': 298.15, 'default_units': 'K', 'description': 'Final temperature:', 'format_string': '.2f', 'help_text': 'The final temperature for simulated annealing.', 'kind': 'float'}, 'Tchain': {'applies_when': {'thermostat': 'Nose-Hoover'}, 'default': 3, 'default_units': None, 'description': 'Thermostat chain:', 'format_string': 'd', 'help_text': 'The number of thermostats in the chain.', 'kind': 'integer'}, 'Tdamp': {'applies_when': {'thermostat': {'not': 'velocity rescaling'}}, 'default': 100.0, 'default_units': 'fs', 'description': 'Damping time:', 'format_string': '.1f', 'help_text': 'The damping time constant for thermostat', 'kind': 'float'}, 'Tloop': {'applies_when': {'thermostat': 'Nose-Hoover'}, 'default': 1, 'default_units': None, 'description': 'Thermostat iterations:', 'format_string': 'd', 'help_text': 'The number of sub-iterations for the thermostat.', 'kind': 'integer'}, 'drag': {'applies_when': {'thermostat': 'Nose-Hoover'}, 'default': 0.0, 'default_units': None, 'description': 'Drag:', 'format_string': '.1f', 'help_text': 'The amount of drag to apply on the thermostat and barostat if the pressure is controlled. Typically a value of 0.2 - 2.0 is appropriate.', 'kind': 'float'}, 'fraction': {'applies_when': {'thermostat': 'velocity rescaling'}, 'default': 1.0, 'default_units': None, 'description': 'Fraction to scale:', 'format_string': '.1f', 'help_text': 'The fraction of the temperature difference to correct by scaling the velocities.', 'kind': 'float'}, 'frequency': {'applies_when': {'thermostat': 'velocity rescaling'}, 'default': 100.0, 'default_units': 'fs', 'description': 'Rescaling frequency:', 'format_string': '.1f', 'help_text': 'The frequency (in time units) for the thermostat to operate.', 'kind': 'float'}, 'seed': {'applies_when': {'thermostat': ('canonical sampling, velocity rescaling (csvr)', 'canonical sampling, langevin dynamics (csld)', 'Langevin')}, 'default': 'random', 'default_units': None, 'description': 'Random seed:', 'enumeration': ('random',), 'format_string': '', 'help_text': "The seed for the random number generator.'random' means to generate a random integer as the seed.", 'kind': 'integer'}, 'thermostat': {'default': 'Nose-Hoover', 'description': 'Thermostat:', 'enumeration': ('Nose-Hoover', 'Berendsen', 'canonical sampling, velocity rescaling (csvr)', 'canonical sampling, langevin dynamics (csld)', 'velocity rescaling', 'Langevin'), 'format_string': 's', 'help_text': 'The thermostat used to control the temperature.', 'kind': 'string'}, 'window': {'applies_when': {'thermostat': 'velocity rescaling'}, 'default': 20.0, 'default_units': 'K', 'description': 'Temperature window:', 'format_string': '.1f', 'help_text': 'The temperature window to use when rescaling.When the instantaneous temperature is outside the temperature window, the velocities will be rescaled.', 'kind': 'float'}}#

lammps_step.nvt_step module#

Main module.

class lammps_step.nvt_step.NVTStep(flowchart=None, gui=None)[source]#

Bases: object

create_node(flowchart=None, **kwargs)[source]#

Return the new node object

create_tk_node(canvas=None, **kwargs)[source]#

Return the graphical Tk node object

description()[source]#

Return a description of what this extension does

my_description = {'description': 'NVT (canonical) dynamics', 'group': 'Calculations', 'name': 'NVT dynamics'}#

lammps_step.tk_custom module#

The graphical part of a LAMMPS Custom step

class lammps_step.tk_custom.TkCustom(tk_flowchart=None, node=None, canvas=None, x=None, y=None, w=200, h=50)[source]#

Bases: TkNode

create_dialog()[source]#

Create the dialog!

handle_dialog(result)[source]#

Do the right thing when the dialog is closed.

right_click(event)[source]#

Probably need to add our dialog…

lammps_step.tk_energy module#

The graphical part of a LAMMPS Energy step

class lammps_step.tk_energy.TkEnergy(tk_flowchart=None, node=None, canvas=None, x=None, y=None, w=200, h=50, my_logger=<Logger lammps_step.tk_energy (WARNING)>)[source]#

Bases: TkNode

create_dialog(title='Edit LAMMPS Energy Step')[source]#

Create the dialog!

right_click(event)[source]#

Probably need to add our dialog…

lammps_step.tk_energy.stress_headers(keys, couple)[source]#

The column labels for the stress components that apply.

Parameters:
  • keys ([str]) – The stress components shown, as their parameters’ names, e.g. ‘Sxx,initial’.

  • couple (str) – The directions that are coupled, e.g. ‘x and y’.

Returns:

The keys of the column labels, e.g. ‘XX+YY’.

Return type:

[str]

lammps_step.tk_energy.widget_values(tk_node)[source]#

A dialog’s current values, {name: value}, for the parameters’ rules.

Parameters:

tk_node (seamm.TkNode) – The graphical node with the dialog.

Returns:

{str – The values of the parameters that have widgets, without units.

Return type:

any}

lammps_step.tk_heat_flux module#

The graphical part of a Heat Flux step

class lammps_step.tk_heat_flux.TkHeatFlux(tk_flowchart=None, node=None, canvas=None, x=None, y=None, w=200, h=50)[source]#

Bases: TkNVE

The graphical part of a Heat Flux step in a flowchart.

tk_flowchart#

The flowchart that we belong to.

Type:

TkFlowchart = None

node#

The corresponding node of the non-graphical flowchart

Type:

Node = None

canvas#

The Tk Canvas to draw on

Type:

tkCanvas = None

dialog#

The Pmw dialog object

Type:

Dialog

x#

The x-coordinate of the center of the picture of the node

Type:

int = None

y#

The y-coordinate of the center of the picture of the node

Type:

int = None

w#

The width in pixels of the picture of the node

Type:

int = 200

h#

The height in pixels of the picture of the node

Type:

int = 50

self[widget]#

A dictionary of tk widgets built using the information contained in Heat Flux_parameters.py

Type:

dict

See also

HeatFlux, TkHeatFlux, HeatFluxParameters

create_dialog()[source]#

Create the dialog. A set of widgets will be chosen by default based on what is specified in the Heat Flux_parameters module.

Parameters:

None

Return type:

None

reset_dialog(widget=None)[source]#

Layout the widgets in the dialog.

The widgets are chosen by default from the information in Heat Flux_parameter.

This function simply lays them out row by row with aligned labels. You may wish a more complicated layout that is controlled by values of some of the control parameters. If so, edit or override this method

Parameters:

widget (Tk Widget = None)

Return type:

None

right_click(event)[source]#

Handles the right click event on the node.

Parameters:

event (Tk Event)

Return type:

None

See also

TkHeatFlux.edit

trajectory_skip = ('heat flux', 'heat flux number of samples', 'heat flux rate')#

lammps_step.tk_initialization module#

The graphical part of a LAMMPS Initialization step

class lammps_step.tk_initialization.TkInitialization(tk_flowchart=None, node=None, canvas=None, x=None, y=None, w=200, h=50, my_logger=<Logger lammps_step.tk_initialization (WARNING)>)[source]#

Bases: TkNode

create_dialog()[source]#

Create the dialog!

general_cb(event=None)[source]#

Grid the widgets into the dialog, depending on the current values of key variables. This provides a dyamic presentation to the user.

Which controls are shown comes from the parameters’ rules (lammps_step.InitializationParameters), which the flowchart builder uses too.

kspace_method_cb(event=None)[source]#

Grid the widgets into the dialog, depending on the current values of key variables. This provides a dyamic presentation to the user.

reset_dialog(widget=None)[source]#

Lay out both parts of the dialog for the current values.

right_click(event)[source]#

Probably need to add our dialog…

lammps_step.tk_lammps module#

The graphical part of a LAMMPS step

class lammps_step.tk_lammps.TkLAMMPS(tk_flowchart=None, node=None, namespace='org.molssi.seamm.lammps.tk', canvas=None, x=None, y=None, w=200, h=50)[source]#

Bases: TkNode

The node_class is the class of the ‘real’ node that this class is the Tk graphics partner for

create_dialog()[source]#

Create the dialog!

from_flowchart(tk_flowchart=None, flowchart=None)[source]#

Recreate the graphics from the non-graphical flowchart. Only used in nodes that contain flowchart

node_class#

alias of LAMMPS

right_click(event)[source]#

Probably need to add our dialog…

update_flowchart(tk_flowchart=None, flowchart=None)[source]#

Update the nongraphical flowchart. Only used in nodes that contain flowcharts

lammps_step.tk_minimization module#

The graphical part of a LAMMPS minimization step

class lammps_step.tk_minimization.TkMinimization(tk_flowchart=None, node=None, canvas=None, x=None, y=None, w=200, h=50)[source]#

Bases: TkEnergy

create_dialog()[source]#

Create the dialog!

pressure_frame_keys = ('system type', 'P', 'allow shear', 'use_stress', 'couple')#
reset_dialog(widget=None)[source]#

Layout the widgets as needed for the current state.

Which controls are shown comes from the parameters’ rules (lammps_step.MinimizationParameters), which the flowchart builder uses too.

reset_optimization(widget=None)[source]#
reset_pressure_frame(widget=None)[source]#

Layout the widgets for the pressure/stress control as needed for the current state

reset_stress_frame(widget=None)[source]#

Layout the widgets for the pressure/stress as needed for the current state.

We use labels across the top and left side of the table of stresses, then hide the labels and units of all the entries, except for the last entry in the row, which displays the units too. The components shown are those that apply, given the coupling and whether the cell may shear.

stress_keys = ('Sxx', 'Syy', 'Szz', 'Syz', 'Sxz', 'Sxy')#

lammps_step.tk_npt module#

The graphical part of a LAMMPS Energy step

class lammps_step.tk_npt.TkNPT(tk_flowchart=None, node=None, canvas=None, x=None, y=None, w=200, h=50)[source]#

Bases: TkNVT

create_dialog(title='Edit NPT dynamics parameters')[source]#

Create the edit dialog!

This is reasonably complicated, so a bit of description is in order. The superclasses NVT and NVE create the dialog along with the basic runtime and timestep (from NVE) and the setting the temperature and thermostat (NVT).

This method adds a third frame with the pressure and barostat.

The layout is handled in part by the NVT superclass, which handles the temperature frame. Our part is handled by three methods:

  • reset_dialog does the general layout of the large blocks

  • reset_pressure_frame handles the layout of the pressure section except for the detail of the actual pressure/stress which is handled by…

  • reset_stress_frame which does the detailed layout of their stress or pressure terms, depending on whether we are annealing, and the coupling between directions.

handle_dialog(result)[source]#

Handle when the user clicks a button on the dialog, which can either be ‘Cancel’, ‘Help’ or ‘OK’, or they can close the dialog with the ‘x’ button == ‘Cancel’

reset_dialog(widget=None)[source]#

Layout the widgets as needed for the current state

reset_pressure_frame(widget=None)[source]#

Layout the widgets for the pressure/stress control as needed for the current state.

Which controls are shown comes from the parameters’ rules (lammps_step.NPT_Parameters), which the flowchart builder uses too.

reset_stress_frame(widget=None)[source]#

Layout the widgets for the pressure/stress as needed for the current state.

A table of the stresses that apply – given the coupling and whether the cell may shear – with rows for the initial and, if annealing, final stress, and the damping times for the Nose-Hoover barostat; or the pressure. We use labels across the top and left side of the table of stresses, then hide the labels and units of all the entries, except for the last entry in the row, which displays the units too.

stress_components = ('Sxx', 'Syy', 'Szz', 'Sxy', 'Sxz', 'Syz')#

lammps_step.tk_nve module#

The graphical part of a LAMMPS Energy step

class lammps_step.tk_nve.TkNVE(tk_flowchart=None, node=None, canvas=None, x=None, y=None, w=200, h=50, my_logger=<Logger lammps_step.tk_nve (WARNING)>)[source]#

Bases: TkEnergy

create_dialog(title='Edit NVE dynamics parameters')[source]#

Create the dialog!

handle_dialog(result)[source]#

Handle closing the dialog.

Parameters:

result (str) – The button that was pressed to close the dialog, or None if the x dialog close button was pressed.

reset_control_frame(widget=None)[source]#

Layout the control widgets as needed for the current state.

Which controls are shown comes from the parameters’ rules (lammps_step.NVE_Parameters), which the flowchart builder uses too.

reset_dialog(widget=None)[source]#

Layout the widgets as needed for the current state

reset_trajectory_frame(widget=None)[source]#

Layout the trajectory frame according to its contents.

Which controls are shown comes from the parameters’ rules (lammps_step.NVE_Parameters), which the flowchart builder uses too.

trajectory_layout = (('trajectory', 0), ('trajectory number of samples', 1), ('trajectory rate', 1), ('trajectory forces', 1), ('trajectory velocities', 1), ('trajectory save', 1), ('trajectory system name', 2), ('make current', 2), ('trajectory export', 1), ('trajectory extxyz', 2), ('trajectory extxyz skip frames', 3), ('trajectory extxyz filename', 3), ('trajectory extxyz append', 3), ('atomic positions', 0), ('atomic positions number of samples', 1), ('atomic positions rate', 1), ('com positions', 0), ('com positions number of samples', 1), ('com positions rate', 1), ('atomic velocities', 0), ('atomic velocities number of samples', 1), ('atomic velocities rate', 1), ('com velocities', 0), ('com velocities number of samples', 1), ('com velocities rate', 1), ('heat flux', 0), ('heat flux number of samples', 1), ('heat flux rate', 1), ('pressure tensor', 0), ('pressure tensor number of samples', 1), ('pressure tensor rate', 1))#
trajectory_skip = ()#

lammps_step.tk_nvt module#

The graphical part of a LAMMPS NVT dynamics step

class lammps_step.tk_nvt.TkNVT(tk_flowchart=None, node=None, canvas=None, x=None, y=None, w=200, h=50, my_logger=<Logger lammps_step.tk_nvt (WARNING)>)[source]#

Bases: TkNVE

create_dialog(title='Edit NVT dynamics parameters')[source]#

Create the edit dialog!

This is reasonably complicated, so a bit of description is in order. The superclass NVE creates the dialog along with the basic runtime and timestep.

This method adds a second frame for setting the temperature and thermostat (this is the T part of NVT).

The layout is handled in part by the NVT superclass, which handles the temperature frame. Our part is handled by two methods:

  • reset_dialog does the general layout of the large blocks

  • reset_temperature_frame handles the layout of the temperature section except

reset_dialog(widget=None)[source]#

Layout the widgets as needed for the current state

reset_temperature_frame(widget=None)[source]#

Layout the widgets in the temperature frame as needed for the current state.

Which controls are shown comes from the parameters’ rules (lammps_step.NVT_Parameters), which the flowchart builder uses too.

lammps_step.tk_velocities module#

The graphical part of a LAMMPS velocities step

class lammps_step.tk_velocities.TkVelocities(tk_flowchart=None, node=None, canvas=None, x=None, y=None, w=200, h=50)[source]#

Bases: TkNode

create_dialog()[source]#

Create the dialog!

reset_dialog(widget=None)[source]#

Lay out the widgets given the current state.

Which controls are shown comes from the parameters’ rules (lammps_step.VelocitiesParameters), which the flowchart builder uses too.

right_click(event)[source]#

Probably need to add our dialog…

lammps_step.velocities module#

Set the velocities on the atoms

class lammps_step.velocities.Velocities(flowchart=None, title='Velocities', extension=None)[source]#

Bases: Node

description_text(P=None)[source]#

Return a short description of this step.

Return a nicely formatted string describing what this step will do.

Keyword Arguments:

P – a dictionary of parameter values, which may be variables or final values. If None, then the parameters values will be used as is.

get_input(extras=None)[source]#

Get the input for setting the velocities in LAMMPS

property git_revision#

The git version of this module.

property header#

A printable header for this section of output

property version#

The semantic version of this module.

lammps_step.velocities_parameters module#

Control parameters for NVT (canonical) dynamics

class lammps_step.velocities_parameters.VelocitiesParameters(defaults={}, data=None)[source]#

Bases: Parameters

The control parameters for NVT dynamics in LAMMPS

parameters = {'T': {'default': 298.15, 'default_units': 'K', 'description': 'Temperature:', 'format_string': '.2f', 'help_text': 'The temperature corresponding to the velocities.', 'kind': 'float'}, 'method': {'default': 'using a random distribution', 'description': 'Set the temperature', 'enumeration': ('using a random distribution', 'scaling current velocities'), 'format_string': 's', 'help_text': 'The method to use to adjuust the velocities and hence the temperature.', 'kind': 'enumeration'}, 'remove_momentum': {'default': 'remove any translational and, for molecular systems, rotational momentum (default)', 'description': 'Momentum:', 'enumeration': ('remove any translational and, for molecular systems, rotational momentum (default)', 'remove translational but not rotational momentum', 'remove rotational but not translational momentum', 'remove both translational and rotational momentum', 'remove neither translational nor rotational momentum'), 'format_string': 's', 'help_text': 'Ensure that there is no overall linear momentum so the system does not translate.', 'kind': 'enumeration'}, 'seed': {'applies_when': {'method': 'using a random distribution'}, 'default': 'random', 'default_units': None, 'description': 'Random seed:', 'enumeration': ('random',), 'format_string': '', 'help_text': "The seed for the random number generator.'random' means to generate a random integer as the seed.", 'kind': 'integer'}}#

lammps_step.velocities_step module#

Main module.

class lammps_step.velocities_step.VelocitiesStep(flowchart=None, gui=None)[source]#

Bases: object

create_node(flowchart=None, **kwargs)[source]#

Return the new node object

create_tk_node(canvas=None, **kwargs)[source]#

Return the graphical Tk node object

description()[source]#

Return a description of what this extension does

my_description = {'description': 'Set the velocities in preparation for MD', 'group': 'Calculations', 'name': 'Velocities'}#

Module contents#

lammps_step A step for running molecular dynamics using LAMMPS.