kups.md.observables
¶
Molecular dynamics observable utilities.
Pure utility functions for computing MD-specific observables from momenta, forces, and other MD quantities. These are used internally by integrators and are distinct from the StateProperty-based observables in kups.observables.
instantaneous_pressure(kinetic_energy, cauchy_stress, volume)
¶
Compute instantaneous pressure from kinetic energy and Cauchy stress.
where \(K\) is the total kinetic energy, \(d\) is the spatial dimensionality, \(V\) is the volume, and \(\boldsymbol{\sigma}\) is the Cauchy stress tensor (units: energy/length³).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kinetic_energy
|
Array
|
Total kinetic energy \(K\) (units: energy), scalar or array. |
required |
cauchy_stress
|
Array
|
Cauchy stress tensor \(\boldsymbol{\sigma}\)
(units: energy/length³), shape |
required |
volume
|
Array
|
System volume \(V\) (units: length³), scalar or array. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Instantaneous pressure \(P\) (units: energy/length³), scalar or array. |
Source code in src/kups/md/observables.py
particle_kinetic_energy(momentum, mass)
¶
Compute the per-particle kinetic energy from momentum and mass.
Calculates the kinetic energy for each particle using:
where \(\mathbf{p}_i\) is the momentum vector and \(m_i\) is the particle mass.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
momentum
|
Array
|
Momentum vector \(\mathbf{p}\) (units: mass·length/time), shape |
required |
mass
|
Array
|
Particle mass \(m\) (units: mass), shape |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Per-particle kinetic energy \(K\) (units: energy), shape |