Simulations (relentless.simulate)#

relentless.simulate implements a generalizable and human-readable interface for performing molecular simulations. The simulations are used to evolve a system described by interactions in relentless.potential to generate statistical ensembles. This module implements code to translate one common simulation “recipe” into a running simulation in a variety of popular packages. This gives you the freedom to choose simulation software this is most compatible with your environment and resources using a single common code! It also helps document workflows that can be shared and reproduced by others.

Example

init = relentless.simulate.InitializeRandomly(seed=1)
avg = relentless.simulate.EnsembleAverage(
        check_thermo_every=5,
        check_rdf_every=5,
        rdf_dr=0.1)
ops = [relentless.simulate.RunLangevinDynamics(
            steps=1e3,
            timestep=0.001,
            friction=0.8,
            seed=2),
        relentless.simulate.RunLangevinDynamics(
            steps=1e4,
            timestep=0.001,
            friction=0.8,
            seed=3,
            analyzers=avg)
        ]

# perform simulation using LAMMPS and save ensemble
lmp = relentless.simulate.LAMMPS(init, ops)
sim = lmp.run(potentials)
sim[avg].ensemble.save('ensemble.json')

Major versions of simulation engines are officially supported for two years after their last patch or stable release.

Engines#

Dilute(initializer[, operations])

Simulation of a dilute system.

HOOMD(initializer[, operations, device])

Simulation using HOOMD-blue.

LAMMPS(initializer[, operations, quiet, ...])

Simulation using LAMMPS.

Initializers#

InitializeFromFile(filename[, format, dimension])

Initialize a simulation from a file.

InitializeRandomly(seed, N, V[, T, masses, ...])

Initialize a randomly generated simulation box.

Molecular dynamics#

RunMolecularDynamics(steps, timestep[, ...])

Perform a molecular dynamics simulation.

Thermostats#

BerendsenThermostat(T, tau)

Berendsen thermostat.

NoseHooverThermostat(T, tau)

Nosé-Hoover thermostat.

Barostats#

BerendsenBarostat(P, tau)

Berendsen barostat.

MTKBarostat(P, tau)

MTK barostat.

Other dynamics#

MinimizeEnergy(energy_tolerance, ...[, options])

Perform energy minimization on a configuration.

RunBrownianDynamics(steps, timestep, T, ...)

Perform a Brownian dynamics simulation.

RunLangevinDynamics(steps, timestep, T, ...)

Perform a Langevin dynamics simulation.

Analyzers#

EnsembleAverage(filename, every[, rdf, ...])

Compute average properties.

Record(filename, every, quantities)

Record quantities during a simulation.

WriteTrajectory(filename, every[, format, ...])

Write a simulation trajectory to file.

Running a simulation#

Results#

SimulationInstance(backend, initializer, ...)

Specific instance of a simulation and its data.

Defining interactions#

Potentials([kB])

Set of interaction potentials.

PotentialTabulator(potentials, start, stop, num)

Tabulator for an interaction potential.

AnglePotentialTabulator(potentials, num)

Tabulate one or more angle potentials.

BondPotentialTabulator(potentials, start, ...)

Tabulate one or more bond potentials.

DihedralPotentialTabulator(potentials, num)

Tabulate one or more dihedral potentials.

PairPotentialTabulator(potentials, start, ...)

Tabulate one or more pair potentials.

Developer classes#

Simulation(initializer[, operations])

Simulation engine.

SimulationOperation(analyzers)

Operation to be performed by a Simulation.

AnalysisOperation()

Analysis operation to be performed by a Simulation.

Barostat(P)

Barostat.

Thermostat(T)

Thermostat.