space_group_table
Space group multiplication table for algebraic symmetry operations.
This module provides the SpaceGroupTable class which precomputes the Cayley table (multiplication table) of a space group. This enables purely algebraic dimer equivalence determination without numerical tolerances.
SpaceGroupTable
dataclass
Precomputed group algebra (Cayley table) for a space group.
This class stores the multiplication table and inverse table for a space group, enabling efficient algebraic operations on symmetry-related objects without numerical tolerance comparisons.
Attributes:
| Name | Type | Description |
|---|---|---|
n_ops |
int
|
Number of symmetry operations in the group |
mult_table |
ndarray
|
(n_ops, n_ops) int array where mult_table[i, j] = k means g_k = g_j ∘ g_i (composition: apply g_i first, then g_j) |
inverse_table |
ndarray
|
(n_ops,) int array where inverse_table[i] = j means g_j = g_i^{-1} |
rotations |
ndarray
|
(n_ops, 3, 3) rotation matrices for each symop |
translations |
ndarray
|
(n_ops, 3) translation vectors for each symop |
symop_to_idx |
dict[int, int]
|
Dict mapping symop integer_code to index in the table |
idx_to_symop |
ndarray
|
(n_ops,) symop integer codes for each index |
Source code in chmpy/crystal/space_group_table.py
23 24 25 26 27 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 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 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | |
compose(i, j)
Return the index of the composition g_j ∘ g_i.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
i
|
int
|
Index of first symop (applied first) |
required |
j
|
int
|
Index of second symop (applied second) |
required |
Returns:
| Type | Description |
|---|---|
int
|
Index k such that g_k = g_j ∘ g_i |
Source code in chmpy/crystal/space_group_table.py
from_space_group(sg)
classmethod
Build a SpaceGroupTable from a SpaceGroup.
This constructs the complete Cayley table by composing all pairs of symmetry operations and finding their result in the group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sg
|
SpaceGroup
|
The space group to build the table from |
required |
Returns:
| Type | Description |
|---|---|
SpaceGroupTable
|
SpaceGroupTable with precomputed multiplication and inverse tables |
Source code in chmpy/crystal/space_group_table.py
identity_idx()
inv(i)
Return the index of the inverse of g_i.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
i
|
int
|
Index of symop |
required |
Returns:
| Type | Description |
|---|---|
int
|
Index j such that g_j = g_i^{-1} |
verify_group_axioms()
Verify that the multiplication table satisfies group axioms.
Returns:
| Type | Description |
|---|---|
dict[str, bool]
|
Dictionary with verification results: |
dict[str, bool]
|
|
dict[str, bool]
|
|
dict[str, bool]
|
|
dict[str, bool]
|
|
Source code in chmpy/crystal/space_group_table.py
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 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | |