kups.potential.classical
¶
Classical molecular mechanics force fields.
This module provides standard force field components used in molecular simulations: non-bonded interactions (Lennard-Jones, Coulomb, Ewald) and bonded terms (harmonic bonds, angles, dihedrals). All potentials support tail corrections, cutoffs, and neighbor lists.
Available Potentials¶
- Lennard-Jones: Van der Waals interactions with optional tail corrections
- Coulomb: Electrostatic interactions
- Ewald: Long-range electrostatics via Ewald summation
- Harmonic: Bonded interactions (bonds, angles)
- Cosine Angle: UFF-style cosine angle bending
- Morse: Anharmonic bond stretching with proper dissociation
- Dihedral: Torsion potentials (UFF-style)
- Inversion: Out-of-plane/improper potentials (UFF-style)
Each potential provides a make_*_potential factory function that constructs a
configured Potential instance.
lennard_jones_pair = PairEnergy[LennardJonesParameters, IsLennardJonesParticles, Index[Label]](kernel=lennard_jones_pair_kernel, features=(lambda p: p.labels), cutoffs=(lambda p: p.cutoff))
module-attribute
¶
LJ pair term; add terms before constructing a fused evaluator.
CosineAngleParameters
¶
UFF-style cosine angle potential parameters.
Attributes:
| Name | Type | Description |
|---|---|---|
labels |
tuple[Label, ...]
|
Species labels, shape |
theta0 |
Array
|
Equilibrium angles [radians], shape |
k |
Array
|
Force constants [energy], shape |
linear_tol |
Array
|
Tolerance for detecting linear angles [radians]. |
Source code in src/kups/potential/classical/cosine_angle.py
from_uff(labels, bond_angle, bond_radius, electronegativity, effective_charge, linear_tol=jnp.radians(5))
classmethod
¶
Create angle parameters using UFF formulas.
Computes angle parameters from per-species atomic properties: - \(\theta_0\) from central atom's bond angle - \(K\) from Eq. 13 using bond lengths and effective charges
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
labels
|
tuple[str, ...]
|
Species labels, shape |
required |
bond_angle
|
Array
|
Natural valence angle [radians], shape |
required |
bond_radius
|
Array
|
Valence bond radii [A], shape |
required |
electronegativity
|
Array
|
GMP electronegativity, shape |
required |
effective_charge
|
Array
|
Effective atomic charge Z*, shape |
required |
linear_tol
|
Array
|
Tolerance for detecting linear angles [radians] |
radians(5)
|
Returns:
| Type | Description |
|---|---|
CosineAngleParameters
|
CosineAngleParameters with full interaction matrices |
Source code in src/kups/potential/classical/cosine_angle.py
DihedralParameters
¶
UFF dihedral/torsion potential parameters.
Attributes:
| Name | Type | Description |
|---|---|---|
labels |
tuple[Label, ...]
|
Species labels, shape |
V |
Array
|
Barrier heights [energy], shape |
n |
Array
|
Periodicities, shape |
phi0 |
Array
|
Equilibrium dihedral angles [radians],
shape |
Source code in src/kups/potential/classical/dihedral.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | |
from_uff(labels, bond_angle, torsion_sp3, torsion_sp2, group, bond_order=None, hybridization_tol=5.0 * 3.141592653589793 / 180.0)
classmethod
¶
Create dihedral parameters using UFF formulas.
Computes torsion parameters based on central bond hybridization following the UFF paper (Rappe et al. 1992). For dihedral i-j-k-l, parameters depend on the central j-k bond and neighboring atoms.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
labels
|
tuple[str, ...]
|
Species labels, shape |
required |
bond_angle
|
Array
|
Natural valence angle [radians], shape |
required |
torsion_sp3
|
Array
|
sp3 torsional barrier V [kcal/mol], shape |
required |
torsion_sp2
|
Array
|
sp2 torsional parameter U [kcal/mol], shape |
required |
group
|
Array
|
Periodic table group (1-18), shape |
required |
bond_order
|
Array | None
|
Bond order for j-k bond, shape |
None
|
hybridization_tol
|
float
|
Tolerance for hybridization detection [radians]. |
5.0 * 3.141592653589793 / 180.0
|
Returns:
| Type | Description |
|---|---|
DihedralParameters
|
DihedralParameters with full 4D interaction matrices. |
Source code in src/kups/potential/classical/dihedral.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | |
EwaldParameters
¶
Per-system cutoffs and reciprocal shifts prepared before evaluation.
reciprocal_lattice_shifts stores sphere-filtered shifts padded for
batching. reciprocal_shift_bound always stores three axis bounds.
(0, 0, 0) selects explicit sums over the shifts; other bounds select
factored phase grids over that box, from which the shifts are gathered.
Rebuild parameters and the structure-factor cache when changing the cell
or cutoff. reciprocal_dtype is the precision of structure-factor
evaluations; float32 is much faster on GPUs with slow double precision.
Source code in src/kups/potential/classical/ewald/parameters.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |
from_cutoffs(cell, alpha, cutoff, k_max, *, reciprocal_particle_chunk_size=None, reciprocal_k_chunk_size=_DEFAULT_RECIPROCAL_K_CHUNK, reciprocal_dtype=jnp.float64)
classmethod
¶
Prepare reciprocal shifts once from supplied physical cutoffs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cell
|
Table[SystemId, HasCell[Periodic3D]]
|
System table with periodic cells. |
required |
alpha
|
Table[SystemId, Array]
|
Screening parameters in 1/Å. |
required |
cutoff
|
Table[SystemId, Array]
|
Real-space cutoffs in Å. |
required |
k_max
|
Table[SystemId, Array]
|
Reciprocal cutoffs in 1/Å. |
required |
reciprocal_particle_chunk_size
|
int | None
|
Maximum particles per response tile; defaults to 8192 on GPU and 1024 elsewhere. |
None
|
reciprocal_k_chunk_size
|
int
|
Maximum k-vectors per tile. |
_DEFAULT_RECIPROCAL_K_CHUNK
|
reciprocal_dtype
|
DTypeLike
|
Precision of structure-factor evaluations. |
float64
|
Returns:
| Type | Description |
|---|---|
EwaldParameters
|
Parameters with stored integer shifts and reciprocal cutoffs. |
Source code in src/kups/potential/classical/ewald/parameters.py
make(charges, cell, epsilon_total=1e-08, real_cutoff=None, *, reciprocal_particle_chunk_size=None, reciprocal_k_chunk_size=_DEFAULT_RECIPROCAL_K_CHUNK, reciprocal_dtype=jnp.float64)
classmethod
¶
Estimate each system's parameters and prepare its reciprocal shifts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
charges
|
Table[ParticleId, IsEwaldPointData]
|
Particle table with charges and system assignments. |
required |
cell
|
Table[SystemId, HasCell[Periodic3D]]
|
System table with periodic cells. |
required |
epsilon_total
|
float
|
Target combined real-space and reciprocal-space error. |
1e-08
|
real_cutoff
|
float | None
|
Optional fixed real-space cutoff in Å. |
None
|
reciprocal_particle_chunk_size
|
int | None
|
Maximum particles per response tile; defaults to 8192 on GPU and 1024 elsewhere. |
None
|
reciprocal_k_chunk_size
|
int
|
Maximum explicit k-vectors per tile; also sets the grid workspace budget. |
_DEFAULT_RECIPROCAL_K_CHUNK
|
reciprocal_dtype
|
DTypeLike
|
Precision of structure-factor evaluations. |
float64
|
Returns:
| Type | Description |
|---|---|
EwaldParameters
|
Ewald parameters with stored integer shifts and reciprocal cutoffs. |
Source code in src/kups/potential/classical/ewald/parameters.py
GlobalTailCorrectedLennardJonesParameters
¶
Bases: LennardJonesParameters
Lennard-Jones parameters with analytical long-range correction.
Attributes:
| Name | Type | Description |
|---|---|---|
tail_corrected |
Array
|
Enable correction per species pair, shape |
Source code in src/kups/potential/classical/lennard_jones.py
tail_coefficients
property
¶
Two cutoff-independent coefficient matrices over species pairs.
tail_weights
property
¶
Current pair weights, shaped (2, n_systems, n_species, n_species).
from_dict(cutoff, parameters, mixing_rule, tail_correction=True)
classmethod
¶
Create tail-corrected parameters from a dict of per-species values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cutoff
|
float | Array
|
Cutoff radius [Angstrom]. |
required |
parameters
|
dict[str, tuple[float | None, float | None]]
|
Map from species label to |
required |
mixing_rule
|
MixingRule
|
Combining rule for cross-species interactions. |
required |
tail_correction
|
bool
|
Whether to enable tail corrections for all non-zero epsilon pairs. |
True
|
Source code in src/kups/potential/classical/lennard_jones.py
HarmonicAngleParameters
¶
Harmonic angle potential parameters.
Attributes:
| Name | Type | Description |
|---|---|---|
labels |
tuple[Label, ...]
|
Species labels, shape |
theta0 |
Array
|
Equilibrium angles [degrees], shape |
k |
Array
|
Force constants [energy/degree²], shape |
Source code in src/kups/potential/classical/harmonic.py
HarmonicBondParameters
¶
Harmonic bond potential parameters.
Attributes:
| Name | Type | Description |
|---|---|---|
labels |
tuple[Label, ...]
|
Species labels, shape |
x0 |
Array
|
Equilibrium bond lengths [Å], shape |
k |
Array
|
Force constants [energy/Ų], shape |
Source code in src/kups/potential/classical/harmonic.py
InversionParameters
¶
UFF-style inversion potential parameters.
Attributes:
| Name | Type | Description |
|---|---|---|
labels |
tuple[Label, ...]
|
Species labels, shape |
omega0 |
Array
|
Equilibrium out-of-plane angles [radians],
shape |
k |
Array
|
Force constant or barrier [energy],
shape |
Source code in src/kups/potential/classical/inversion.py
from_uff(labels, inversion_barrier, omega0=None)
classmethod
¶
Create inversion parameters using UFF formulas.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
labels
|
tuple[str, ...]
|
Species labels, shape |
required |
inversion_barrier
|
Array
|
Barrier/force constant for each type, shape |
required |
omega0
|
Array | None
|
Equilibrium angle [radians], shape |
None
|
Returns:
| Type | Description |
|---|---|
InversionParameters
|
InversionParameters with full interaction matrices |
Source code in src/kups/potential/classical/inversion.py
LennardJonesParameters
¶
Lennard-Jones potential parameters.
Attributes:
| Name | Type | Description |
|---|---|---|
labels |
tuple[Label, ...]
|
Species labels as |
sigma |
Array
|
Length scale parameters [Å], shape |
epsilon |
Array
|
Energy well depths [energy units], shape |
cutoff |
Table[SystemId, Array]
|
Cutoff radius [Å], shape |
Source code in src/kups/potential/classical/lennard_jones.py
from_dict(cutoff, parameters, mixing_rule)
classmethod
¶
Create parameters from a dict of per-species values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cutoff
|
float | Array
|
Cutoff radius [Angstrom]. |
required |
parameters
|
dict[str, tuple[float | None, float | None]]
|
Map from species label to |
required |
mixing_rule
|
MixingRule
|
Combining rule for cross-species interactions. |
required |
Source code in src/kups/potential/classical/lennard_jones.py
from_lorentz_berthelot_mixing(labels, sigma, epsilon, cutoff)
classmethod
¶
Create parameters using Lorentz-Berthelot mixing rules.
- σᵢⱼ = (σᵢ + σⱼ) / 2 (arithmetic mean)
- εᵢⱼ = √(εᵢ × εⱼ) (geometric mean)
Source code in src/kups/potential/classical/lennard_jones.py
MorseBondParameters
¶
Morse bond potential parameters.
Attributes:
| Name | Type | Description |
|---|---|---|
labels |
tuple[Label, ...]
|
Species labels, shape |
r0 |
Array
|
Equilibrium bond lengths [Å], shape |
D |
Array
|
Bond dissociation energy (well depth), shape |
alpha |
Array
|
Width parameter [Å⁻¹], shape |
Source code in src/kups/potential/classical/morse.py
from_harmonic(labels, r0, k, D)
classmethod
¶
Create Morse parameters from harmonic force constant.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
labels
|
tuple[str, ...]
|
Species labels, shape |
required |
r0
|
Array
|
Equilibrium bond lengths [Å], shape |
required |
k
|
Array
|
Harmonic force constants [energy/Ų], shape |
required |
D
|
Array
|
Bond dissociation energies, shape |
required |
Returns:
| Type | Description |
|---|---|
MorseBondParameters
|
MorseBondParameters with computed alpha values |
Source code in src/kups/potential/classical/morse.py
from_uff(labels, bond_radius, electronegativity, effective_charge, dissociation_energy)
classmethod
¶
Create Morse parameters using UFF bond length/force constant formulas.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
labels
|
tuple[str, ...]
|
Species labels, shape |
required |
bond_radius
|
Array
|
Valence bond radii [Å], shape |
required |
electronegativity
|
Array
|
GMP electronegativity, shape |
required |
effective_charge
|
Array
|
Effective atomic charge Z*, shape |
required |
dissociation_energy
|
Array
|
Bond dissociation energy D, shape |
required |
Returns:
| Type | Description |
|---|---|
MorseBondParameters
|
MorseBondParameters with full interaction matrices |
Source code in src/kups/potential/classical/morse.py
PairTailCorrectedLennardJonesParameters
¶
Bases: LennardJonesParameters
Lennard-Jones parameters with smooth pairwise tail correction.
Attributes:
| Name | Type | Description |
|---|---|---|
truncation_radius |
Table[SystemId, Array]
|
Radius where smoothing begins [Å], shape |
Source code in src/kups/potential/classical/lennard_jones.py
cosine_angle_energy(inp)
¶
Compute UFF-style cosine angle energy for all angles.
Calculates energy using the general cosine form:
For near-linear angles (\(\theta_0\) close to 180deg), uses:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inp
|
CosineAngleInput
|
Graph potential input with cosine angle parameters |
required |
Returns:
| Type | Description |
|---|---|
WithPatch[Table[SystemId, Energy], IdPatch[Any]]
|
Total angle energy per system |
Source code in src/kups/potential/classical/cosine_angle.py
inversion_energy(inp)
¶
Compute UFF-style inversion energy for all inversion centers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inp
|
InversionInput
|
Graph potential input with inversion parameters |
required |
Returns:
| Type | Description |
|---|---|
WithPatch[Table[SystemId, Energy], IdPatch[Any]]
|
Total inversion energy per system |
Source code in src/kups/potential/classical/inversion.py
make_cosine_angle_potential(particles_view, edge_indices_view, systems_view, parameter_view, probe, gradient_lens, hessian_lens, hessian_idx_view, patch_idx_view=None, out_cache_lens=None)
¶
Create UFF-style cosine angle potential for explicitly defined angles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particles_view
|
View[State, Table[ParticleId, IsBondedParticles]]
|
Extracts particle data (positions, species) with system index |
required |
edge_indices_view
|
View[State, Index[ParticleId]]
|
Extracts angle connectivity (triplets) |
required |
systems_view
|
View[State, Table[SystemId, HasCell[AnyPeriodicity]]]
|
Extracts indexed system data (cell) |
required |
parameter_view
|
View[State, CosineAngleParameters]
|
Extracts CosineAngleParameters |
required |
probe
|
Probe[State, Ptch, IsGraphProbe[IsBondedParticles, Literal[3]]] | None
|
Graph probe for incremental particle and neighbor-list updates |
required |
gradient_lens
|
Lens[CosineAngleInput, Gradients]
|
Specifies gradients to compute |
required |
hessian_lens
|
Lens[Gradients, Hessians]
|
Specifies Hessians to compute |
required |
hessian_idx_view
|
View[State, Hessians]
|
Hessian index structure |
required |
patch_idx_view
|
View[State, PotentialOut[Gradients, Hessians]] | None
|
Cached output index structure |
None
|
out_cache_lens
|
Lens[State, KahanSummand[PotentialOut[Gradients, Hessians]]] | None
|
Cache location lens |
None
|
Returns:
| Type | Description |
|---|---|
Potential[State, Gradients, Hessians, Ptch]
|
Cosine angle Potential |
Source code in src/kups/potential/classical/cosine_angle.py
make_dihedral_potential(particles_view, edge_indices_view, systems_view, parameter_view, probe, gradient_lens, hessian_lens, hessian_idx_view, patch_idx_view=None, out_cache_lens=None)
¶
Create UFF dihedral potential for explicitly defined dihedrals.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particles_view
|
View[State, Table[ParticleId, IsBondedParticles]]
|
Extracts particle data (positions, species) with system index |
required |
edge_indices_view
|
View[State, Index[ParticleId]]
|
Extracts dihedral connectivity (quadruplets) |
required |
systems_view
|
View[State, Table[SystemId, HasCell[AnyPeriodicity]]]
|
Extracts indexed system data (cell) |
required |
parameter_view
|
View[State, DihedralParameters]
|
Extracts DihedralParameters |
required |
probe
|
Probe[State, Ptch, IsGraphProbe[IsBondedParticles, Literal[4]]] | None
|
Graph probe for incremental particle and neighbor-list updates |
required |
gradient_lens
|
Lens[DihedralInput, Gradients]
|
Specifies gradients to compute |
required |
hessian_lens
|
Lens[Gradients, Hessians]
|
Specifies Hessians to compute |
required |
hessian_idx_view
|
View[State, Hessians]
|
Hessian index structure |
required |
patch_idx_view
|
View[State, PotentialOut[Gradients, Hessians]] | None
|
Cached output index structure |
None
|
out_cache_lens
|
Lens[State, KahanSummand[PotentialOut[Gradients, Hessians]]] | None
|
Cache location lens |
None
|
Returns:
| Type | Description |
|---|---|
Potential[State, Gradients, Hessians, Ptch]
|
UFF dihedral Potential |
Source code in src/kups/potential/classical/dihedral.py
make_ewald_potential(particles_view, systems_view, neighborlist_view, parameter_lens, cache_lens, probe, gradient_lens, hessian_lens, hessian_idx_view, patch_idx_view=None, include_exclusion_mask=False, *, composition=None)
¶
Combine real-space, reciprocal-space and self-interaction energies.
Compute all same-system interactions before subtracting optional molecular exclusions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particles_view
|
View[State, Table[ParticleId, IsEwaldPointData]]
|
View of particles with charges and inclusion/exclusion groups. |
required |
systems_view
|
View[State, Table[SystemId, HasCell[Periodic3D]]]
|
View of the system table and periodic cells. |
required |
neighborlist_view
|
View[State, NeighborList[Literal[2]]]
|
View of the real-space pair neighbor list. |
required |
parameter_lens
|
Lens[State, EwaldParameters]
|
Lens to Ewald parameters. |
required |
cache_lens
|
Lens[State, EwaldCache[Gradients, Hessians]] | None
|
Optional lens to structure-factor and component-output caches. |
required |
probe
|
Probe[State, Ptch, IsParticleProbe[IsEwaldPointData]] | None
|
Optional probe returning changed particles. |
required |
gradient_lens
|
Lens[PointCloud[IsEwaldPointData, HasCell[Periodic3D]], Gradients]
|
Lens selecting point-cloud variables to differentiate. |
required |
hessian_lens
|
Lens[Gradients, Hessians]
|
Lens selecting gradient entries to differentiate again. |
required |
hessian_idx_view
|
View[State, Hessians]
|
View supplying Hessian row and column indices. |
required |
patch_idx_view
|
View[State, PotentialOut[Gradients, Hessians]] | None
|
Optional view supplying indices for output-cache updates. |
None
|
include_exclusion_mask
|
bool
|
Whether to subtract molecular-exclusion pair energies. |
False
|
composition
|
RigidBodyComposition[State, IsChargedTemplate] | None
|
Optional rigid-body input fixing cells and parameters for energy-only evaluation. Large templates retain geometric exclusions. |
None
|
Returns:
| Type | Description |
|---|---|
EwaldPotential[State, Gradients, Hessians, Ptch]
|
Combined Ewald potential with four components, or five with exclusions. |
Source code in src/kups/potential/classical/ewald/potential.py
1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 | |
make_global_lennard_jones_tail_correction_potential(particles_view, systems_view, parameter_view, gradient_lens, hessian_lens, hessian_idx_view, patch_idx_view=None, out_cache_lens=None, *, composition=None)
¶
Create the LJ tail correction, optionally prepared for rigid bodies.
composition projects the same tail formula onto rigid-body counts once
at construction. It requires fixed parameters and cells and no derivatives.
Source code in src/kups/potential/classical/lennard_jones.py
make_harmonic_angle_potential(particles_view, edge_indices_view, systems_view, parameter_view, probe, gradient_lens, hessian_lens, hessian_idx_view, patch_idx_view=None, out_cache_lens=None)
¶
Create harmonic angle potential for explicitly defined angles.
Applies harmonic restraints to specified atom triplets (angles). Angles must be explicitly provided via the input_view edge set as triplets (i-j-k).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particles_view
|
View[State, Table[ParticleId, IsBondedParticles]]
|
Extracts particle data (positions, species) with system index |
required |
edge_indices_view
|
View[State, Index[ParticleId]]
|
Extracts angle connectivity (triplets) |
required |
systems_view
|
View[State, Table[SystemId, HasCell[AnyPeriodicity]]]
|
Extracts indexed system data (cell) |
required |
parameter_view
|
View[State, HarmonicAngleParameters]
|
Extracts HarmonicAngleParameters |
required |
probe
|
Probe[State, P, IsGraphProbe[IsBondedParticles, Literal[3]]] | None
|
Graph probe for incremental particle and neighbor-list updates |
required |
gradient_lens
|
Lens[HarmonicAngleInput, Gradients]
|
Specifies gradients to compute |
required |
hessian_lens
|
Lens[Gradients, Hessians]
|
Specifies Hessians to compute |
required |
hessian_idx_view
|
View[State, Hessians]
|
Hessian index structure |
required |
patch_idx_view
|
View[State, PotentialOut[Gradients, Hessians]] | None
|
Cached output index structure |
None
|
out_cache_lens
|
Lens[State, KahanSummand[PotentialOut[Gradients, Hessians]]] | None
|
Cache location lens |
None
|
Returns:
| Type | Description |
|---|---|
Potential[State, Gradients, Hessians, P]
|
Harmonic angle Potential |
Source code in src/kups/potential/classical/harmonic.py
make_harmonic_bond_potential(particles_view, edge_indices_view, systems_view, parameter_view, probe, gradient_lens, hessian_lens, hessian_idx_view, patch_idx_view=None, out_cache_lens=None)
¶
Create harmonic bond potential for explicitly defined bonds.
Applies harmonic restraints to specified atom pairs (bonds). Bonds must be explicitly provided via the input_view edge set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particles_view
|
View[State, Table[ParticleId, IsBondedParticles]]
|
Extracts particle data (positions, species) with system index |
required |
edge_indices_view
|
View[State, Index[ParticleId]]
|
Extracts bond connectivity |
required |
systems_view
|
View[State, Table[SystemId, HasCell[AnyPeriodicity]]]
|
Extracts indexed system data (cell) |
required |
parameter_view
|
View[State, HarmonicBondParameters]
|
Extracts HarmonicBondParameters |
required |
probe
|
Probe[State, P, IsGraphProbe[IsBondedParticles, Literal[2]]] | None
|
Graph probe for incremental particle and neighbor-list updates |
required |
gradient_lens
|
Lens[HarmonicBondInput, Gradients]
|
Specifies gradients to compute |
required |
hessian_lens
|
Lens[Gradients, Hessians]
|
Specifies Hessians to compute |
required |
hessian_idx_view
|
View[State, Hessians]
|
Hessian index structure |
required |
patch_idx_view
|
View[State, PotentialOut[Gradients, Hessians]] | None
|
Cached output index structure |
None
|
out_cache_lens
|
Lens[State, KahanSummand[PotentialOut[Gradients, Hessians]]] | None
|
Cache location lens |
None
|
Returns:
| Type | Description |
|---|---|
Potential[State, Gradients, Hessians, P]
|
Harmonic bond Potential |
Source code in src/kups/potential/classical/harmonic.py
make_inversion_potential(particles_view, edge_indices_view, systems_view, parameter_view, probe, gradient_lens, hessian_lens, hessian_idx_view, patch_idx_view=None, out_cache_lens=None)
¶
Create UFF-style inversion potential for sp2/sp3 centers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particles_view
|
View[State, Table[ParticleId, IsBondedParticles]]
|
Extracts particle data (positions, species) with system index |
required |
edge_indices_view
|
View[State, Index[ParticleId]]
|
Extracts inversion connectivity (4-tuples: center + 3 neighbors) |
required |
systems_view
|
View[State, Table[SystemId, HasCell[AnyPeriodicity]]]
|
Extracts indexed system data (cell) |
required |
parameter_view
|
View[State, InversionParameters]
|
Extracts InversionParameters |
required |
probe
|
Probe[State, Ptch, IsGraphProbe[IsBondedParticles, Literal[4]]] | None
|
Graph probe for incremental particle and neighbor-list updates |
required |
gradient_lens
|
Lens[InversionInput, Gradients]
|
Specifies gradients to compute |
required |
hessian_lens
|
Lens[Gradients, Hessians]
|
Specifies Hessians to compute |
required |
hessian_idx_view
|
View[State, Hessians]
|
Hessian index structure |
required |
patch_idx_view
|
View[State, PotentialOut[Gradients, Hessians]] | None
|
Cached output index structure |
None
|
out_cache_lens
|
Lens[State, KahanSummand[PotentialOut[Gradients, Hessians]]] | None
|
Cache location lens |
None
|
Returns:
| Type | Description |
|---|---|
Potential[State, Gradients, Hessians, Ptch]
|
Inversion Potential |
Source code in src/kups/potential/classical/inversion.py
make_lennard_jones_potential(particles_view, systems_view, neighborlist_view, parameter_view, probe, gradient_lens, hessian_lens, hessian_idx_view, patch_idx_view=None, out_cache_lens=None)
¶
Create a standard Lennard-Jones potential with sharp cutoff.
Source code in src/kups/potential/classical/lennard_jones.py
make_morse_bond_potential(particles_view, edge_indices_view, systems_view, parameter_view, probe, gradient_lens, hessian_lens, hessian_idx_view, patch_idx_view=None, out_cache_lens=None)
¶
Create Morse bond potential for explicitly defined bonds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particles_view
|
View[State, Table[ParticleId, IsBondedParticles]]
|
Extracts particle data (positions, species) with system index |
required |
edge_indices_view
|
View[State, Index[ParticleId]]
|
Extracts bond connectivity |
required |
systems_view
|
View[State, Table[SystemId, HasCell[AnyPeriodicity]]]
|
Extracts indexed system data (cell) |
required |
parameter_view
|
View[State, MorseBondParameters]
|
Extracts MorseBondParameters |
required |
probe
|
Probe[State, P, IsGraphProbe[IsBondedParticles, Literal[2]]] | None
|
Graph probe for incremental particle and neighbor-list updates |
required |
gradient_lens
|
Lens[MorseBondInput, Gradients]
|
Specifies gradients to compute |
required |
hessian_lens
|
Lens[Gradients, Hessians]
|
Specifies Hessians to compute |
required |
hessian_idx_view
|
View[State, Hessians]
|
Hessian index structure |
required |
patch_idx_view
|
View[State, PotentialOut[Gradients, Hessians]] | None
|
Cached output index structure |
None
|
out_cache_lens
|
Lens[State, KahanSummand[PotentialOut[Gradients, Hessians]]] | None
|
Cache location lens |
None
|
Returns:
| Type | Description |
|---|---|
Potential[State, Gradients, Hessians, P]
|
Morse bond Potential |
Source code in src/kups/potential/classical/morse.py
make_pair_tail_corrected_lennard_jones_potential(particles_view, systems_view, neighborlist_view, parameter_view, probe, gradient_lens, hessian_lens, hessian_idx_view, patch_idx_view=None, out_cache_lens=None)
¶
Create a Lennard-Jones potential with smooth pairwise tail correction.