kups.potential.classical.dihedral
¶
Dihedral/torsion potential as defined in UFF.
Reference: Rappe et al. (1992) "UFF, a Full Periodic Table Force Field" J. Am. Chem. Soc. 114, 10024-10035. DOI: 10.1021/ja00051a040
Functional form:
where:
- \(\phi\) is the dihedral angle (angle between planes i-j-k and j-k-l)
- \(V_\phi\) is the barrier height
- \(n\) is the periodicity (typically 1, 2, 3, or 6)
- \(\phi_0\) is the equilibrium dihedral angle
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
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 202 203 204 205 206 | |
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
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 202 203 204 205 206 | |
IsBondedParticles
¶
Bases: HasPositionsAndLabels, HasSystemIndex, Protocol
Particle data with positions, labels, and system index.
Source code in src/kups/potential/classical/dihedral.py
IsDihedralState
¶
Bases: Protocol
Protocol for states providing all inputs for the dihedral potential.
Source code in src/kups/potential/classical/dihedral.py
dihedral_energy(inp)
¶
Compute UFF dihedral/torsion energy for all dihedrals.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inp
|
DihedralInput
|
Graph potential input with dihedral parameters |
required |
Returns:
| Type | Description |
|---|---|
WithPatch[Table[SystemId, Energy], IdPatch]
|
Total dihedral energy per system |
Source code in src/kups/potential/classical/dihedral.py
make_dihedral_from_state(state, probe=None, *, compute_position_and_unitcell_gradients=False)
¶
make_dihedral_from_state(
state: Lens[
State,
IsDihedralState[
MaybeCached[DihedralParameters, Any]
],
],
probe: None = None,
*,
compute_position_and_unitcell_gradients: Literal[
False
] = ...,
) -> Potential[State, EmptyType, EmptyType, Patch]
make_dihedral_from_state(
state: Lens[
State,
IsDihedralState[
MaybeCached[DihedralParameters, Any]
],
],
probe: None = None,
*,
compute_position_and_unitcell_gradients: Literal[True],
) -> Potential[
State, PositionAndUnitCell, EmptyType, Patch
]
make_dihedral_from_state(
state: Lens[
State,
IsDihedralState[
HasCache[
DihedralParameters,
PotentialOut[EmptyType, EmptyType],
]
],
],
probe: Probe[
State,
P,
IsEdgeSetGraphProbe[IsBondedParticles, Literal[4]],
],
*,
compute_position_and_unitcell_gradients: Literal[
False
] = ...,
) -> Potential[State, EmptyType, EmptyType, P]
make_dihedral_from_state(
state: Lens[
State,
IsDihedralState[
HasCache[
DihedralParameters,
PotentialOut[
PositionAndUnitCell, EmptyType
],
]
],
],
probe: Probe[
State,
P,
IsEdgeSetGraphProbe[IsBondedParticles, Literal[4]],
],
*,
compute_position_and_unitcell_gradients: Literal[True],
) -> Potential[State, PositionAndUnitCell, EmptyType, P]
Create a dihedral potential from a typed state, optionally with incremental updates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
Any
|
Lens into the sub-state providing particles, unit cell, edges, and dihedral parameters. |
required |
probe
|
Any
|
Detects which particles and edges changed since the last step. If None, no incremental updates are used. |
None
|
compute_position_and_unitcell_gradients
|
bool
|
When True, computes gradients w.r.t. particle positions and lattice vectors. |
False
|
Returns:
| Type | Description |
|---|---|
Any
|
Configured dihedral Potential. |
Source code in src/kups/potential/classical/dihedral.py
make_dihedral_potential(particles_view, edges_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 |
edges_view
|
View[State, Edges[Literal[4]]]
|
Extracts dihedral connectivity (quadruplets) |
required |
systems_view
|
View[State, Table[SystemId, HasUnitCell]]
|
Extracts indexed system data (unit cell) |
required |
parameter_view
|
View[State, DihedralParameters]
|
Extracts DihedralParameters |
required |
probe
|
Probe[State, Ptch, IsEdgeSetGraphProbe[IsBondedParticles, Literal[4]]] | None
|
Grouped probe for incremental updates (particles, edges, capacity) |
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, PotentialOut[Gradients, Hessians]] | None
|
Cache location lens |
None
|
Returns:
| Type | Description |
|---|---|
Potential[State, Gradients, Hessians, Ptch]
|
UFF dihedral Potential |