Monte Carlo moves

In TIS and RETIS simulations, every Monte Carlo cycle proposes a new trajectory (a path) from the current one using a move, and then accepts or rejects it. A move only changes how a trial path is generated – it never changes which path ensemble is being sampled – so every move listed here targets the exact same distribution and may be combined freely without biasing the result.

This page explains what each move does; the end of the introduction gives a less technical overview of infinite swapping and of the newer moves. The compact two-letter code that PyRETIS writes for every cycle (sh, tr, s+ …) is collected, together with the rejection codes, in Path types and rejection reasons. Which move is used in each ensemble is controlled by the shooting_moves keyword of the [TIS] section.

See also

Added a new move, or changed an existing one? A correct move must reproduce the same crossing probability and rate constant as the established ones, within statistical error. Validate it with the reproducibility suite described in Extending and validating PyRETIS.

Overview

The table lists every move a path-sampling run can attempt. Code is what pathensemble.txt writes (Move types), Selected by the keyword that makes a run use it, and Ref. the papers, listed at the end of the page, that introduce the move or the method it belongs to; a row without a number cites none. The moves come from transition path sampling [5] [6], transition interface sampling (TIS) [7] and replica exchange TIS (RETIS) [8], the methods PyRETIS builds on.

Move

Code

Used by

Selected by

Ref.

Shooting

sh

tis, retis, pptis, repptis, biretis, explore

shooting_move, shooting_moves (the default)

[5] [6]

Biased shooting

sh

tis, retis, pptis, repptis

shooting_move = "bias", or 'bias' in shooting_moves

Time reversal

tr

tis, retis, pptis, repptis, biretis, explore

freq

Zero swap

s+, s-

retis, repptis, biretis

swapfreq

[8]

QuanTIS zero swap

s+, s-

retis, repptis

quantis

(RE)PPTIS swap

p+, p-

repptis

swapfreq

[9] [10]

Stone Skipping, Web Throwing

ss, wt

tis, retis

shooting_move, shooting_moves

[1]

Wire Fencing

wf

tis, retis

shooting_move, shooting_moves

[2]

Multiresolution Wire Fencing

mw

tis, retis

shooting_move = "mwf", or 'mwf' in shooting_moves

Infinite swapping

several rows per cycle

retis, biretis

always on

[3] [13]

Target swap

ts

retis, repptis, and tis and pptis with a [0^-]; in [0^-]

target_freq

[12]

Mirror

mr

retis, repptis, and tis and pptis with a [0^-]; in [0^-]

mirror_freq

[12]

Basic moves

These are the standard TIS/RETIS moves and are sufficient for most simulations.

Shooting (sh)

The workhorse of path sampling. A shooting point is picked at random among the phase-space points of the current accepted path, its momenta are modified, and the equations of motion are integrated forward and backward from that point to assemble a new trial path. The trial is accepted only if it still satisfies the ensemble’s start/end conditions (i.e. it crosses the relevant interface).

How the momenta are modified is set by the sigma_v keyword:

  • Aimless shooting (sigma_v negative, the default): the velocities at the shooting point are redrawn from the Maxwell–Boltzmann distribution at the system temperature.

  • Non-aimless shooting (sigma_v zero or positive): a Gaussian perturbation of width sigma_v, the same for every particle, is added to the current velocities and the momentum change is accepted or rejected with the Metropolis criterion.

Biased shooting (bias)

Standard shooting picks the shooting point uniformly. The biased move picks it non-uniformly – biased toward “interesting” frames such as the barrier top – to converge a rate in fewer MD steps, without changing the sampled path ensemble: the crossing probability and the rate are statistically identical. A per-frame weight \(w(x)\) (set by a [shooting-selector]) gives the selection probability \(w_i/W\), and a valid trial path is accepted with the exact correction \(\min(1, W_\mathrm{old}/W_\mathrm{new})\). It needs aimless shooting (sigma_v < 0) and a [shooting-selector] section. See Biased shooting-point selection for the theory, the selectors, and a worked TOML example. The 'exp' shooting move of PyRETIS 3, a heuristic without this correction, does not run outside an explore run: use 'bias'.

Time-reversal (tr)

A cheap move that needs no new integration: the current accepted path is reversed in time – the order of the phase points is inverted and the momenta are flipped – to produce the trial path. For deterministic dynamics the reversed trajectory is itself a valid trajectory, so time-reversal is typically interleaved with shooting to help decorrelate the sampled paths.

Zero swap (s+ / s-)

The swap of RETIS between the two ensembles at the initial state, [0^-] and [0^+]: each builds its new path from the frames where the other’s path crosses the first interface, and the equations of motion are integrated to complete it. In a retis run, a move picked in [0^-] or [0^+] is the zero swap, with the probability set by the swapfreq keyword of the [RETIS] section, when the other ensemble is free. The code s+ is recorded in [0^-] and s- in [0^+]. A retis run attempts no other swap: the positive ensembles exchange their paths through infinite swapping (below), which can show in pathensemble.txt as several rows of one cycle, each with its share in FracInc. A repptis run, with the same probability, swaps a picked ensemble with an adjacent one: [0^-] with [0^+] by the zero swap, two positive ensembles by a swap recorded as p+ / p-.

Advanced moves: sub-trajectory moves

Stone Skipping (ss), Web Throwing (wt) [1] and Wire Fencing (wf) [2] build a new path from several short sub-trajectories (“jumps”) instead of a single long shot. They are designed to improve sampling efficiency and path decorrelation for stiff or diffusive barriers where ordinary shooting struggles. The number of sub-trajectories is set by n_jumps, and high_accept selects the acceptance rule of Stone Skipping (see the high-acceptance variants below). Multiresolution Wire Fencing (mwf) runs the Wire Fencing scheme at two engine resolutions, and is described below.

The three sub-trajectory moves

Fig. 5 Cartoon of the three sub-trajectory moves. The old path is shown in blue, the sampled sub-trajectories in orange, and the resulting new path – a chosen sub-trajectory together with its extensions – in green.

Stone Skipping (ss)

Generates the new path through a sequence of short shooting steps that “skip” off the interface, reusing the accepted sub-paths. See [1] for the algorithm and acceptance rule.

Web Throwing (wt)

A sub-trajectory move closely related to Stone Skipping, also introduced in [1].

Wire Fencing (wf)

A sub-trajectory move [2] that bounds its sub-paths with an additional cap interface, placed above the ensemble interface and set by the interface_cap keyword. The cap has to lie beyond the interface defining the ensemble; choosing it poorly can hurt sampling efficiency.

Multiresolution Wire Fencing (mwf)

Wire Fencing run at two engine resolutions. The intermediate sub-paths of each set are shot with the reduced subcycle count set by mwf_subcycle_small, and the final sub-path of the set is shot with the engine’s own subcycles. The surviving sub-path is extended to a full path and accepted with the same sub-trajectory acceptance rule as the moves above. mwf_nsubpath sets how many sub-paths a set holds, and n_jumps how many sets are generated.

A hands-on walkthrough of configuring these three moves is given in the sub-trajectory moves tutorial.

Moves of the other path-sampling methods

Partial-path swap (p+ / p-)

The pptis and repptis tasks sample partial paths: partial path TIS (PPTIS) [9] keeps only the part of a path between the interface before and the interface after the one an ensemble belongs to, and REPPTIS [10] adds replica exchange between these ensembles. With memory = m (the REPPTIS section), ensemble \(i\) holds the paths of the window \([\lambda_{i-m}, \lambda_i, \lambda_{i+m}]\); the kinetics are rebuilt from the crossing probabilities of these windows [11] (see the REPPTIS example). A pptis run swaps no paths. In a repptis run, a move picked in any ensemble is, with the probability swapfreq, a swap with an adjacent ensemble: for two positive ensembles, each takes a new path made from the other’s path, and the swap is recorded as p+ / p-. The swap is tried only when the two paths reach across each other’s ensemble; otherwise it is rejected (NCR). A pptis or repptis run refuses the sub-trajectory moves (ss, wt, wf and mwf).

QuanTIS zero swap

With [tis] quantis = true the [0^-] ensemble is propagated with the engine of the [engine0] section, for instance a cheaper level of theory, and all other ensembles with [engine]. The zero swap of [0^-] and [0^+] is then accepted with a Metropolis test on the energies that the two engines give to the two swapped configurations, so that the sampling stays exact; when the two engines are the same the test accepts every swap. The code is s+ / s-, as for the RETIS zero swap; the energy test rejects a swap with QEA, and every rejection of the swap is listed in Path types and rejection reasons. accept_all skips the test, which is exact only when the engines give the same energies.

The high-acceptance variants

With high_accept = true, the default, Stone Skipping accepts every valid trial path and gives it a weight (the HA-weight column of pathensemble.txt), which the swaps and the analysis then use, instead of a Metropolis test on the crossing count; Wire Fencing always works this way. The zero swap of an ensemble that uses Wire Fencing is then accepted with the ratio of the weights the two paths would carry; a rejection is HAS. Web Throwing has its own acceptance and is not changed by the keyword.

Infinite swapping and parallel workers

Every path-sampling run of PyRETIS uses the infinite-swapping sampler [3] – an asynchronous, highly parallel reformulation of the replica-exchange move. It removes the main scaling bottleneck of classical RETIS, where a replica swap is a synchronisation point: every worker must finish its current trajectory before the next round of swaps can be evaluated.

Instead of attempting swaps between fixed neighbouring pairs, the infinite-swapping scheme keeps a central coordinator that records swap acceptance statistics over the running stream of completed trajectories. Each worker then draws its next task from the resulting distribution and is handed new work as soon as it frees up. As a result the wall-clock time keeps scaling close to linearly with the number of workers over a far wider range than synchronous replica exchange allows. A move that finishes while the coordinator treats another one waits for it; a run with several workers logs at its end how many moves waited (workers). The Wire Fencing move described above pairs naturally with this sampler, since it keeps acceptance high on the long paths that aggressive parallel sampling tends to produce.

Every path-sampling run – task = "tis", "retis", "explore", "pptis", "repptis" or "biretis" – runs on this sampler, through the same pyretis run command as every other simulation. The number of parallel workers is the workers keyword of a [runner] section; without one the run has one worker. Paths move between ensembles only in retis and biretis runs and by the swaps of a repptis run: tis, pptis and explore shoot each ensemble on its own. The runner section reference documents the [runner] keywords and the environment overrides, and the infinite-swapping tutorial walks through a runnable example. task = "infinite_swapping" belongs to inputs of the legacy-runner schema; an input written with the sections of this guide that sets it is refused, with a message that names the task to set instead.

pyretis analyse combines the per-interface crossing probabilities into the overall one by matching them, the default, or with the Weighted Histogram Analysis Method (WHAM) [4], which reweights the paths shared across all ensembles in a single histogram; method of the [analysis] section selects "wham", or "both" for both. See the analysis guide.

Moves of the biretis and permeability tasks

The biretis task runs two ladders of ensembles, one per state, and shared ensembles where they meet. Every ensemble is shot with sh, with the time reversal of freq; a reactive path counts for both rates, and a time reversal in a shared ensemble turns a path from A to B into one from B to A. Each state has its own [0^-] and [0^+] and its own zero swap, at the swapfreq probability, and the infinite-swapping sampler exchanges the paths of the positive and shared ensembles. It takes no other move: [tis] shooting_moves, a [tis] shooting_move other than "sh", [tis] quantis = true, and a [tis] mirror_freq or [tis] target_freq above 0 are refused (see the biretis example).

With the pyretis_permeability order parameter, [tis] mirror_freq and [tis] target_freq add two moves to the [0^-] ensemble of a run that has one (biretis refuses them), which change what the order parameter measures [12] (see the permeability example). The mirror move (mr, mirror_freq) flips the side of the mirror plane on which the order parameter is measured and recomputes it along the path; it is always accepted. The target swap (ts, target_freq) switches the order parameter to another particle of target_indices, rebuilds the path for it and accepts it with a Metropolis test; its rejections are TSS, TSA and, for a path that grows too long, BTX and FTX. Both need one worker.

Other moves

These appear mainly in specific algorithms or during path initiation; all their codes are listed in Move types.

  • Target swap (ts) and Mirror (mr) – the moves of the permeability method, described above.

  • Null move (00) – keeps the current path unchanged. A PyRETIS 4 run attempts none: [retis] nullmoves and [tis] nullmoves are refused. The code appears in the output of a PyRETIS 3 run with nullmoves = True.

  • Initiation moves – how the very first path of a run is produced: kick initiation (ki), initial shoot (is), and loading an existing path from external files, either unformatted/binary (ld) or formatted/text (rf; PyRETIS 3 wrote it as re). A path-sampling run writes the rows of its initial paths in pathensemble.txt with ld, whether they were loaded or kicked.

Configuring moves

The moves are selected and tuned through the [TIS] and [RETIS] input sections. The most relevant keywords are:

Keyword

Controls

shooting_moves

The move used in each ensemble ('sh', 'ss', 'wt', 'wf', 'mwf', 'bias'); a pptis or repptis run refuses 'ss', 'wt', 'wf' and 'mwf'.

sigma_v

Aimless vs. non-aimless shooting and the velocity-perturbation width.

n_jumps

Number of sub-trajectories for Stone Skipping, Web Throwing and Wire Fencing.

high_accept

Selects the acceptance rule of Stone Skipping; Wire Fencing always uses high acceptance and Web Throwing its own rule.

interface_cap

The cap interface used by Wire Fencing.

swapfreq

The probability of a swap move.

References