kups.application.md.data
¶
Data structures and builders for molecular dynamics simulations.
BAOABLangevinParams
¶
Control parameters for the BAOAB Langevin (NVT) integrator.
Attributes:
| Name | Type | Description |
|---|---|---|
time_step |
Array
|
Integration timestep |
temperature |
Array
|
Target temperature |
friction_coefficient |
Array
|
Langevin friction |
Source code in src/kups/application/md/data.py
BAOABNPTLangevinParams
¶
Control parameters for the BAOAB NPT Langevin integrator.
Implements the fully-flexible-cell extended-variable NPT Langevin
formulation of Gao, Fang & Wang, Sampling the isothermal-isobaric
ensemble by Langevin dynamics, JCP 2016 (arxiv 1601.01044). The atom
side reuses the existing Langevin friction γ; the cell side adds a
fictitious mass tensor and a separate Langevin friction.
Attributes:
| Name | Type | Description |
|---|---|---|
time_step |
Array
|
Integration timestep |
temperature |
Array
|
Target temperature |
friction_coefficient |
Array
|
Atom Langevin friction |
target_pressure |
Array
|
Target pressure |
pressure_coupling_time |
Array
|
Barostat coupling time |
compressibility |
Array
|
Isothermal compressibility |
barostat_mass |
Array
|
Fictitious cell mass tensor \(M_{\alpha\beta}\)
(mass·length²), lower-triangular, shape |
barostat_friction |
Array
|
Langevin friction on cell DOFs \(\gamma_{\alpha\beta}\)
(1/time), lower-triangular, shape |
Source code in src/kups/application/md/data.py
CSVRNPTParams
¶
Control parameters for the CSVR-NPT integrator.
Attributes:
| Name | Type | Description |
|---|---|---|
time_step |
Array
|
Integration timestep |
temperature |
Array
|
Target temperature |
thermostat_time_constant |
Array
|
CSVR coupling time |
target_pressure |
Array
|
Target pressure |
pressure_coupling_time |
Array
|
Barostat coupling time |
compressibility |
Array
|
Isothermal compressibility |
minimum_scale_factor |
Array
|
Minimum barostat scale factor, shape |
Source code in src/kups/application/md/data.py
CSVRParams
¶
Control parameters for the CSVR (NVT) integrator.
Attributes:
| Name | Type | Description |
|---|---|---|
time_step |
Array
|
Integration timestep |
temperature |
Array
|
Target temperature |
thermostat_time_constant |
Array
|
CSVR coupling time |
Source code in src/kups/application/md/data.py
MDParticles
¶
Bases: Particles
Particle state for molecular dynamics simulations.
Extends :class:Particles with gradient, momenta, and derived
kinematic quantities needed by MD integrators.
Attributes:
| Name | Type | Description |
|---|---|---|
position_gradients |
Array
|
Energy gradient w.r.t. positions, shape |
momenta |
Array
|
Particle momenta, shape |
exclusion |
Index[ExclusionId]
|
Per-particle exclusion index (defaults to one group per
atom via :func: |
Source code in src/kups/application/md/data.py
MDSystems
¶
Per-system state for molecular dynamics simulations.
Attributes:
| Name | Type | Description |
|---|---|---|
cell |
Cell[Any]
|
Cell geometry for each system. |
integrator_params |
IntegratorParams
|
Bundled integrator control parameters; concrete shape
(e.g. :class: |
cell_gradients |
Cell[Any]
|
Energy gradient w.r.t. the cell, stored as a
:class: |
cell_momentum |
Array
|
Extended-variable cell-momentum tensor \(p^h\),
lower-triangular |
potential_energy |
Array
|
Total potential energy per system (eV), shape |
Source code in src/kups/application/md/data.py
MdParameters
¶
Bases: BaseModel
Physical and numerical parameters for an MD simulation.
Source code in src/kups/application/md/data.py
compressibility
instance-attribute
¶
Isothermal compressibility (1/Pa).
friction_coefficient
instance-attribute
¶
Langevin friction coefficient (1/fs).
initialize_momenta = False
class-attribute
instance-attribute
¶
If True, initialize momenta from Maxwell-Boltzmann distribution.
integrator
instance-attribute
¶
Integration algorithm to use.
minimum_scale_factor
instance-attribute
¶
Minimum allowed box scaling factor per barostat step (dimensionless).
pressure_coupling_time
instance-attribute
¶
Barostat coupling time (fs).
target_pressure
instance-attribute
¶
Target pressure for NPT barostat (Pa).
temperature
instance-attribute
¶
Target temperature (K).
thermostat_time_constant
instance-attribute
¶
CSVR thermostat coupling time (fs).
time_step
instance-attribute
¶
Integration timestep (fs).
MdRunConfig
¶
Bases: BaseModel
Run configuration for an MD simulation.
Source code in src/kups/application/md/data.py
block_size = 1
class-attribute
instance-attribute
¶
Production steps fused per on-device dispatch (1 = per-step). Only the last frame of each block is saved, so the trajectory has num_steps // block_size frames.
num_steps
instance-attribute
¶
Number of production steps.
num_warmup_steps
instance-attribute
¶
Number of warmup steps before production.
out_file
instance-attribute
¶
Path to the output HDF5 file.
seed
instance-attribute
¶
Random seed for reproducibility. None for time-based.
MdState
¶
Force-field-agnostic molecular-dynamics state.
The potential is built with its parameters at construction time (via the
adapters' parameters=), so no force-field field lives on the state.
Source code in src/kups/application/md/data.py
VerletParams
¶
Control parameters for the NVE Velocity Verlet integrator.
Attributes:
| Name | Type | Description |
|---|---|---|
time_step |
Array
|
Integration timestep |
Source code in src/kups/application/md/data.py
md_state_from_ase(atoms, config, *, key=None)
¶
Build MD particles and system data from an ASE Atoms object or file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
atoms
|
Atoms | str | Path
|
ASE Atoms object, or a file path (str/Path) readable by
|
required |
config
|
MdParameters
|
MD configuration with temperature, timestep, and thermostat/barostat parameters. |
required |
key
|
Array | None
|
JAX PRNG key for Maxwell-Boltzmann momenta initialisation. If None, momenta are set to zero. |
None
|
Returns:
| Type | Description |
|---|---|
tuple[Table[ParticleId, MDParticles], Table[SystemId, MDSystems]]
|
Tuple of (particles, systems) ready for use with MD integrators. |
Source code in src/kups/application/md/data.py
md_state_from_particles_and_cell(particles, cell, config, *, key=None)
¶
Build one-system MD particle and system tables from source-neutral data.
The supplied particles and cell must already describe the same system in the same kUPS coordinate frame. This function does not transform geometry; it only adds the system dimension to the cell.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particles
|
Table[ParticleId, Particles]
|
Non-empty particle table for exactly one complete system. |
required |
cell
|
Cell[AnyPeriodicity]
|
Unbatched cell with vectors of shape |
required |
config
|
MdParameters
|
MD configuration with temperature, timestep, and thermostat/barostat parameters. |
required |
key
|
Array | None
|
JAX PRNG key for Maxwell-Boltzmann momenta initialisation. If None, momenta are set to zero. |
None
|
Returns:
| Type | Description |
|---|---|
Table[ParticleId, MDParticles]
|
MD particle and system tables preserving the input particle keys and |
Table[SystemId, MDSystems]
|
referenced |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/kups/application/md/data.py
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 | |