StructuresDictReporter#

Capturing simulation trajectories in a lightweight Python structures dictionary.

The StructuresDictReporter class records coordinates, velocities, box vectors, and timestamps directly into a molsysmt.StructuresDict dictionary.

Added in version 1.0.0.

Basic usage#

Let’s demonstrate using StructuresDictReporter with an OpenMM simulation:

import molsysmt as msm

molsys = msm.convert(msm.systems['Trp-Cage']['1l2y.h5msm'], to_form='molsysmt.MolSys')
simulation = msm.convert(molsys, to_form='openmm.Simulation', temperature='300 K')

reporter = msm.third_party.openmm.reporters.StructuresDictReporter(reportInterval=10)
simulation.reporters.append(reporter)
simulation.step(20)
res = reporter.finalize()
print('Captured trajectory frames:', len(res['coordinates']))
Captured trajectory frames: 3