topo.mdrun package

Submodules

topo.mdrun.mdrun module

Run a TOPO coarse-grained simulation from a control file (md.ini).

This is the canonical runner for the package. Use it as a CLI:

python -m topo.mdrun -f md.ini

or call mdrun() from your own script. Control-file parsing lives in topo.read_simulation_config. After building the single-chain model, if md.ini sets n_copies > 1 the model is replicated into that many non-interacting copies with topo.make_noninteracting_copies (default n_copies = 1 = single chain).

The temperature protocol is selected by the control file:

  • anneal = no (default) – constant-temperature equilibrium at ref_t, written to <outname>.dcd / .log.

  • anneal = yes – two phases. A quench phase holds at t_high (and, for a linear ramp, cools to ref_t) and is written to <outname>_quench.dcd / .log; a production phase then runs md_steps at ref_t and is written to the usual <outname>.dcd / .log. anneal_steps is separate from md_steps (grand total = quench_steps + md_steps); ref_t is the low / refold temperature.

Both share the same build / setup / finalize machinery (topo.engine); only the temperature schedule and output files differ (topo.mdrun.protocol).

topo.mdrun.mdrun.mdrun()[source]

Run a simulation using the TOPO library and parameters specified in a config file.

Usage: python -m topo.mdrun -f md.ini

topo.mdrun.protocol module

Temperature protocol for the runner: equilibrium and annealing/quenching.

A protocol is a list of (temperature, n_steps) stages. The runner builds up to two of them and runs each into its own output files:

  • quench_schedule() – the quench phase (only when anneal = yes): hold at t_high and, for a linear ramp, cool down to ref_t. Written to <outname>_quench.dcd / .log. Sums to cfg.quench_steps().

  • production_schedule() – the production phase: md_steps at ref_t. Written to the usual <outname>.dcd / .log. This is also the whole schedule for a plain equilibrium run.

anneal_steps is therefore separate from md_steps (the grand total is quench_steps() + md_steps), and ref_t is always the low / refold temperature – there is no separate t_low key.

run_protocol() drives an existing Simulation through one schedule, setting the integrator temperature per stage, and can resume a restart partway through a stage.

topo.mdrun.protocol.describe_schedule(schedule)[source]

One-line human summary, e.g. 600 K x 100000 -> 300 K x 900000.

topo.mdrun.protocol.production_schedule(cfg)[source]

The production phase: a single constant-ref_t stage of md_steps.

topo.mdrun.protocol.quench_schedule(cfg)[source]

Stages for the quench phase, summing to cfg.quench_steps().

Returns [] when annealing is off. Otherwise:

  • anneal_ramp = jump -> [(t_high, anneal_steps)]. The actual quench to ref_t happens at the phase boundary, when production starts, so the delta T-jump lands exactly between the _quench and production files.

  • anneal_ramp = linear -> the hold at t_high followed by anneal_ramp_increments discrete cooling stages spanning anneal_ramp_steps (T decreasing t_high -> ref_t).

topo.mdrun.protocol.run_protocol(simulation, schedule, done_steps=0)[source]

Step simulation through schedule, one stage at a time.

done_steps is measured relative to the start of this schedule. It lets a restart resume mid-schedule: stages already completed are skipped, and a stage that was partially done runs only its remaining steps. For a single stage this reduces to simulation.step(n - done_steps).

Module contents

TOPO simulation runner.

Exposes mdrun(), the canonical runner, available from the shell as topo-mdrun -f md.ini or python -m topo.mdrun -f md.ini.