Examples

Welcome to the PyRETIS examples library. The source distribution keeps user-facing material under examples/tutorials/ and consistency checks under examples/tests/.

The pages are grouped by topic, with a short note on what each tutorial covers so you can pick the one that matches the question you have. If you are new to PyRETIS, start with a minimal input file. If you are adapting the examples with help from an AI agent, start with the Agent-TIS quick start so the agent follows the same folder, command, and verification conventions as the website. The runnable checks behind these tutorials are tracked in Example test status.

Start here

  • A minimal input file – the shortest input that runs a complete RETIS simulation, and what PyRETIS fills in when you leave everything optional out. The best first read if you have never written a PyRETIS input. Source.

  • A minimal input file with an external engine – the same, driving OpenMM: the engine owns the system, so the input shrinks to what to sample, which engine to drive, and how to measure it. Source.

Potentials

These examples are a good place to start when the main question is which model system to use. They run with the internal PyRETIS engine unless noted otherwise, and each entry links to the matching tutorial source folder in the repository.

Sampling methods

These examples focus on the sampling algorithm or the way initial paths are generated.

External engines

These tutorials replace the internal Langevin engine with one of the standard MD codes, or with compiled extension modules. They require the corresponding engine or compiler to be installed and reachable on your PATH.

Analysis

These examples show how to start, seed, analyse and visualise runs with pyretis run, pyretis analyse and PyVisA.

  • Plain MD – input-file (Molecular dynamics using an input file) and library-based (Molecular dynamics using the PyRETIS library) ways to run a Lennard-Jones simulation. Source.

  • Forward/backward MD – a Lennard-Jones MD run, with the potential written in Python, C or FORTRAN, whose velocities are reversed after a number of steps so that the run retraces its way back to the initial configuration. Source.

  • Initial flux – the md-flux run that measures the flux through the first interface; with the crossing probability from TIS it gives the rate constant. Source.

  • pyvisa GUI and pyvisa analysis – visualise and post-process your trajectories. Source.

  • Transmission coefficient – compute the reactive-flux transmission coefficient from a finished run’s per-path order series. Source.

  • Combine data – pool several independent runs’ pathensemble.txt into a single crossing matrix for one WHAM analysis. Source.

How the examples are organised

The pages below describe the contract between tutorial pages and heavy checks, the rules for adding new examples, the current verification status, and the LLM-oriented quick reference.

The examples/ folder has two subfolders:

  • examples/tutorials/ for user-facing setup guides;

  • examples/tests/ for heavy consistency checks.

To run all heavy example checks from the repository root:

./test-heavy.sh

To run a single check, cd into its directory and execute its run.sh with -C:

cd examples/tests/test-internal/retis
./run.sh -C

run.sh removes the output of an earlier run (pyretis tools clean), calls pyretis run and pyretis analyse, and leaves the results in place. -C also compares them with the reference data in results/, -c removes them afterwards, and -cc does both; a plain ./run.sh compares nothing (see Example organization).