.. _examples-index: ######## Examples ######## Welcome to the |pyretis| examples library. The source distribution keeps user-facing material under :file:`examples/tutorials/` and consistency checks under :file:`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|, we recommend the "Getting started" tutorials first. If you are adapting the examples with help from an LLM, start with :ref:`examples-llm-quickstart` so the assistant follows the same folder, command, and verification conventions as the website. The runnable checks behind these tutorials are tracked in :ref:`example-test-status`. 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. .. toctree:: :maxdepth: 1 examples-tis-1d.rst examples-retis-triple-well.rst examples-2d-hysteresis.rst examples-retis-wca.rst * :ref:`TIS in a 1D double-well potential ` -- the van Erp double-well benchmark and the initial-flux workflow. `Source `__. * :ref:`Triple-well RETIS with zero_left ` -- a three-state potential showing how ``zero_left`` avoids wasted ``[0^-]`` trajectories. `Source `__. * :ref:`Hysteresis on a 2D potential ` -- a richer internal landscape where order-parameter choice matters. `Source `__. * :ref:`Breaking a bond with RETIS ` -- the WCA bond-breaking model from van Erp, Moroni and Bolhuis (2003). `Source `__. Sampling methods ================ These examples focus on the sampling algorithm or the way initial paths are generated. .. toctree:: :maxdepth: 1 examples-retis-1d.rst examples-submoves-1d.rst examples-repptis.rst examples-explore.rst examples-umbrella.rst examples-permeability.rst examples-pso.rst * :ref:`RETIS in a 1D potential ` -- replica exchange between path ensembles for the double-well benchmark. `Source `__. * :ref:`Subtrajectory moves on a 1D potential ` -- stone skipping, web throwing and wire fencing from Riccardi, Dahlen and van Erp (2017) and Zhang, Riccardi and van Erp (2023). `Source `__. * :ref:`Partial path TIS (REPPTIS) ` -- replica exchange partial path TIS for long permeation timescales, from Vervust, Zhang, van Erp and Ghysels (2023). `Source `__. * :ref:`Exploring the order parameter ` -- the ``explore`` task for scouting the order-parameter space and seeding initial paths (see :ref:`Getting the initial path `). `Source `__. * :ref:`Umbrella sampling ` -- free-energy estimation alongside the rate-constant workflows. `Source `__. * :ref:`Permeability calculation ` -- using ``permeability = True`` instead of, or together with, TIS. `Source `__. * :ref:`PSO-based initial path optimisation ` -- particle-swarm assisted initialisation. `Source `__. 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``. .. toctree:: :maxdepth: 1 examples-gromacs-hydrate.rst examples-cp2k-hydrogen.rst examples-lammps-wca.rst examples-openmm.rst examples-vvexternal.rst * :ref:`GROMACS hydrate ` -- methane transport in an sI hydrate with a custom Python order parameter. `Source `__. * :ref:`CP2K hydrogen ` -- a small *ab initio* hydrogen bond-breaking setup. `Source `__. * :ref:`LAMMPS WCA ` -- the 2D WCA bond-breaking model driven by LAMMPS. `Source `__. * :ref:`OpenMM argon ` -- RETIS with OpenMM handling the molecular dynamics. `Source `__. * :ref:`Compiled external components ` -- C and FORTRAN extensions for custom integrators, potentials and order parameters. `Source `__. Analysis ======== These examples show how to start, seed, analyse and visualise runs with ``pyretisrun``, ``pyretisanalyse`` and |pyvisa|. .. toctree:: :maxdepth: 1 examples-md.rst examples-md-fb.rst examples-pyvisa.rst examples-pyvisa-analysis.rst * :ref:`Plain MD ` -- input-file (:ref:`examples-md-nve`) and library-based (:ref:`examples-md-nve-lib`) ways to run a Lennard-Jones simulation. `Source `__. * :ref:`Forward/backward MD ` and :ref:`initial flux ` -- handy when you need to seed initial paths for TIS. `Source `__. * :ref:`pyvisa GUI ` and :ref:`pyvisa analysis ` -- visualise and post-process your trajectories. `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. .. toctree:: :maxdepth: 1 llm-quickstart.rst example-organization.rst examples-from-tests.rst example-test-status.rst interactive-examples.rst * :ref:`PyRETIS quick guide for users and LLMs ` -- compact rules for choosing examples, running commands, and avoiding common setup mistakes. * :ref:`Example organization ` -- folder contract, tutorial authoring rules, and how tutorials link to the heavy suite. * :ref:`Using heavy checks as tutorials ` -- one-shot table of which test fixture to copy when starting a new setup. * :ref:`Example test status ` -- the current verification matrix and per-suite refresh dates. * :ref:`Interactive examples ` -- planned notebook front ends for the lightweight tutorials. The :file:`examples/` folder has two subfolders: * :file:`examples/tutorials/` for user-facing setup guides; * :file:`examples/tests/` for heavy consistency checks. To run all heavy example checks from the repository root: .. code-block:: bash ./test-heavy.sh To run a single check, ``cd`` into its directory and execute its ``run.sh``:: cd examples/tests/test-internal/retis ./run.sh ``run.sh`` cleans the directory, calls ``pyretisrun`` and ``pyretisanalyse``, then runs ``compare.py`` to validate the output against the reference data in :file:`results/`.