symcrys 0.10.1 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/README.md +6 -6
  2. package/dist/cell.d.ts +19 -16
  3. package/dist/cell.d.ts.map +1 -1
  4. package/dist/cell.js +63 -35
  5. package/dist/cell.js.map +1 -1
  6. package/dist/checks.d.ts +29 -0
  7. package/dist/checks.d.ts.map +1 -0
  8. package/dist/checks.js +79 -0
  9. package/dist/checks.js.map +1 -0
  10. package/dist/closure.d.ts +43 -0
  11. package/dist/closure.d.ts.map +1 -0
  12. package/dist/closure.js +201 -0
  13. package/dist/closure.js.map +1 -0
  14. package/dist/coordinates.d.ts +143 -0
  15. package/dist/coordinates.d.ts.map +1 -0
  16. package/dist/coordinates.js +198 -0
  17. package/dist/coordinates.js.map +1 -0
  18. package/dist/crystalClasses.d.ts +170 -117
  19. package/dist/crystalClasses.d.ts.map +1 -1
  20. package/dist/crystalClasses.js +190 -121
  21. package/dist/crystalClasses.js.map +1 -1
  22. package/dist/freeze.d.ts +7 -0
  23. package/dist/freeze.d.ts.map +1 -0
  24. package/dist/freeze.js +15 -0
  25. package/dist/freeze.js.map +1 -0
  26. package/dist/index.d.ts +13 -10
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +5 -3
  29. package/dist/index.js.map +1 -1
  30. package/dist/indices.d.ts +30 -20
  31. package/dist/indices.d.ts.map +1 -1
  32. package/dist/indices.js +101 -31
  33. package/dist/indices.js.map +1 -1
  34. package/dist/lattice.d.ts +15 -1
  35. package/dist/lattice.d.ts.map +1 -1
  36. package/dist/lattice.js +30 -1
  37. package/dist/lattice.js.map +1 -1
  38. package/dist/linalg.d.ts +2 -2
  39. package/dist/linalg.d.ts.map +1 -1
  40. package/dist/linalg.js +3 -3
  41. package/dist/linalg.js.map +1 -1
  42. package/dist/magnetic.d.ts +14 -10
  43. package/dist/magnetic.d.ts.map +1 -1
  44. package/dist/magnetic.js +10 -6
  45. package/dist/magnetic.js.map +1 -1
  46. package/dist/notation.d.ts +16 -0
  47. package/dist/notation.d.ts.map +1 -0
  48. package/dist/notation.js +66 -0
  49. package/dist/notation.js.map +1 -0
  50. package/dist/operations.d.ts +40 -26
  51. package/dist/operations.d.ts.map +1 -1
  52. package/dist/operations.js +48 -60
  53. package/dist/operations.js.map +1 -1
  54. package/dist/plane.d.ts +297 -80
  55. package/dist/plane.d.ts.map +1 -1
  56. package/dist/plane.js +289 -94
  57. package/dist/plane.js.map +1 -1
  58. package/dist/pointGroups/crystalForms.d.ts +6 -21
  59. package/dist/pointGroups/crystalForms.d.ts.map +1 -1
  60. package/dist/pointGroups/crystalForms.js +9 -16
  61. package/dist/pointGroups/crystalForms.js.map +1 -1
  62. package/dist/pointGroups/crystalFormsData.d.ts +4 -1
  63. package/dist/pointGroups/crystalFormsData.d.ts.map +1 -1
  64. package/dist/pointGroups/crystalFormsData.js +64 -1
  65. package/dist/pointGroups/crystalFormsData.js.map +1 -1
  66. package/dist/pointGroups/elements.d.ts +19 -17
  67. package/dist/pointGroups/elements.d.ts.map +1 -1
  68. package/dist/pointGroups/elements.js +65 -83
  69. package/dist/pointGroups/elements.js.map +1 -1
  70. package/dist/pointGroups/identify.d.ts +10 -18
  71. package/dist/pointGroups/identify.d.ts.map +1 -1
  72. package/dist/pointGroups/identify.js +27 -79
  73. package/dist/pointGroups/identify.js.map +1 -1
  74. package/dist/pointGroups/itaOrder.d.ts +15 -14
  75. package/dist/pointGroups/itaOrder.d.ts.map +1 -1
  76. package/dist/pointGroups/itaOrder.js +116 -94
  77. package/dist/pointGroups/itaOrder.js.map +1 -1
  78. package/dist/pointGroups/itcData.d.ts +96 -0
  79. package/dist/pointGroups/itcData.d.ts.map +1 -0
  80. package/dist/pointGroups/itcData.js +336 -0
  81. package/dist/pointGroups/itcData.js.map +1 -0
  82. package/dist/pointGroups/itcMagneticData.d.ts +55 -0
  83. package/dist/pointGroups/itcMagneticData.d.ts.map +1 -0
  84. package/dist/pointGroups/itcMagneticData.js +172 -0
  85. package/dist/pointGroups/itcMagneticData.js.map +1 -0
  86. package/dist/pointGroups/keys.d.ts +32 -0
  87. package/dist/pointGroups/keys.d.ts.map +1 -0
  88. package/dist/pointGroups/keys.js +120 -0
  89. package/dist/pointGroups/keys.js.map +1 -0
  90. package/dist/pointGroups/magneticSymbols.d.ts +6 -5
  91. package/dist/pointGroups/magneticSymbols.d.ts.map +1 -1
  92. package/dist/pointGroups/magneticSymbols.js +15 -12
  93. package/dist/pointGroups/magneticSymbols.js.map +1 -1
  94. package/dist/pointGroups/orbits.d.ts +23 -42
  95. package/dist/pointGroups/orbits.d.ts.map +1 -1
  96. package/dist/pointGroups/orbits.js +20 -62
  97. package/dist/pointGroups/orbits.js.map +1 -1
  98. package/dist/pointGroups/pointGroups.d.ts +145 -68
  99. package/dist/pointGroups/pointGroups.d.ts.map +1 -1
  100. package/dist/pointGroups/pointGroups.js +455 -243
  101. package/dist/pointGroups/pointGroups.js.map +1 -1
  102. package/dist/pointGroups/properties.d.ts +21 -22
  103. package/dist/pointGroups/properties.d.ts.map +1 -1
  104. package/dist/pointGroups/properties.js +40 -37
  105. package/dist/pointGroups/properties.js.map +1 -1
  106. package/dist/pointGroups/seitzData.d.ts +26 -0
  107. package/dist/pointGroups/seitzData.d.ts.map +1 -0
  108. package/dist/pointGroups/seitzData.js +130 -0
  109. package/dist/pointGroups/seitzData.js.map +1 -0
  110. package/dist/pointGroups/shubnikovData.d.ts +11 -0
  111. package/dist/pointGroups/shubnikovData.d.ts.map +1 -0
  112. package/dist/pointGroups/shubnikovData.js +101 -0
  113. package/dist/pointGroups/shubnikovData.js.map +1 -0
  114. package/dist/pointGroups/wyckoff.d.ts +70 -40
  115. package/dist/pointGroups/wyckoff.d.ts.map +1 -1
  116. package/dist/pointGroups/wyckoff.js +98 -91
  117. package/dist/pointGroups/wyckoff.js.map +1 -1
  118. package/dist/pointGroups/wyckoffData.d.ts +7 -4
  119. package/dist/pointGroups/wyckoffData.d.ts.map +1 -1
  120. package/dist/pointGroups/wyckoffData.js +789 -168
  121. package/dist/pointGroups/wyckoffData.js.map +1 -1
  122. package/dist/siteSymmetry.d.ts +8 -16
  123. package/dist/siteSymmetry.d.ts.map +1 -1
  124. package/dist/siteSymmetry.js +34 -24
  125. package/dist/siteSymmetry.js.map +1 -1
  126. package/dist/spaceGroups/affine.d.ts.map +1 -1
  127. package/dist/spaceGroups/affine.js +3 -2
  128. package/dist/spaceGroups/affine.js.map +1 -1
  129. package/dist/spaceGroups/cell.d.ts +43 -31
  130. package/dist/spaceGroups/cell.d.ts.map +1 -1
  131. package/dist/spaceGroups/cell.js +173 -85
  132. package/dist/spaceGroups/cell.js.map +1 -1
  133. package/dist/spaceGroups/describe.d.ts +13 -10
  134. package/dist/spaceGroups/describe.d.ts.map +1 -1
  135. package/dist/spaceGroups/describe.js +11 -10
  136. package/dist/spaceGroups/describe.js.map +1 -1
  137. package/dist/spaceGroups/planeGroupData.d.ts +3 -1
  138. package/dist/spaceGroups/planeGroupData.d.ts.map +1 -1
  139. package/dist/spaceGroups/planeGroupData.js +25 -8
  140. package/dist/spaceGroups/planeGroupData.js.map +1 -1
  141. package/dist/spaceGroups/planeGroups.d.ts.map +1 -1
  142. package/dist/spaceGroups/planeGroups.js +2 -1
  143. package/dist/spaceGroups/planeGroups.js.map +1 -1
  144. package/dist/spaceGroups/planeLattice.d.ts +78 -0
  145. package/dist/spaceGroups/planeLattice.d.ts.map +1 -0
  146. package/dist/spaceGroups/planeLattice.js +143 -0
  147. package/dist/spaceGroups/planeLattice.js.map +1 -0
  148. package/dist/spaceGroups/planePointGroups.d.ts +6 -2
  149. package/dist/spaceGroups/planePointGroups.d.ts.map +1 -1
  150. package/dist/spaceGroups/planePointGroups.js +14 -2
  151. package/dist/spaceGroups/planePointGroups.js.map +1 -1
  152. package/dist/spaceGroups/positions.d.ts +48 -19
  153. package/dist/spaceGroups/positions.d.ts.map +1 -1
  154. package/dist/spaceGroups/positions.js +166 -67
  155. package/dist/spaceGroups/positions.js.map +1 -1
  156. package/dist/spaceGroups/rational.d.ts +18 -0
  157. package/dist/spaceGroups/rational.d.ts.map +1 -1
  158. package/dist/spaceGroups/rational.js +58 -0
  159. package/dist/spaceGroups/rational.js.map +1 -1
  160. package/dist/tensors/propertyTable.d.ts +3 -1
  161. package/dist/tensors/propertyTable.d.ts.map +1 -1
  162. package/dist/tensors/propertyTable.js +17 -10
  163. package/dist/tensors/propertyTable.js.map +1 -1
  164. package/dist/tensors/rowEchelon.d.ts +3 -3
  165. package/dist/tensors/rowEchelon.d.ts.map +1 -1
  166. package/dist/tensors/rowEchelon.js +4 -4
  167. package/dist/tensors/rowEchelon.js.map +1 -1
  168. package/dist/tensors/tensorForm.d.ts +75 -34
  169. package/dist/tensors/tensorForm.d.ts.map +1 -1
  170. package/dist/tensors/tensorForm.js +171 -67
  171. package/dist/tensors/tensorForm.js.map +1 -1
  172. package/dist/tensors/tensorProperties.d.ts +10 -9
  173. package/dist/tensors/tensorProperties.d.ts.map +1 -1
  174. package/dist/tensors/tensorProperties.js +22 -12
  175. package/dist/tensors/tensorProperties.js.map +1 -1
  176. package/dist/tensors/voigt.d.ts +56 -0
  177. package/dist/tensors/voigt.d.ts.map +1 -0
  178. package/dist/tensors/voigt.js +188 -0
  179. package/dist/tensors/voigt.js.map +1 -0
  180. package/dist/tolerances.d.ts +56 -1
  181. package/dist/tolerances.d.ts.map +1 -1
  182. package/dist/tolerances.js +51 -1
  183. package/dist/tolerances.js.map +1 -1
  184. package/dist/version.d.ts +1 -1
  185. package/dist/version.js +1 -1
  186. package/package.json +1 -1
  187. package/src/cell.ts +78 -51
  188. package/src/checks.ts +84 -0
  189. package/src/closure.ts +214 -0
  190. package/src/coordinates.ts +370 -0
  191. package/src/crystalClasses.ts +271 -157
  192. package/src/freeze.ts +14 -0
  193. package/src/index.ts +33 -12
  194. package/src/indices.ts +102 -42
  195. package/src/lattice.ts +41 -1
  196. package/src/linalg.ts +3 -3
  197. package/src/magnetic.ts +24 -11
  198. package/src/notation.ts +73 -0
  199. package/src/operations.ts +78 -71
  200. package/src/plane.ts +531 -151
  201. package/src/pointGroups/crystalForms.ts +11 -44
  202. package/src/pointGroups/crystalFormsData.ts +66 -1
  203. package/src/pointGroups/elements.ts +82 -92
  204. package/src/pointGroups/identify.ts +38 -97
  205. package/src/pointGroups/itaOrder.ts +117 -101
  206. package/src/pointGroups/itcData.ts +404 -0
  207. package/src/pointGroups/itcMagneticData.ts +206 -0
  208. package/src/pointGroups/keys.ts +144 -0
  209. package/src/pointGroups/magneticSymbols.ts +18 -17
  210. package/src/pointGroups/orbits.ts +41 -89
  211. package/src/pointGroups/pointGroups.ts +593 -298
  212. package/src/pointGroups/properties.ts +44 -40
  213. package/src/pointGroups/seitzData.ts +147 -0
  214. package/src/pointGroups/shubnikovData.ts +103 -0
  215. package/src/pointGroups/wyckoff.ts +137 -112
  216. package/src/pointGroups/wyckoffData.ts +793 -170
  217. package/src/siteSymmetry.ts +43 -40
  218. package/src/spaceGroups/affine.ts +3 -2
  219. package/src/spaceGroups/cell.ts +227 -116
  220. package/src/spaceGroups/describe.ts +23 -19
  221. package/src/spaceGroups/planeGroupData.ts +28 -9
  222. package/src/spaceGroups/planeGroups.ts +2 -1
  223. package/src/spaceGroups/planeLattice.ts +208 -0
  224. package/src/spaceGroups/planePointGroups.ts +23 -3
  225. package/src/spaceGroups/positions.ts +202 -78
  226. package/src/spaceGroups/rational.ts +59 -0
  227. package/src/tensors/propertyTable.ts +26 -14
  228. package/src/tensors/rowEchelon.ts +4 -3
  229. package/src/tensors/tensorForm.ts +258 -88
  230. package/src/tensors/tensorProperties.ts +34 -14
  231. package/src/tensors/voigt.ts +268 -0
  232. package/src/tolerances.ts +66 -1
  233. package/src/version.ts +1 -1
  234. package/dist/pointGroups/data.d.ts +0 -75
  235. package/dist/pointGroups/data.d.ts.map +0 -1
  236. package/dist/pointGroups/data.js +0 -212
  237. package/dist/pointGroups/data.js.map +0 -1
  238. package/dist/pointGroups/magneticData.d.ts +0 -66
  239. package/dist/pointGroups/magneticData.d.ts.map +0 -1
  240. package/dist/pointGroups/magneticData.js +0 -184
  241. package/dist/pointGroups/magneticData.js.map +0 -1
  242. package/dist/spaceGroups/snap.d.ts +0 -20
  243. package/dist/spaceGroups/snap.d.ts.map +0 -1
  244. package/dist/spaceGroups/snap.js +0 -103
  245. package/dist/spaceGroups/snap.js.map +0 -1
  246. package/src/pointGroups/data.ts +0 -305
  247. package/src/pointGroups/magneticData.ts +0 -328
  248. package/src/spaceGroups/snap.ts +0 -121
@@ -1,68 +1,72 @@
1
1
  /**
2
2
  * Properties that follow from operations, for a list of operations of a caller, and the holohedry
3
- * of a crystal system. The properties of a point group given by its key are fields of
3
+ * of a lattice system. The properties of a point group given by its key are fields of
4
4
  * `pointGroup(key)` (pointGroups.ts). Properties that are the question whether a tensor is allowed
5
5
  * (polar, piezoelectric, ferroaxial, ferromagnetic, …) are named tensor properties
6
6
  * (tensors/tensorProperties.ts).
7
7
  */
8
8
 
9
- import type { CrystalSystem } from '../lattice.js';
10
- import { INVERSION, det, matricesEqual } from '../linalg.js';
11
- import { checkOrthogonal, checkTimeReversal, closeGroup, type Operation } from '../operations.js';
12
- import type { PointGroupKey } from './data.js';
13
-
14
- /**
15
- * What every function for a list of operations asks of the list: Cartesian (orthogonal) matrices,
16
- * and of every operation whether it is combined with time reversal, as `tensorFormOf` does.
17
- */
18
- function check(operations: readonly Operation[]): void {
19
- operations.forEach((op, i) => checkOrthogonal(op.matrix, `Operation ${i}`));
20
- checkTimeReversal(operations);
21
- }
9
+ import { checkOptions, shown, TOLERANCE_KEYS } from '../checks.js';
10
+ import type { LatticeSystem } from '../lattice.js';
11
+ import { INVERSION, det } from '../linalg.js';
12
+ import { checkCartesianOperations, checkTimeReversal, type CartesianOperation } from '../operations.js';
13
+ import { closedGroup, sameWithin } from '../closure.js';
14
+ import { toleranceOf, type ToleranceOptions } from '../tolerances.js';
15
+ import type { PointGroupKey } from './keys.js';
22
16
 
23
17
  /**
24
18
  * True if the group generated by `operations` contains the inversion, not combined with time
25
- * reversal: e.g. for the operations of a distorted crystal. A list that is not closed is closed
26
- * first. For a point group given by its key, read `pointGroup(key).centrosymmetric`. Throws a
27
- * RangeError for a matrix that is not orthogonal and for an operation that does not say whether it
28
- * is combined with time reversal.
19
+ * reversal: e.g. for the operations of a distorted crystal. The list is closed into a group within
20
+ * the tolerance first, as `tensorFormOf` closes it, and the inversion is sought within the
21
+ * tolerance. For a point group given by its key, read `pointGroup(key).centrosymmetric`. Throws a
22
+ * RangeError as `tensorFormOf`.
29
23
  */
30
- export function isCentrosymmetricOf(operations: readonly Operation[]): boolean {
31
- check(operations);
32
- return closeGroup(operations).some((op) => !op.timeReversal && matricesEqual(op.matrix, INVERSION));
24
+ export function isCentrosymmetricOf(operations: readonly CartesianOperation[], options?: ToleranceOptions): boolean {
25
+ checkOptions(options, TOLERANCE_KEYS, 'isCentrosymmetricOf');
26
+ const tolerance = toleranceOf(options, 'operations');
27
+ checkCartesianOperations(operations, tolerance);
28
+ checkTimeReversal(operations);
29
+ const inversion: CartesianOperation = { cartesian: INVERSION, timeReversal: false };
30
+ return closedGroup(operations, tolerance).some((op) => sameWithin(op, inversion, tolerance));
33
31
  }
34
32
 
35
33
  /**
36
- * True if the group generated by `operations` is chiral: proper rotations only, with or without
37
- * time reversal (products of proper rotations are proper, so the list need not be closed). For a
38
- * point group given by its key, read `pointGroup(key).chiral`. Throws a RangeError for a matrix that
39
- * is not orthogonal and for an operation that does not say whether it is combined with time
40
- * reversal.
34
+ * True if the group generated by `operations` is enantiomorphic: proper rotations only, with or
35
+ * without time reversal (ITA § 3.2.2.1.3; products of proper rotations are proper, so the list need
36
+ * not be closed). For a point group given by its key, read `pointGroup(key).enantiomorphic`. Throws
37
+ * a RangeError for an operation without an orthogonal Cartesian matrix (`cartesian`; within the
38
+ * tolerance) and for an operation that does not say whether it is combined with time reversal.
41
39
  */
42
- export function isChiralOf(operations: readonly Operation[]): boolean {
43
- check(operations);
44
- return operations.every((op) => det(op.matrix) > 0);
40
+ export function isEnantiomorphicOf(operations: readonly CartesianOperation[], options?: ToleranceOptions): boolean {
41
+ checkOptions(options, TOLERANCE_KEYS, 'isEnantiomorphicOf');
42
+ checkCartesianOperations(operations, toleranceOf(options, 'operations'));
43
+ checkTimeReversal(operations);
44
+ return operations.every((op) => det(op.cartesian) > 0);
45
45
  }
46
46
 
47
- const HOLOHEDRY: Readonly<Record<CrystalSystem, PointGroupKey>> = Object.freeze({
47
+ const HOLOHEDRY: Readonly<Record<LatticeSystem, PointGroupKey>> = Object.freeze({
48
48
  triclinic: '-1',
49
49
  monoclinic: '2/m',
50
50
  orthorhombic: 'mmm',
51
51
  tetragonal: '4/mmm',
52
- trigonal: '-3m',
53
52
  hexagonal: '6/mmm',
53
+ rhombohedral: '-3m',
54
54
  cubic: 'm-3m',
55
55
  });
56
56
 
57
57
  /**
58
- * The holohedry of a crystal system: the crystal class that is the point symmetry of a lattice of
59
- * the system (ITA Table 2.1.1.1, the Laue groups in full boxes). For the trigonal system it is
60
- * `-3m`, the symmetry of the rhombohedral lattice. The trigonal classes also occur with the
61
- * hexagonal lattice, whose symmetry is `6/mmm`: the holohedry of the crystal family is
62
- * `holohedry(crystalFamily(system))`, which is what the lattice basis of this library
63
- * (`latticeBasis`, hexagonal axes for both systems) has.
58
+ * The holohedry of a lattice system, the point symmetry of its lattices (ITA Table 1.3.4.1, p. 39),
59
+ * e.g. `6/mmm` for the hexagonal and `-3m` for the rhombohedral lattice system. A trigonal crystal belongs to
60
+ * either lattice system, so `latticeSystems(key)` gives two for a trigonal class. Throws a RangeError
61
+ * for anything that is not one of the seven lattice systems, a crystal system `'trigonal'` included.
64
62
  */
65
- export function holohedry(system: CrystalSystem): PointGroupKey {
66
- if (!Object.hasOwn(HOLOHEDRY, system)) throw new RangeError(`Unknown crystal system: ${JSON.stringify(system)}`);
67
- return HOLOHEDRY[system];
63
+ export function holohedry(latticeSystem: LatticeSystem): PointGroupKey {
64
+ if (!Object.hasOwn(HOLOHEDRY, latticeSystem)) {
65
+ const hint =
66
+ latticeSystem === ('trigonal' as unknown)
67
+ ? "; a trigonal crystal has the lattice system 'hexagonal' or 'rhombohedral' (latticeSystems)"
68
+ : '';
69
+ throw new RangeError(`Unknown lattice system: ${shown(latticeSystem)}${hint}`);
70
+ }
71
+ return HOLOHEDRY[latticeSystem];
68
72
  }
@@ -0,0 +1,147 @@
1
+ /**
2
+ * The linear parts of ITA's Seitz symbols for the point operations (ITA 6th ed. 2016, § 1.4.2.2,
3
+ * Tables 1.4.2.1–1.4.2.3, p. 52; transcribed in references/itc/vol-a-2016-tables-1.4.2-seitz.md):
4
+ * for each matrix W, as its coordinate triplet, the characteristic direction of its Seitz symbol
5
+ * (the axis of a rotation or rotoinversion, the normal of a reflection) and the sense of a rotation
6
+ * of order 3 or more. The axis of an operation in `describeOperations` takes this direction, with
7
+ * its sign ("Pure ITC", #114; docs/conventions.md, "Symmetry directions and elements"). Table
8
+ * 1.4.2.1 serves the cubic, tetragonal, orthorhombic, monoclinic and triclinic systems, 1.4.2.2 the
9
+ * hexagonal family in hexagonal axes, 1.4.2.3 rhombohedral axes.
10
+ */
11
+
12
+ import { parseOperation } from '../spaceGroups/affine.js';
13
+ import type { IntMat3 } from './itaOrder.js';
14
+
15
+ /** A coordinate triplet, the direction [uvw] of its Seitz symbol (none for 1 and -1), its sense (n ≥ 3). */
16
+ type SeitzRow = readonly [string, readonly [number, number, number] | null, '+' | '-' | null];
17
+
18
+ /** ITA Table 1.4.2.1. No. 32 read with the overbar the type gives it (erratum in the transcription). */
19
+ const SEITZ_TABLE_1_4_2_1: readonly SeitzRow[] = [
20
+ ['x,y,z', null, null], // 1: 1
21
+ ['-x,-y,z', [0, 0, 1], null], // 2: 2_{001}
22
+ ['-x,y,-z', [0, 1, 0], null], // 3: 2_{010}
23
+ ['x,-y,-z', [1, 0, 0], null], // 4: 2_{100}
24
+ ['z,x,y', [1, 1, 1], '+'], // 5: 3^+_{111}
25
+ ['z,-x,-y', [-1, 1, -1], '+'], // 6: 3^+_{-11-1}
26
+ ['-z,-x,y', [1, -1, -1], '+'], // 7: 3^+_{1-1-1}
27
+ ['-z,x,-y', [-1, -1, 1], '+'], // 8: 3^+_{-1-11}
28
+ ['y,z,x', [1, 1, 1], '-'], // 9: 3^-_{111}
29
+ ['-y,z,-x', [1, -1, -1], '-'], // 10: 3^-_{1-1-1}
30
+ ['y,-z,-x', [-1, -1, 1], '-'], // 11: 3^-_{-1-11}
31
+ ['-y,-z,x', [-1, 1, -1], '-'], // 12: 3^-_{-11-1}
32
+ ['y,x,-z', [1, 1, 0], null], // 13: 2_{110}
33
+ ['-y,-x,-z', [1, -1, 0], null], // 14: 2_{1-10}
34
+ ['y,-x,z', [0, 0, 1], '-'], // 15: 4^-_{001}
35
+ ['-y,x,z', [0, 0, 1], '+'], // 16: 4^+_{001}
36
+ ['x,z,-y', [1, 0, 0], '-'], // 17: 4^-_{100}
37
+ ['-x,z,y', [0, 1, 1], null], // 18: 2_{011}
38
+ ['-x,-z,-y', [0, 1, -1], null], // 19: 2_{01-1}
39
+ ['x,-z,y', [1, 0, 0], '+'], // 20: 4^+_{100}
40
+ ['z,y,-x', [0, 1, 0], '+'], // 21: 4^+_{010}
41
+ ['z,-y,x', [1, 0, 1], null], // 22: 2_{101}
42
+ ['-z,y,x', [0, 1, 0], '-'], // 23: 4^-_{010}
43
+ ['-z,-y,-x', [-1, 0, 1], null], // 24: 2_{-101}
44
+ ['-x,-y,-z', null, null], // 25: -1
45
+ ['x,y,-z', [0, 0, 1], null], // 26: m_{001}
46
+ ['x,-y,z', [0, 1, 0], null], // 27: m_{010}
47
+ ['-x,y,z', [1, 0, 0], null], // 28: m_{100}
48
+ ['-z,-x,-y', [1, 1, 1], '+'], // 29: -3^+_{111}
49
+ ['-z,x,y', [-1, 1, -1], '+'], // 30: -3^+_{-11-1}
50
+ ['z,x,-y', [1, -1, -1], '+'], // 31: -3^+_{1-1-1}
51
+ ['z,-x,y', [-1, -1, 1], '+'], // 32: -3^+_{-1-11}
52
+ ['-y,-z,-x', [1, 1, 1], '-'], // 33: -3^-_{111}
53
+ ['y,-z,x', [1, -1, -1], '-'], // 34: -3^-_{1-1-1}
54
+ ['-y,z,x', [-1, -1, 1], '-'], // 35: -3^-_{-1-11}
55
+ ['y,z,-x', [-1, 1, -1], '-'], // 36: -3^-_{-11-1}
56
+ ['-y,-x,z', [1, 1, 0], null], // 37: m_{110}
57
+ ['y,x,z', [1, -1, 0], null], // 38: m_{1-10}
58
+ ['-y,x,-z', [0, 0, 1], '-'], // 39: -4^-_{001}
59
+ ['y,-x,-z', [0, 0, 1], '+'], // 40: -4^+_{001}
60
+ ['-x,-z,y', [1, 0, 0], '-'], // 41: -4^-_{100}
61
+ ['x,-z,-y', [0, 1, 1], null], // 42: m_{011}
62
+ ['x,z,y', [0, 1, -1], null], // 43: m_{01-1}
63
+ ['-x,z,-y', [1, 0, 0], '+'], // 44: -4^+_{100}
64
+ ['-z,-y,x', [0, 1, 0], '+'], // 45: -4^+_{010}
65
+ ['-z,y,-x', [1, 0, 1], null], // 46: m_{101}
66
+ ['z,-y,-x', [0, 1, 0], '-'], // 47: -4^-_{010}
67
+ ['z,y,x', [-1, 0, 1], null], // 48: m_{-101}
68
+ ];
69
+
70
+ /** ITA Table 1.4.2.2. */
71
+ const SEITZ_TABLE_1_4_2_2: readonly SeitzRow[] = [
72
+ ['x,y,z', null, null], // 1: 1
73
+ ['-y,x-y,z', [0, 0, 1], '+'], // 2: 3^+_{001}
74
+ ['-x+y,-x,z', [0, 0, 1], '-'], // 3: 3^-_{001}
75
+ ['-x,-y,z', [0, 0, 1], null], // 4: 2_{001}
76
+ ['y,-x+y,z', [0, 0, 1], '-'], // 5: 6^-_{001}
77
+ ['x-y,x,z', [0, 0, 1], '+'], // 6: 6^+_{001}
78
+ ['y,x,-z', [1, 1, 0], null], // 7: 2_{110}
79
+ ['x-y,-y,-z', [1, 0, 0], null], // 8: 2_{100}
80
+ ['-x,-x+y,-z', [0, 1, 0], null], // 9: 2_{010}
81
+ ['-y,-x,-z', [1, -1, 0], null], // 10: 2_{1-10}
82
+ ['-x+y,y,-z', [1, 2, 0], null], // 11: 2_{120}
83
+ ['x,x-y,-z', [2, 1, 0], null], // 12: 2_{210}
84
+ ['-x,-y,-z', null, null], // 13: -1
85
+ ['y,-x+y,-z', [0, 0, 1], '+'], // 14: -3^+_{001}
86
+ ['x-y,x,-z', [0, 0, 1], '-'], // 15: -3^-_{001}
87
+ ['x,y,-z', [0, 0, 1], null], // 16: m_{001}
88
+ ['-y,x-y,-z', [0, 0, 1], '-'], // 17: -6^-_{001}
89
+ ['-x+y,-x,-z', [0, 0, 1], '+'], // 18: -6^+_{001}
90
+ ['-y,-x,z', [1, 1, 0], null], // 19: m_{110}
91
+ ['-x+y,y,z', [1, 0, 0], null], // 20: m_{100}
92
+ ['x,x-y,z', [0, 1, 0], null], // 21: m_{010}
93
+ ['y,x,z', [1, -1, 0], null], // 22: m_{1-10}
94
+ ['x-y,-y,z', [1, 2, 0], null], // 23: m_{120}
95
+ ['-x,-x+y,z', [2, 1, 0], null], // 24: m_{210}
96
+ ];
97
+
98
+ /** ITA Table 1.4.2.3. */
99
+ const SEITZ_TABLE_1_4_2_3: readonly SeitzRow[] = [
100
+ ['x,y,z', null, null], // 1: 1
101
+ ['z,x,y', [1, 1, 1], '+'], // 2: 3^+_{111}
102
+ ['y,z,x', [1, 1, 1], '-'], // 3: 3^-_{111}
103
+ ['-z,-y,-x', [-1, 0, 1], null], // 4: 2_{-101}
104
+ ['-y,-x,-z', [1, -1, 0], null], // 5: 2_{1-10}
105
+ ['-x,-z,-y', [0, 1, -1], null], // 6: 2_{01-1}
106
+ ['-x,-y,-z', null, null], // 7: -1
107
+ ['-z,-x,-y', [1, 1, 1], '+'], // 8: -3^+_{111}
108
+ ['-y,-z,-x', [1, 1, 1], '-'], // 9: -3^-_{111}
109
+ ['z,y,x', [-1, 0, 1], null], // 10: m_{-101}
110
+ ['y,x,z', [1, -1, 0], null], // 11: m_{1-10}
111
+ ['x,z,y', [0, 1, -1], null], // 12: m_{01-1}
112
+ ];
113
+
114
+ /** The tables by the axes of the setting. */
115
+ export type SeitzTable = 'cubic' | 'hexagonal' | 'rhombohedral';
116
+
117
+ const TABLES: Readonly<Record<SeitzTable, readonly SeitzRow[]>> = {
118
+ cubic: SEITZ_TABLE_1_4_2_1,
119
+ hexagonal: SEITZ_TABLE_1_4_2_2,
120
+ rhombohedral: SEITZ_TABLE_1_4_2_3,
121
+ };
122
+
123
+ const parsed = new Map<SeitzTable, readonly { w: IntMat3; axis: SeitzRow[1]; sense: SeitzRow[2] }[]>();
124
+
125
+ /**
126
+ * The Seitz direction and sense of the matrix W in a table, or undefined if the table has no such W.
127
+ */
128
+ export function seitzOf(
129
+ table: SeitzTable,
130
+ w: IntMat3,
131
+ ): { readonly axis: SeitzRow[1]; readonly sense: SeitzRow[2] } | undefined {
132
+ let rows = parsed.get(table);
133
+ if (!rows) {
134
+ rows = TABLES[table].map(([t, axis, sense]) => ({
135
+ w: parseOperation(t).matrix as unknown as IntMat3,
136
+ axis,
137
+ sense,
138
+ }));
139
+ parsed.set(table, rows);
140
+ }
141
+ return rows.find((r) => r.w.every((row, i) => row.every((v, j) => v === w[i][j])));
142
+ }
143
+
144
+ /** The rows of a table, for the tests. */
145
+ export function seitzRows(table: SeitzTable): readonly SeitzRow[] {
146
+ return TABLES[table];
147
+ }
@@ -0,0 +1,103 @@
1
+ /**
2
+ * The Shubnikov symbols of the 90 magnetic point groups of types I and III, ITC Vol. D (2013) Table
3
+ * 1.5.2.3, column 3 (printed pp. 111–112), in the notation of references/itc/vol-d-table-1.5.2.3.md:
4
+ * a leading `_` is the printed underline (time reversal), a leading `-` the overbar, `.` the centred
5
+ * dot. The reference test compares every entry with the transcription. The grey groups have none in
6
+ * print (`symbol` derives theirs, docs/conventions.md).
7
+ */
8
+
9
+ import type { MagneticPointGroupKey } from './pointGroups.js';
10
+
11
+ /** Key → printed Shubnikov symbol, in the order of Table 1.5.2.3. */
12
+ export const SHUBNIKOV: Readonly<Partial<Record<MagneticPointGroupKey, string>>> = {
13
+ '1': '1',
14
+ '-1': '-2',
15
+ "-1'": '_-2',
16
+ '2': '2',
17
+ "2'": '_2',
18
+ m: 'm',
19
+ "m'": '_m',
20
+ '2/m': '2:m',
21
+ "2'/m'": '_2:_m',
22
+ "2/m'": '2:_m',
23
+ "2'/m": '_2:m',
24
+ '222': '2:2',
25
+ "2'2'2": '2:_2',
26
+ mm2: '2.m',
27
+ "m'm'2": '2._m',
28
+ "2'm'm": '_2.m',
29
+ mmm: 'm.2:m',
30
+ "mm'm'": '_m.2:m',
31
+ "m'm'm'": '_m.2:_m',
32
+ "mmm'": 'm.2:_m',
33
+ '4': '4',
34
+ "4'": '_4',
35
+ '-4': '-4',
36
+ "-4'": '_-4',
37
+ '4/m': '4:m',
38
+ "4'/m": '_4:m',
39
+ "4/m'": '4:_m',
40
+ "4'/m'": '_4:_m',
41
+ '422': '4:2',
42
+ "4'22'": '_4:2',
43
+ "42'2'": '4:_2',
44
+ '4mm': '4.m',
45
+ "4'mm'": '_4.m',
46
+ "4m'm'": '4._m',
47
+ '-42m': '-4.m',
48
+ "-4'2m'": '_-4._m',
49
+ "-4'm2'": '_-4.m',
50
+ "-42'm'": '-4._m',
51
+ '4/mmm': 'm.4:m',
52
+ "4'/mmm'": 'm._4:m',
53
+ "4/mm'm'": '_m.4:m',
54
+ "4/m'm'm'": '_m.4:_m',
55
+ "4/m'mm": 'm.4:_m',
56
+ "4'/m'm'm": 'm._4:_m',
57
+ '3': '3',
58
+ '-3': '-6',
59
+ "-3'": '_-6',
60
+ '32': '3:2',
61
+ "32'": '3:_2',
62
+ '3m': '3.m',
63
+ "3m'": '3._m',
64
+ '-3m': '-6.m',
65
+ "-3m'": '-6._m',
66
+ "-3'm'": '_-6._m',
67
+ "-3'm": '_-6.m',
68
+ '6': '6',
69
+ "6'": '_6',
70
+ '-6': '3:m',
71
+ "-6'": '3:_m',
72
+ '6/m': '6:m',
73
+ "6'/m'": '_6:_m',
74
+ "6/m'": '6:_m',
75
+ "6'/m": '_6:m',
76
+ '622': '6:2',
77
+ "6'22'": '_6:2',
78
+ "62'2'": '6:_2',
79
+ '6mm': '6.m',
80
+ "6'mm'": '_6.m',
81
+ "6m'm'": '6._m',
82
+ '-6m2': 'm.3:m',
83
+ "-6'2m'": '_m.3:_m',
84
+ "-6'm2'": 'm.3:_m',
85
+ "-6m'2'": '_m.3:m',
86
+ '6/mmm': 'm.6:m',
87
+ "6'/m'mm'": 'm._6:_m',
88
+ "6/mm'm'": '_m.6:m',
89
+ "6/m'm'm'": '_m.6:_m',
90
+ "6/m'mm": 'm.6:_m',
91
+ "6'/mmm'": 'm._6:m',
92
+ '23': '3/2',
93
+ 'm-3': '-6/2',
94
+ "m'-3'": '_-6/2',
95
+ '432': '3/4',
96
+ "4'32'": '3/_4',
97
+ '-43m': '3/-4',
98
+ "-4'3m'": '3/_-4',
99
+ 'm-3m': '-6/4',
100
+ "m-3m'": '-6/_4',
101
+ "m'-3'm'": '_-6/4',
102
+ "m'-3'm": '_-6/_4',
103
+ };