kups.application.md.simulation
¶
IsMdGradients
¶
Bases: Protocol
Protocol for MD gradient outputs.
Attributes:
| Name | Type | Description |
|---|---|---|
positions |
Table[ParticleId, Array]
|
Position gradients as Table[ParticleId, Array]. |
unitcell |
Table[SystemId, UnitCell]
|
Unit cell gradients as Table[SystemId, UnitCell]. |
Source code in src/kups/application/md/simulation.py
IsMdState
¶
Bases: Protocol
Protocol for the full MD simulation state.
Attributes:
| Name | Type | Description |
|---|---|---|
particles |
Table[ParticleId, MDParticles]
|
Per-particle data (positions, momenta, forces, etc.). |
systems |
Table[SystemId, MDSystems]
|
Per-system data (unit cell, thermostat parameters, etc.). |
step |
Array
|
Current simulation step counter. |
Source code in src/kups/application/md/simulation.py
make_md_propagator(state_lens, integrator, potential)
¶
Build a single MD propagator step with error recovery and step counting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state_lens
|
Lens[State, State]
|
Lens focusing on the MD sub-state within the full state. |
required |
integrator
|
Integrator
|
Integration algorithm for equations of motion. |
required |
potential
|
Potential[State, Grad, EmptyType, Any]
|
Potential energy function providing forces and gradients. |
required |
Returns:
| Type | Description |
|---|---|
Propagator[State]
|
Propagator that advances the state by one MD step. |
Source code in src/kups/application/md/simulation.py
run_md(key, propagator, state, config)
¶
Run a full MD simulation with warmup and production phases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
Array
|
JAX PRNG key. |
required |
propagator
|
Propagator[State]
|
MD propagator produced by |
required |
state
|
State
|
Initial simulation state. |
required |
config
|
MdRunConfig
|
Run configuration (steps, output file, seed). |
required |
Returns:
| Type | Description |
|---|---|
State
|
Final simulation state after production run. |