polymerist.mdtools.openmmtools.thermo

API for selecting thermostat and barostat actions which realize particular thermodynamic ensembles

Attributes

LOGGER

ThermostatSerializer

BarostatSerializer

Exceptions

NPHEnsembleUnsupported

Raised when a user attempts to initialize ThermoParameters with a barostat but not thermostat

Classes

Thermostat

Common thermostats which OpenMM implements and which adhere to the interface defined here

ThermostatParameters

Interface for initializing a constant-temperature simulation

Barostat

Common barostats which OpenMM implements and which adhere to the interface defined here

BarostatParameters

Interface for initializing a constant-pressure simulation

Ensemble

Common thermodynamic ensembles which are realizable with the interfaces provided here

ThermoParameters

Encapsulation for initializing the OpenMM forces and integrator which realize a particular thermodynamic ensemble

Module Contents

polymerist.mdtools.openmmtools.thermo.LOGGER
class polymerist.mdtools.openmmtools.thermo.Thermostat(*args, **kwds)[source]

Bases: enum.Enum

Common thermostats which OpenMM implements and which adhere to the interface defined here

ANDERSEN
BROWNIAN
LANGEVIN
LANGEVIN_MIDDLE
NOSE_HOOVER
LANGEVINMIDDLE
NOSEHOOVER
polymerist.mdtools.openmmtools.thermo.ThermostatSerializer
class polymerist.mdtools.openmmtools.thermo.ThermostatParameters[source]

Interface for initializing a constant-temperature simulation

temperature: openmm.unit.Quantity
timescale: openmm.unit.Quantity
thermostat: str | Thermostat
forces() Iterable[openmm.Force][source]

The forces required to realized the desired thermostat

integrator(time_step: openmm.unit.Quantity) openmm.Integrator[source]

The integrator required to realized the desired thermostat

class polymerist.mdtools.openmmtools.thermo.Barostat(*args, **kwds)[source]

Bases: enum.Enum

Common barostats which OpenMM implements and which adhere to the interface defined here

MONTE_CARLO
MONTE_CARLO_FLEXIBLE
MC
MONTECARLO
FLEXIBLE
polymerist.mdtools.openmmtools.thermo.BarostatSerializer
class polymerist.mdtools.openmmtools.thermo.BarostatParameters[source]

Interface for initializing a constant-pressure simulation

pressure: openmm.unit.Quantity
temperature: openmm.unit.Quantity | None = None
update_frequency: int = 25
barostat: str | Barostat
forces() Iterable[openmm.Force][source]

The forces required to realized the desired barostat

integrator(time_step: openmm.unit.Quantity) openmm.Integrator[source]

The integrator required to realized the desired barostat

exception polymerist.mdtools.openmmtools.thermo.NPHEnsembleUnsupported(msg: str = f'NPH ensemble not supported; either add a thermostat or remove a barostat from thermodynamic parameters', *args, **kwargs)[source]

Bases: ValueError

Raised when a user attempts to initialize ThermoParameters with a barostat but not thermostat Would cause OpenMM to produce incorrect results (https://docs.openmm.org/latest/userguide/application/02_running_sims.html#pressure-coupling)

class polymerist.mdtools.openmmtools.thermo.Ensemble[source]

Bases: enum.StrEnum

Common thermodynamic ensembles which are realizable with the interfaces provided here

NVE = 'microcanonical'
NVT = 'canonical'
NPT = 'isothermal-isobaric'
class polymerist.mdtools.openmmtools.thermo.ThermoParameters[source]

Encapsulation for initializing the OpenMM forces and integrator which realize a particular thermodynamic ensemble

thermostat_params: ThermostatParameters | None = None
barostat_params: BarostatParameters | None = None
property ensemble: Ensemble

The standard name of the thermodynamic ensemble being implemented here

describe_ensemble() str[source]

Verbal description of ensemble

integrator(time_step: openmm.unit.Quantity) openmm.Integrator[source]

Specify how to integrate forces in each timestep

forces() Iterable[openmm.Force] | None[source]

Specify any additional force contributions to position/velocity updates