Enhanced sampling API#

The enhanced sampling API adds biases and replica exchange to a dynamics run. EnhancedSampling builds the engine. A bias is an additive potential that the engine sums against the unmodified model output.

See also

The enhanced sampling user guide for the workflow, choice of bias, and worked examples.

Engine#

EnhancedSampling

Declarative recipe for biased dynamics on a BaseDynamics engine.

ThermodynamicState

One set of conditions a walker can be assigned to.

ReplicaExchange

Synchronous replica exchange with an even/odd pair schedule.

Bias contract and hooks#

ConservativeBias

A bias defined by a differentiable energy.

AdaptivePotentialMixin

Mixin for a bias whose state changes as sampling proceeds.

BiasHook

Evaluate every bias against one unmodified model output, then apply.

EpochCommitHook

Fire StatefulHook.commit() on a consistency-epoch cadence.

WalkerIdentityHook

Stamp walker identity and step counters onto the live batch.

Built-in biases#

HarmonicUmbrellaBias

Multi-dimensional harmonic restraint on one or more collective variables.

UpperWall

Penalise the CV for rising above a threshold.

LowerWall

Penalise the CV for falling below a threshold.

FlatBottomRestraint

Confine the CV to an interval, with no force inside it.

WellTemperedMetaDynamicsBias

Gaussian hills deposited along a CV, with well-tempered damping.

RMSDMetaDynamicsBias

Repulsive Gaussian bias over retained reference structures.

AdaptiveBiasingForce

Estimate and cancel the mean force along a pair distance.

Collective variables#

pair_distance

Return the displacement between two atoms per graph, shape [B, 3].

pair_displacement

Differentiable pair distance(s) as a collective variable.

periodic_difference

Return values - centers, wrapped into (-period/2, period/2].