Advanced Examples#

These examples are for users who want to extend the nvalchemi-toolkit framework. They require understanding of the intermediate tier.

01 — Biased Potential: BiasedPotentialHook for harmonic COM restraints and umbrella sampling patterns.

02 — Custom Hook: Implementing the Hook protocol with a full radial distribution function accumulator.

03 — Custom Convergence: ConvergenceHook with multiple criteria and custom_op for arbitrary convergence logic.

04 — MACE NVT: Using a real MACE MLIP for NVT dynamics; automatic neighbor list wiring via ModelCard; LJ fallback for CI.

05 — Custom Integrator: Subclassing BaseDynamics to implement a velocity-rescaling thermostat; the pre_update/post_update contract; _init_state for stateful integrators.

Biased Sampling with BiasedPotentialHook

Biased Sampling with BiasedPotentialHook

Writing a Custom Hook: Radial Distribution Function

Writing a Custom Hook: Radial Distribution Function

Multi-Criteria Convergence with Custom Operators

Multi-Criteria Convergence with Custom Operators

NVT MD with MACE (with LJ Fallback)

NVT MD with MACE (with LJ Fallback)

Building a Custom Integrator by Subclassing BaseDynamics

Building a Custom Integrator by Subclassing BaseDynamics

Long-Range Electrostatics with Ewald Summation

Long-Range Electrostatics with Ewald Summation

Composable Model Composition (LJ + Ewald)

Composable Model Composition (LJ + Ewald)