Contract
- Input: physical system description and simulation goal.
- Output: parameter files + container + verification.
- Side effects: none.
- Dependencies: none.
- Stop condition: verification complete.
- Risk: low.
- Boundary: produces simulation setup; does not run long computations unless user executes container.
Physics Simulation Setup
Prepare a reproducible simulation for a physics system — Monte Carlo, molecular dynamics, DFT, quantum dynamics — with exact parameters and a verification step.
When to use
- A research question needs numerical simulation.
- A simulation result needs to be reproducible by reviewers or collaborators.
- A publication requires code and environment details.
Process
1. Select the simulation family
- Monte Carlo — GEANT4 (particle physics), ROOT / Pythia.
- Molecular dynamics — LAMMPS (classical), GROMACS (biomolecules).
- DFT — VASP, Quantum ESPRESSO, ABINIT.
- Quantum dynamics — QuTiP (open quantum systems), Julia (DynamicalSystems.jl).
State choice and why.
Completion criterion: family and tool named; justification stated.
2. Define the system
- Geometry / lattice / potential — input file with exact parameters.
- Initial conditions — thermal, ground state, excited state.
- Boundary conditions — periodic, open, vacuum, fixed.
- Physical units — eV, K, angstrom, fs, with conversion notes.
Completion criterion: all parameters explicit; units consistent.
3. Configure the simulation
- Timestep — justified by stability criteria.
- Integration length — long enough for convergence, short enough for feasibility.
- Sampling / statistics — number of trajectories, statistical error target.
- Output format — HDF5 / CSV / ROOT with a schema description.
Completion criterion: configuration file complete; schema described.
4. Containerise
- Docker: base image with the simulation tool + dependencies.
- Apptainer: for HPC clusters.
- Include: parameter file, script, environment file with versions.
Completion criterion: container builds; runs and produces expected output.
5. Verify
Compare against:
- Analytical limit — e.g. ideal gas law, harmonic oscillator, free particle.
- Benchmark — known result from literature or standard test case.
- Convergence — result stable as parameter (timestep, grid size, trajectory count) changes.
Report agreement (percentage difference) and note any discrepancy.
Completion criterion: verification report saved; agreement stated.
1---2name: physics-simulation-setup3description: Set up reproducible physics simulations — Monte Carlo (GEANT4), molecular dynamics (LAMMPS), DFT (VASP, Quantum ESPRESSO), quantum dynamics (QuTiP) — with containers, parameter files, and verification.4---56## Contract78- **Input:** physical system description and simulation goal.9- **Output:** parameter files + container + verification.10- **Side effects:** none.11- **Dependencies:** none.12- **Stop condition:** verification complete.13- **Risk:** low.14- **Boundary:** produces simulation setup; does not run long computations unless user executes container.1516# Physics Simulation Setup1718Prepare a **reproducible simulation** for a physics system — Monte Carlo, molecular dynamics, DFT, quantum dynamics — with exact parameters and a verification step.1920## When to use2122- A research question needs numerical simulation.23- A simulation result needs to be reproducible by reviewers or collaborators.24- A publication requires code and environment details.2526## Process2728### 1. Select the simulation family2930- **Monte Carlo** — GEANT4 (particle physics), ROOT / Pythia.31- **Molecular dynamics** — LAMMPS (classical), GROMACS (biomolecules).32- **DFT** — VASP, Quantum ESPRESSO, ABINIT.33- **Quantum dynamics** — QuTiP (open quantum systems), Julia (DynamicalSystems.jl).3435State choice and why.3637**Completion criterion:** family and tool named; justification stated.3839### 2. Define the system4041- **Geometry / lattice / potential** — input file with exact parameters.42- **Initial conditions** — thermal, ground state, excited state.43- **Boundary conditions** — periodic, open, vacuum, fixed.44- **Physical units** — eV, K, angstrom, fs, with conversion notes.4546**Completion criterion:** all parameters explicit; units consistent.4748### 3. Configure the simulation4950- **Timestep** — justified by stability criteria.51- **Integration length** — long enough for convergence, short enough for feasibility.52- **Sampling / statistics** — number of trajectories, statistical error target.53- **Output format** — HDF5 / CSV / ROOT with a schema description.5455**Completion criterion:** configuration file complete; schema described.5657### 4. Containerise5859- **Docker:** base image with the simulation tool + dependencies.60- **Apptainer:** for HPC clusters.61- Include: parameter file, script, environment file with versions.6263**Completion criterion:** container builds; runs and produces expected output.6465### 5. Verify6667Compare against:6869- **Analytical limit** — e.g. ideal gas law, harmonic oscillator, free particle.70- **Benchmark** — known result from literature or standard test case.71- **Convergence** — result stable as parameter (timestep, grid size, trajectory count) changes.7273Report agreement (percentage difference) and note any discrepancy.7475**Completion criterion:** verification report saved; agreement stated.