kups.core.neighborlist.edges
¶
Edge representations for molecular systems.
An Edges value encodes the
connectivity produced by a neighbor list (or built explicitly for bonded
terms). It is generic in its Degree so the same dataclass represents
pairs (Degree=2), angles (Degree=3), dihedrals (Degree=4), etc.
Edges
¶
Bases: Sliceable
Represents edges (connections) between particles in a molecular system.
An edge connects Degree particles, where degree=2 represents pairwise
interactions (bonds), degree=3 represents three-body interactions (angles), etc.
For periodic systems, edges include shift vectors that indicate how many cells to traverse when computing distances between connected particles.
Class Type Parameters:
| Name | Bound or Constraints | Description | Default |
|---|---|---|---|
Degree
|
int
|
Number of particles connected by each edge (static type check) |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
indices |
Index[ParticleId]
|
Particle indices for each edge, shape |
shifts |
Array
|
Periodic shift vectors, shape |
Example
Source code in src/kups/core/neighborlist/edges.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 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 | |
absolute_shifts(particles, systems)
¶
Compute absolute shift vectors for all particles in each edge.
Converts relative shifts to absolute Cartesian shift vectors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particles
|
Table[ParticleId, HasPositionsAndSystemIndex]
|
Particle data with system index information. |
required |
systems
|
Table[SystemId, HasCell]
|
System data with cell for periodic boundary conditions. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Array of shape |
Source code in src/kups/core/neighborlist/edges.py
difference_vectors(particles, systems)
¶
Compute difference vectors between connected particles.
For each edge, computes the vector from the first particle to each subsequent particle, accounting for periodic boundary conditions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particles
|
Table[ParticleId, HasPositionsAndSystemIndex]
|
Particle positions with system index information. |
required |
systems
|
Table[SystemId, HasCell]
|
System data with cell for periodic boundary conditions. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Array of shape |