kups.observables.stress
¶
Stress tensor calculations via virial theorem and lattice vector gradients.
IsMolecularVirialParticles
¶
Bases: HasPositions, HasGroupIndex, HasSystemIndex, Protocol
Particles with position gradients, group and system assignment.
Source code in src/kups/observables/stress.py
IsMolecularVirialState
¶
Bases: IsState[IsMolecularVirialParticles, IsVirialSystems], Protocol
State with groups for molecular virial stress.
Source code in src/kups/observables/stress.py
IsVirialParticles
¶
Bases: HasPositions, HasSystemIndex, Protocol
Particles with position gradients ∂U/∂r.
Source code in src/kups/observables/stress.py
IsVirialSystems
¶
lattice_vector_stress_from_state(key, state)
¶
Compute stress from lattice vector gradients from a state.
Source code in src/kups/observables/stress.py
molecular_stress_via_virial_theorem(particles, groups, systems)
¶
Compute molecular virial stress tensor (RASPA convention).
The stress tensor is symmetrized: σ = (σ + σᵀ)/2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particles
|
Table[ParticleId, IsMolecularVirialParticles]
|
Per-particle positions, group/system index, and gradients. |
required |
groups
|
Table[GroupId, HasSystemIndex]
|
Per-group system assignment. |
required |
systems
|
Table[SystemId, IsVirialSystems]
|
Per-system unit cell and unit cell gradients. |
required |
Returns:
| Type | Description |
|---|---|
Table[SystemId, Array]
|
Symmetrized stress tensor per system, shape |
Source code in src/kups/observables/stress.py
molecular_virial_stress_from_state(key, state)
¶
Compute molecular virial stress from a state.
Source code in src/kups/observables/stress.py
stress_via_lattice_vector_gradients(systems)
¶
Compute stress from energy gradients w.r.t. lattice vectors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
systems
|
Table[SystemId, IsVirialSystems]
|
Per-system unit cell and unit cell gradients. |
required |
Returns:
| Type | Description |
|---|---|
Table[SystemId, Array]
|
Stress tensor per system, shape |
Source code in src/kups/observables/stress.py
stress_via_virial_theorem(particles, systems)
¶
Compute atomic-level virial stress tensor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particles
|
Table[ParticleId, IsVirialParticles]
|
Per-particle positions, system index, and position gradients. |
required |
systems
|
Table[SystemId, IsVirialSystems]
|
Per-system unit cell and unit cell gradients. |
required |
Returns:
| Type | Description |
|---|---|
Table[SystemId, Array]
|
Stress tensor per system, shape |
Source code in src/kups/observables/stress.py
virial_stress_from_state(key, state)
¶
Compute atomic virial stress from a state.