Projects

Molecular Dynamics Trajectory Stitching

shared initial microstate−v+v
shared initial microstate−v+v

Two half-length simulations start from the same molecular state with opposite initial velocities. After reversing one result, the halves can be joined into a single continuous trajectory.

Two simulations start from the same molecular state with opposite velocities, then combine into one continuous trajectory.

One state, two directions

Conventional molecular dynamics is sequential: each state must be calculated before the next. Extending a trajectory therefore requires a longer simulation.

Conventional molecular dynamics is sequential. Time reversibility lets the same initial state generate two independent trajectory halves in parallel.

In a time-reversible system, the same initial state can be simulated with two opposite velocity sets. One run starts with +v and the other with −v. Because the runs are independent, they can be calculated in parallel.

After both runs finish, the −v trajectory is reversed and placed before the shared state. It then joins the +v trajectory to form one full-length trajectory.

One run integrates forward with +v, while the other starts with −v. The −v half is reversed afterward and joined to the +v half at their shared starting state.

How the halves are assembled

The earlier half is not simulated by stepping backwards in time. Both simulations run forward. The second starts with reversed velocities, and its saved frames are placed in reverse order before stitching. This requires a time-reversible integrator: velocity-Verlet with dt = 0.001, applied to 900 particles in a two-dimensional Lennard-Jones system at density 0.70 in the microcanonical ensemble.

  1. 01Forward halfstoring r, v and U at every step

  2. 02Backward halfrun forwards from reversed velocities

  3. 03Relabel as negative timereverse the frames, flip v back

  4. 04Join at the shared statedropping the duplicated centre frame

Does the join alter the dynamics?

The trajectories meet at the same molecular state, but the join may still affect the motion around it. The analysis tests whether it introduces an artificial discontinuity.

The trajectories meet at the same molecular state, but that does not guarantee that the dynamics remain continuous around the join.

  1. across the join
  2. away from it
Short intervals that span the join are measured against short intervals that do not.

Measurements were taken from short intervals that cross the join and compared with equivalent intervals in ordinary, unstitched trajectories. If stitching changes the dynamics, the two sets of measurements should differ systematically.

A deliberately invalid stitch, created from halves with unrelated initial states, served as a negative control. It confirmed that the diagnostics could detect a genuine discontinuity.

Short intervals spanning the join were compared with equivalent intervals in ordinary trajectories. A deliberately invalid stitch served as a negative control to verify that the diagnostic could detect a real discontinuity.

No discontinuity detected

Across all three diagnostics, no comparison involving the valid stitched trajectories differed by more than two standard errors. The deliberately invalid stitch produced a clear mismatch.

The valid stitched trajectories remained consistent with the direct simulations across all three diagnostics, while the deliberately broken stitch separated clearly.

  • Velocity autocorrelation
  • Mean-squared velocity increment
  • Force autocorrelation

Velocity autocorrelation · Velocity increments · Force autocorrelation

Within the tested short-time lag window, there was no clear evidence that stitching disrupted the local dynamics of this Lennard-Jones system.

Within the tested short-time window, no clear stitching-induced disruption of the local dynamics was detected.

These findings apply only to the tested system, integrator, ensemble and short-time diagnostics. They do not establish that stitched trajectories are equivalent to conventional simulations in general.The result is limited to this system, integrator, ensemble and short-time diagnostic. It does not establish general equivalence.

Four panels compare stitched and direct velocity autocorrelation. The curves overlap in the first three panels. In the fourth, the deliberately invalid control remains near zero while the valid stitched curve follows the direct reference.
The stitched and direct trajectories overlap across the diagnostics. The deliberately invalid control separates clearly.Stitched and direct trajectories overlap, while the deliberately invalid control separates clearly.
How the comparison was made

Short intervals on each stitched trajectory were sorted by whether they crossed the join. However, the same split around an arbitrary midpoint in an ordinary trajectory also produces a small difference because of window placement and finite sampling.

The final diagnostic subtracts this baseline difference from the stitched difference, then divides the result by its standard error across 100 matched microstates. The resulting magnitude describes the size of the remaining difference, not its statistical significance.

The maximum |Z| values over the tested lag window were 1.57 for velocity autocorrelation, 1.05 for the mean-squared velocity increment and 1.16 for force autocorrelation. All remained below 2. The derivation, controls and full list of caveats are available in the report.