symcrys 0.10.1 → 0.11.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.
- package/README.md +6 -6
- package/dist/cell.d.ts +19 -16
- package/dist/cell.d.ts.map +1 -1
- package/dist/cell.js +63 -35
- package/dist/cell.js.map +1 -1
- package/dist/checks.d.ts +29 -0
- package/dist/checks.d.ts.map +1 -0
- package/dist/checks.js +79 -0
- package/dist/checks.js.map +1 -0
- package/dist/closure.d.ts +43 -0
- package/dist/closure.d.ts.map +1 -0
- package/dist/closure.js +201 -0
- package/dist/closure.js.map +1 -0
- package/dist/crystalClasses.d.ts +145 -117
- package/dist/crystalClasses.d.ts.map +1 -1
- package/dist/crystalClasses.js +161 -121
- package/dist/crystalClasses.js.map +1 -1
- package/dist/freeze.d.ts +7 -0
- package/dist/freeze.d.ts.map +1 -0
- package/dist/freeze.js +15 -0
- package/dist/freeze.js.map +1 -0
- package/dist/index.d.ts +11 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/indices.d.ts +31 -5
- package/dist/indices.d.ts.map +1 -1
- package/dist/indices.js +104 -13
- package/dist/indices.js.map +1 -1
- package/dist/lattice.d.ts +15 -1
- package/dist/lattice.d.ts.map +1 -1
- package/dist/lattice.js +30 -1
- package/dist/lattice.js.map +1 -1
- package/dist/linalg.d.ts +2 -2
- package/dist/linalg.d.ts.map +1 -1
- package/dist/linalg.js +3 -3
- package/dist/linalg.js.map +1 -1
- package/dist/magnetic.d.ts +12 -10
- package/dist/magnetic.d.ts.map +1 -1
- package/dist/magnetic.js +8 -6
- package/dist/magnetic.js.map +1 -1
- package/dist/notation.d.ts +16 -0
- package/dist/notation.d.ts.map +1 -0
- package/dist/notation.js +66 -0
- package/dist/notation.js.map +1 -0
- package/dist/operations.d.ts +40 -26
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +48 -60
- package/dist/operations.js.map +1 -1
- package/dist/plane.d.ts +141 -79
- package/dist/plane.d.ts.map +1 -1
- package/dist/plane.js +147 -77
- package/dist/plane.js.map +1 -1
- package/dist/pointGroups/crystalForms.d.ts +6 -21
- package/dist/pointGroups/crystalForms.d.ts.map +1 -1
- package/dist/pointGroups/crystalForms.js +9 -16
- package/dist/pointGroups/crystalForms.js.map +1 -1
- package/dist/pointGroups/crystalFormsData.d.ts +4 -1
- package/dist/pointGroups/crystalFormsData.d.ts.map +1 -1
- package/dist/pointGroups/crystalFormsData.js +64 -1
- package/dist/pointGroups/crystalFormsData.js.map +1 -1
- package/dist/pointGroups/elements.d.ts +19 -17
- package/dist/pointGroups/elements.d.ts.map +1 -1
- package/dist/pointGroups/elements.js +65 -83
- package/dist/pointGroups/elements.js.map +1 -1
- package/dist/pointGroups/identify.d.ts +10 -18
- package/dist/pointGroups/identify.d.ts.map +1 -1
- package/dist/pointGroups/identify.js +27 -79
- package/dist/pointGroups/identify.js.map +1 -1
- package/dist/pointGroups/itaOrder.d.ts +15 -14
- package/dist/pointGroups/itaOrder.d.ts.map +1 -1
- package/dist/pointGroups/itaOrder.js +116 -94
- package/dist/pointGroups/itaOrder.js.map +1 -1
- package/dist/pointGroups/itcData.d.ts +96 -0
- package/dist/pointGroups/itcData.d.ts.map +1 -0
- package/dist/pointGroups/itcData.js +336 -0
- package/dist/pointGroups/itcData.js.map +1 -0
- package/dist/pointGroups/itcMagneticData.d.ts +55 -0
- package/dist/pointGroups/itcMagneticData.d.ts.map +1 -0
- package/dist/pointGroups/itcMagneticData.js +172 -0
- package/dist/pointGroups/itcMagneticData.js.map +1 -0
- package/dist/pointGroups/keys.d.ts +32 -0
- package/dist/pointGroups/keys.d.ts.map +1 -0
- package/dist/pointGroups/keys.js +120 -0
- package/dist/pointGroups/keys.js.map +1 -0
- package/dist/pointGroups/magneticSymbols.d.ts +6 -5
- package/dist/pointGroups/magneticSymbols.d.ts.map +1 -1
- package/dist/pointGroups/magneticSymbols.js +15 -12
- package/dist/pointGroups/magneticSymbols.js.map +1 -1
- package/dist/pointGroups/orbits.d.ts +23 -42
- package/dist/pointGroups/orbits.d.ts.map +1 -1
- package/dist/pointGroups/orbits.js +20 -62
- package/dist/pointGroups/orbits.js.map +1 -1
- package/dist/pointGroups/pointGroups.d.ts +135 -67
- package/dist/pointGroups/pointGroups.d.ts.map +1 -1
- package/dist/pointGroups/pointGroups.js +409 -244
- package/dist/pointGroups/pointGroups.js.map +1 -1
- package/dist/pointGroups/properties.d.ts +21 -22
- package/dist/pointGroups/properties.d.ts.map +1 -1
- package/dist/pointGroups/properties.js +40 -37
- package/dist/pointGroups/properties.js.map +1 -1
- package/dist/pointGroups/seitzData.d.ts +26 -0
- package/dist/pointGroups/seitzData.d.ts.map +1 -0
- package/dist/pointGroups/seitzData.js +130 -0
- package/dist/pointGroups/seitzData.js.map +1 -0
- package/dist/pointGroups/wyckoff.d.ts +70 -40
- package/dist/pointGroups/wyckoff.d.ts.map +1 -1
- package/dist/pointGroups/wyckoff.js +98 -91
- package/dist/pointGroups/wyckoff.js.map +1 -1
- package/dist/pointGroups/wyckoffData.d.ts +7 -4
- package/dist/pointGroups/wyckoffData.d.ts.map +1 -1
- package/dist/pointGroups/wyckoffData.js +789 -168
- package/dist/pointGroups/wyckoffData.js.map +1 -1
- package/dist/siteSymmetry.d.ts +8 -16
- package/dist/siteSymmetry.d.ts.map +1 -1
- package/dist/siteSymmetry.js +34 -24
- package/dist/siteSymmetry.js.map +1 -1
- package/dist/spaceGroups/affine.d.ts.map +1 -1
- package/dist/spaceGroups/affine.js +3 -2
- package/dist/spaceGroups/affine.js.map +1 -1
- package/dist/spaceGroups/cell.d.ts +43 -31
- package/dist/spaceGroups/cell.d.ts.map +1 -1
- package/dist/spaceGroups/cell.js +173 -85
- package/dist/spaceGroups/cell.js.map +1 -1
- package/dist/spaceGroups/describe.d.ts +12 -10
- package/dist/spaceGroups/describe.d.ts.map +1 -1
- package/dist/spaceGroups/describe.js +11 -10
- package/dist/spaceGroups/describe.js.map +1 -1
- package/dist/spaceGroups/planeGroupData.d.ts +1 -1
- package/dist/spaceGroups/planeGroupData.d.ts.map +1 -1
- package/dist/spaceGroups/planeGroupData.js +8 -8
- package/dist/spaceGroups/planeGroupData.js.map +1 -1
- package/dist/spaceGroups/planeGroups.d.ts.map +1 -1
- package/dist/spaceGroups/planeGroups.js +2 -1
- package/dist/spaceGroups/planeGroups.js.map +1 -1
- package/dist/spaceGroups/positions.d.ts +48 -19
- package/dist/spaceGroups/positions.d.ts.map +1 -1
- package/dist/spaceGroups/positions.js +166 -67
- package/dist/spaceGroups/positions.js.map +1 -1
- package/dist/tensors/propertyTable.d.ts +3 -1
- package/dist/tensors/propertyTable.d.ts.map +1 -1
- package/dist/tensors/propertyTable.js +17 -10
- package/dist/tensors/propertyTable.js.map +1 -1
- package/dist/tensors/rowEchelon.d.ts +3 -3
- package/dist/tensors/rowEchelon.d.ts.map +1 -1
- package/dist/tensors/rowEchelon.js +4 -4
- package/dist/tensors/rowEchelon.js.map +1 -1
- package/dist/tensors/tensorForm.d.ts +75 -34
- package/dist/tensors/tensorForm.d.ts.map +1 -1
- package/dist/tensors/tensorForm.js +171 -67
- package/dist/tensors/tensorForm.js.map +1 -1
- package/dist/tensors/tensorProperties.d.ts +10 -9
- package/dist/tensors/tensorProperties.d.ts.map +1 -1
- package/dist/tensors/tensorProperties.js +22 -12
- package/dist/tensors/tensorProperties.js.map +1 -1
- package/dist/tolerances.d.ts +56 -1
- package/dist/tolerances.d.ts.map +1 -1
- package/dist/tolerances.js +51 -1
- package/dist/tolerances.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/cell.ts +78 -51
- package/src/checks.ts +84 -0
- package/src/closure.ts +214 -0
- package/src/crystalClasses.ts +232 -157
- package/src/freeze.ts +14 -0
- package/src/index.ts +21 -10
- package/src/indices.ts +108 -18
- package/src/lattice.ts +41 -1
- package/src/linalg.ts +3 -3
- package/src/magnetic.ts +14 -9
- package/src/notation.ts +73 -0
- package/src/operations.ts +78 -71
- package/src/plane.ts +253 -127
- package/src/pointGroups/crystalForms.ts +11 -44
- package/src/pointGroups/crystalFormsData.ts +66 -1
- package/src/pointGroups/elements.ts +82 -92
- package/src/pointGroups/identify.ts +38 -97
- package/src/pointGroups/itaOrder.ts +117 -101
- package/src/pointGroups/itcData.ts +404 -0
- package/src/pointGroups/itcMagneticData.ts +206 -0
- package/src/pointGroups/keys.ts +144 -0
- package/src/pointGroups/magneticSymbols.ts +18 -17
- package/src/pointGroups/orbits.ts +41 -89
- package/src/pointGroups/pointGroups.ts +540 -297
- package/src/pointGroups/properties.ts +44 -40
- package/src/pointGroups/seitzData.ts +147 -0
- package/src/pointGroups/wyckoff.ts +137 -112
- package/src/pointGroups/wyckoffData.ts +793 -170
- package/src/siteSymmetry.ts +43 -40
- package/src/spaceGroups/affine.ts +3 -2
- package/src/spaceGroups/cell.ts +227 -116
- package/src/spaceGroups/describe.ts +22 -19
- package/src/spaceGroups/planeGroupData.ts +9 -9
- package/src/spaceGroups/planeGroups.ts +2 -1
- package/src/spaceGroups/positions.ts +202 -78
- package/src/tensors/propertyTable.ts +26 -14
- package/src/tensors/rowEchelon.ts +4 -3
- package/src/tensors/tensorForm.ts +258 -88
- package/src/tensors/tensorProperties.ts +34 -14
- package/src/tolerances.ts +66 -1
- package/src/version.ts +1 -1
- package/dist/pointGroups/data.d.ts +0 -75
- package/dist/pointGroups/data.d.ts.map +0 -1
- package/dist/pointGroups/data.js +0 -212
- package/dist/pointGroups/data.js.map +0 -1
- package/dist/pointGroups/magneticData.d.ts +0 -66
- package/dist/pointGroups/magneticData.d.ts.map +0 -1
- package/dist/pointGroups/magneticData.js +0 -184
- package/dist/pointGroups/magneticData.js.map +0 -1
- package/dist/spaceGroups/snap.d.ts +0 -20
- package/dist/spaceGroups/snap.d.ts.map +0 -1
- package/dist/spaceGroups/snap.js +0 -103
- package/dist/spaceGroups/snap.js.map +0 -1
- package/src/pointGroups/data.ts +0 -305
- package/src/pointGroups/magneticData.ts +0 -328
- package/src/spaceGroups/snap.ts +0 -121
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Crystal forms of the crystal classes,
|
|
2
|
+
* Crystal forms of the crystal classes, as ITA gives them: for each Wyckoff position the basic
|
|
3
3
|
* form and the limiting forms as ITA prints them, with the 47 forms of ITA Table 3.2.1.3
|
|
4
4
|
* (docs/conventions.md, "Crystal forms").
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import { SETTING_KEYS, checkOptions } from '../checks.js';
|
|
8
8
|
import type { PointGroupKey, SettingOptions } from './pointGroups.js';
|
|
9
9
|
import { ITA_FORMS, ITA_FORM_TYPES, type FormRow } from './crystalFormsData.js';
|
|
10
|
-
import {
|
|
11
|
-
REPRESENTATIVE_VALUES,
|
|
12
|
-
faceBasis,
|
|
13
|
-
itcSetting,
|
|
14
|
-
normal,
|
|
15
|
-
numericHkl,
|
|
16
|
-
permutationFromSetting1,
|
|
17
|
-
permutePattern,
|
|
18
|
-
printedEntry,
|
|
19
|
-
wyckoffPositions,
|
|
20
|
-
type Hkl,
|
|
21
|
-
} from './wyckoff.js';
|
|
10
|
+
import { tableSetting, permutationFromSetting1, permutePattern, printedEntry, wyckoffPositions } from './wyckoff.js';
|
|
22
11
|
|
|
23
12
|
/** One of the 47 crystal forms of ITA Table 3.2.1.3. */
|
|
24
13
|
export interface CrystalFormType {
|
|
@@ -44,8 +33,8 @@ export interface CrystalForm {
|
|
|
44
33
|
/** Oriented site-symmetry symbol of the Wyckoff position, e.g. `..m` (the face symmetry). */
|
|
45
34
|
readonly siteSymmetry: string;
|
|
46
35
|
/**
|
|
47
|
-
*
|
|
48
|
-
* -43m and m-3m), false for a limiting form: its faces have the face symmetry of the position,
|
|
36
|
+
* `true` for a basic form, a form of lowest eigensymmetry of the position (two at the faces (hhl)
|
|
37
|
+
* of -43m and m-3m), `false` for a limiting form: its faces have the face symmetry of the position,
|
|
49
38
|
* but the form has a higher eigensymmetry (ITA 6th ed., § 3.2.1.2.2, p. 723).
|
|
50
39
|
*/
|
|
51
40
|
readonly basic: boolean;
|
|
@@ -58,19 +47,6 @@ export interface CrystalForm {
|
|
|
58
47
|
readonly millerIndices: string;
|
|
59
48
|
/** The condition ITA prints with the form, `|h|<|l|` or `|h|>|l|` (cubic forms (hhl)); absent otherwise. */
|
|
60
49
|
readonly condition?: string;
|
|
61
|
-
/**
|
|
62
|
-
* A face of the form with numbers: `millerIndices` with h = 3, k = 2, l = 1, and with h = 1, l = 3
|
|
63
|
-
* where the condition is `|h|<|l|`.
|
|
64
|
-
*/
|
|
65
|
-
readonly representative: {
|
|
66
|
-
/** The Miller indices (hkl) of the face. */
|
|
67
|
-
readonly hkl: Hkl;
|
|
68
|
-
/**
|
|
69
|
-
* Its face normal, a Cartesian unit vector. Monoclinic and triclinic: the normal for a, b, c along
|
|
70
|
-
* x, y, z (no cell angles), exact for the unique axis only.
|
|
71
|
-
*/
|
|
72
|
-
readonly cartesian: Vec3;
|
|
73
|
-
};
|
|
74
50
|
}
|
|
75
51
|
|
|
76
52
|
/** The 47 crystal forms of ITA Table 3.2.1.3, in ITA's order: `CRYSTAL_FORM_TYPES[n - 1]` is form n. */
|
|
@@ -78,9 +54,6 @@ export const CRYSTAL_FORM_TYPES: readonly CrystalFormType[] = Object.freeze(
|
|
|
78
54
|
ITA_FORM_TYPES.map(([number, name, faces, eigensymmetry]) => Object.freeze({ number, name, faces, eigensymmetry })),
|
|
79
55
|
);
|
|
80
56
|
|
|
81
|
-
/** h, k, l of the representative for the condition |h| < |l|. */
|
|
82
|
-
const SMALL_H = Object.freeze({ h: 1, k: 2, l: 3 });
|
|
83
|
-
|
|
84
57
|
const HKL = 'hkl';
|
|
85
58
|
|
|
86
59
|
/** The printed rows of a setting; for a setting ITA does not print, those of setting 1 carried into its frame. */
|
|
@@ -100,17 +73,17 @@ const cache = new Map<string, readonly CrystalForm[]>();
|
|
|
100
73
|
/**
|
|
101
74
|
* The crystal forms of a crystal class in ITA's order: by Wyckoff position (general position
|
|
102
75
|
* first), each position's basic forms before its limiting forms, as ITA 6th ed. Table 3.2.3.2
|
|
103
|
-
* prints them.
|
|
104
|
-
*
|
|
105
|
-
*
|
|
76
|
+
* prints them. Crystal classes only (throws a RangeError for a magnetic point group with time
|
|
77
|
+
* reversal), like the Wyckoff positions. For the settings ITA does not print (`mm2` settings 2 and 3, monoclinic unique axis a), the forms of
|
|
78
|
+
* setting 1 carried into their frame.
|
|
106
79
|
*/
|
|
107
80
|
export function crystalForms(key: PointGroupKey, options?: SettingOptions): readonly CrystalForm[] {
|
|
108
|
-
|
|
81
|
+
checkOptions(options, SETTING_KEYS, 'crystalForms');
|
|
82
|
+
const setting = tableSetting(key, options, 'Crystal forms');
|
|
109
83
|
const cacheKey = `${key}#${setting}`;
|
|
110
84
|
let result = cache.get(cacheKey);
|
|
111
85
|
if (!result) {
|
|
112
|
-
const positions = wyckoffPositions(key, {
|
|
113
|
-
const basis = faceBasis(key);
|
|
86
|
+
const positions = wyckoffPositions(key, { setting });
|
|
114
87
|
result = Object.freeze(
|
|
115
88
|
printedRows(key, setting).map(([letter, basic, formType, millerIndices, condition]) => {
|
|
116
89
|
const position = positions.find((p) => p.letter === letter);
|
|
@@ -120,8 +93,6 @@ export function crystalForms(key: PointGroupKey, options?: SettingOptions): read
|
|
|
120
93
|
`Point group ${key}, setting ${setting}: form ${formType} does not have the multiplicity of position ${letter}`,
|
|
121
94
|
);
|
|
122
95
|
}
|
|
123
|
-
const values = condition === '|h|<|l|' ? SMALL_H : REPRESENTATIVE_VALUES;
|
|
124
|
-
const hkl = numericHkl(millerIndices, values);
|
|
125
96
|
return Object.freeze({
|
|
126
97
|
letter,
|
|
127
98
|
multiplicity: position.multiplicity,
|
|
@@ -130,10 +101,6 @@ export function crystalForms(key: PointGroupKey, options?: SettingOptions): read
|
|
|
130
101
|
formType,
|
|
131
102
|
millerIndices,
|
|
132
103
|
...(condition === undefined ? {} : { condition }),
|
|
133
|
-
representative: Object.freeze({
|
|
134
|
-
hkl: Object.freeze(hkl) as Hkl,
|
|
135
|
-
cartesian: Object.freeze(normal(basis, hkl)) as Vec3,
|
|
136
|
-
}),
|
|
137
104
|
});
|
|
138
105
|
}),
|
|
139
106
|
);
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* with this file; change both only by transcription from print.
|
|
8
8
|
*
|
|
9
9
|
* Notation as in wyckoffData.ts: a leading `-` is an overbar; components separated by commas;
|
|
10
|
-
* Bravais–Miller indices (four components) for hexagonal axes
|
|
10
|
+
* Bravais–Miller indices (four components) for hexagonal axes; three for rhombohedral axes, where an
|
|
11
|
+
* index may be a sum as printed (`h,k,-h-k`, `h,k,2k-h`).
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
14
|
/** [number, name as printed, number of faces, eigensymmetry]. */
|
|
@@ -75,6 +76,8 @@ export interface FormEntry {
|
|
|
75
76
|
readonly symbol: string;
|
|
76
77
|
/** Monoclinic: the unique axis of the entry. */
|
|
77
78
|
readonly uniqueAxis?: 'b' | 'c';
|
|
79
|
+
/** Trigonal: `'rhombohedral'` for an entry with rhombohedral axes (hexagonal axes otherwise). */
|
|
80
|
+
readonly axes?: 'rhombohedral';
|
|
78
81
|
/** Printed page. */
|
|
79
82
|
readonly page: number;
|
|
80
83
|
/** In printed order: general position first, each position's basic form before its limiting forms. */
|
|
@@ -292,6 +295,16 @@ export const ITA_FORMS: readonly FormEntry[] = [
|
|
|
292
295
|
['a', true, 1, '0,0,0,1'],
|
|
293
296
|
],
|
|
294
297
|
},
|
|
298
|
+
{
|
|
299
|
+
symbol: '3',
|
|
300
|
+
axes: 'rhombohedral',
|
|
301
|
+
page: 753,
|
|
302
|
+
rows: [
|
|
303
|
+
['b', true, 17, 'h,k,l'],
|
|
304
|
+
['b', false, 18, 'h,k,-h-k'],
|
|
305
|
+
['a', true, 1, '1,1,1'],
|
|
306
|
+
],
|
|
307
|
+
},
|
|
295
308
|
{
|
|
296
309
|
symbol: '-3',
|
|
297
310
|
page: 753,
|
|
@@ -301,6 +314,16 @@ export const ITA_FORMS: readonly FormEntry[] = [
|
|
|
301
314
|
['a', true, 2, '0,0,0,1'],
|
|
302
315
|
],
|
|
303
316
|
},
|
|
317
|
+
{
|
|
318
|
+
symbol: '-3',
|
|
319
|
+
axes: 'rhombohedral',
|
|
320
|
+
page: 753,
|
|
321
|
+
rows: [
|
|
322
|
+
['b', true, 21, 'h,k,l'],
|
|
323
|
+
['b', false, 25, 'h,k,-h-k'],
|
|
324
|
+
['a', true, 2, '1,1,1'],
|
|
325
|
+
],
|
|
326
|
+
},
|
|
304
327
|
{
|
|
305
328
|
symbol: '312',
|
|
306
329
|
page: 754,
|
|
@@ -327,6 +350,20 @@ export const ITA_FORMS: readonly FormEntry[] = [
|
|
|
327
350
|
['a', true, 2, '0,0,0,1'],
|
|
328
351
|
],
|
|
329
352
|
},
|
|
353
|
+
{
|
|
354
|
+
symbol: '32',
|
|
355
|
+
axes: 'rhombohedral',
|
|
356
|
+
page: 755,
|
|
357
|
+
rows: [
|
|
358
|
+
['c', true, 19, 'h,k,l'],
|
|
359
|
+
['c', false, 22, 'h,k,-h-k'],
|
|
360
|
+
['c', false, 24, 'h,k,2k-h'],
|
|
361
|
+
['c', false, 21, 'h,h,l'],
|
|
362
|
+
['c', false, 25, '1,1,-2'],
|
|
363
|
+
['b', true, 18, '0,1,-1'],
|
|
364
|
+
['a', true, 2, '1,1,1'],
|
|
365
|
+
],
|
|
366
|
+
},
|
|
330
367
|
{
|
|
331
368
|
symbol: '3m1',
|
|
332
369
|
page: 755,
|
|
@@ -353,6 +390,20 @@ export const ITA_FORMS: readonly FormEntry[] = [
|
|
|
353
390
|
['a', true, 1, '0,0,0,1'],
|
|
354
391
|
],
|
|
355
392
|
},
|
|
393
|
+
{
|
|
394
|
+
symbol: '3m',
|
|
395
|
+
axes: 'rhombohedral',
|
|
396
|
+
page: 756,
|
|
397
|
+
rows: [
|
|
398
|
+
['c', true, 20, 'h,k,l'],
|
|
399
|
+
['c', false, 22, 'h,k,-h-k'],
|
|
400
|
+
['c', false, 23, 'h,k,2k-h'],
|
|
401
|
+
['c', false, 25, '0,1,-1'],
|
|
402
|
+
['b', true, 17, 'h,h,l'],
|
|
403
|
+
['b', false, 18, '1,1,-2'],
|
|
404
|
+
['a', true, 1, '1,1,1'],
|
|
405
|
+
],
|
|
406
|
+
},
|
|
356
407
|
{
|
|
357
408
|
symbol: '-31m',
|
|
358
409
|
page: 757,
|
|
@@ -379,6 +430,20 @@ export const ITA_FORMS: readonly FormEntry[] = [
|
|
|
379
430
|
['a', true, 2, '0,0,0,1'],
|
|
380
431
|
],
|
|
381
432
|
},
|
|
433
|
+
{
|
|
434
|
+
symbol: '-3m',
|
|
435
|
+
axes: 'rhombohedral',
|
|
436
|
+
page: 759,
|
|
437
|
+
rows: [
|
|
438
|
+
['d', true, 26, 'h,k,l'],
|
|
439
|
+
['d', false, 30, 'h,k,-h-k'],
|
|
440
|
+
['d', false, 31, 'h,k,2k-h'],
|
|
441
|
+
['c', true, 21, 'h,h,l'],
|
|
442
|
+
['c', false, 25, '1,1,-2'],
|
|
443
|
+
['b', true, 25, '0,1,-1'],
|
|
444
|
+
['a', true, 2, '1,1,1'],
|
|
445
|
+
],
|
|
446
|
+
},
|
|
382
447
|
{
|
|
383
448
|
symbol: '6',
|
|
384
449
|
page: 760,
|
|
@@ -5,27 +5,33 @@
|
|
|
5
5
|
* left to the applications (docs/conventions.md, "Symmetry directions and elements").
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import { SETTING_KEYS, checkOptions } from '../checks.js';
|
|
8
9
|
import { det, trace, type Mat3, type Vec3 } from '../linalg.js';
|
|
9
|
-
import { crystalFamily
|
|
10
|
+
import { crystalFamily } from '../lattice.js';
|
|
10
11
|
import type { Operation } from '../operations.js';
|
|
11
|
-
import {
|
|
12
|
+
import type { Uvw } from '../symmetryDirections.js';
|
|
13
|
+
import type { IntMat3 } from './itaOrder.js';
|
|
14
|
+
import { itcBasis, itcSetting, itcSymmetryDirections } from './itcData.js';
|
|
15
|
+
import { seitzOf, type SeitzTable } from './seitzData.js';
|
|
12
16
|
import {
|
|
17
|
+
classSettingOf,
|
|
13
18
|
operations,
|
|
14
19
|
pointGroup,
|
|
20
|
+
settingIndexOf,
|
|
15
21
|
symbol,
|
|
16
|
-
type Convention,
|
|
17
22
|
type MagneticPointGroupKey,
|
|
18
23
|
type SettingOptions,
|
|
19
24
|
} from './pointGroups.js';
|
|
20
25
|
|
|
21
26
|
/** What a point operation is; a rotoinversion n̄ is the inversion times the rotation n (n = 3, 4, 6). */
|
|
22
|
-
export type OperationKind = 'identity' | 'inversion' | 'rotation' | 'rotoinversion' | '
|
|
27
|
+
export type OperationKind = 'identity' | 'inversion' | 'rotation' | 'rotoinversion' | 'reflection';
|
|
23
28
|
|
|
24
29
|
/** A symmetry direction: as a lattice direction [uvw] and as a Cartesian unit vector. */
|
|
25
30
|
export interface Axis {
|
|
26
31
|
/**
|
|
27
|
-
* Integer coordinates in the conventional basis
|
|
28
|
-
*
|
|
32
|
+
* Integer coordinates in the conventional basis: for the axis of an operation with the sign of its
|
|
33
|
+
* Seitz symbol (ITA Tables 1.4.2.1–1.4.2.3), for a symmetry direction with the sign of ITA Table
|
|
34
|
+
* 2.1.3.1.
|
|
29
35
|
*/
|
|
30
36
|
readonly lattice: Uvw;
|
|
31
37
|
/**
|
|
@@ -40,11 +46,11 @@ export interface OperationDescription {
|
|
|
40
46
|
/** What the operation is, without time reversal. */
|
|
41
47
|
readonly kind: OperationKind;
|
|
42
48
|
/**
|
|
43
|
-
* The n of the symbol n or n
|
|
44
|
-
* otherwise the order of the rotation part.
|
|
49
|
+
* The n of the symbol n or n̄ (ITA 2016 § 1.2.1, p. 12: an n-fold rotation): 1 for the identity and the
|
|
50
|
+
* inversion, 2 for a reflection (m = 2̄), otherwise the order of the rotation part.
|
|
45
51
|
*/
|
|
46
|
-
readonly
|
|
47
|
-
/** Rotation axis, rotoinversion axis or mirror
|
|
52
|
+
readonly n: number;
|
|
53
|
+
/** Rotation axis, rotoinversion axis or the normal of the mirror plane; absent for the identity and the inversion. */
|
|
48
54
|
readonly axis?: Axis;
|
|
49
55
|
/**
|
|
50
56
|
* For n ≥ 3: `'+'` if the rotation part turns by +360°/n about `axis` (counter-clockwise seen
|
|
@@ -91,23 +97,8 @@ function normalize(v: Vec3): Vec3 {
|
|
|
91
97
|
|
|
92
98
|
const dot = (a: Vec3, b: Vec3): number => a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
|
|
93
99
|
|
|
94
|
-
/**
|
|
95
|
-
|
|
96
|
-
* basis (`latticeBasis`); there the axes a, b, c are taken along x, y, z, which is exact for the
|
|
97
|
-
* monoclinic unique axis, the only symmetry direction that carries an element in a symcrys frame.
|
|
98
|
-
*/
|
|
99
|
-
function basisOf(family: CrystalFamily): Mat3 {
|
|
100
|
-
if (family === 'monoclinic' || family === 'triclinic')
|
|
101
|
-
return [
|
|
102
|
-
[1, 0, 0],
|
|
103
|
-
[0, 1, 0],
|
|
104
|
-
[0, 0, 1],
|
|
105
|
-
];
|
|
106
|
-
return latticeBasis(family);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function axisOf(family: CrystalFamily, uvw: Uvw): Axis {
|
|
110
|
-
const b = basisOf(family);
|
|
100
|
+
/** [uvw] in the basis `b` (columns a, b, c) as a Cartesian unit vector, with the direction itself. */
|
|
101
|
+
function axisOf(b: Mat3, uvw: Uvw): Axis {
|
|
111
102
|
const v: Vec3 = [
|
|
112
103
|
b[0][0] * uvw[0] + b[0][1] * uvw[1] + b[0][2] * uvw[2],
|
|
113
104
|
b[1][0] * uvw[0] + b[1][1] * uvw[1] + b[1][2] * uvw[2],
|
|
@@ -116,16 +107,6 @@ function axisOf(family: CrystalFamily, uvw: Uvw): Axis {
|
|
|
116
107
|
return Object.freeze({ lattice: uvw, cartesian: Object.freeze(normalize(v)) as unknown as Vec3 });
|
|
117
108
|
}
|
|
118
109
|
|
|
119
|
-
/**
|
|
120
|
-
* The symmetry directions of a family, per position of the full symbol, in the reading of a
|
|
121
|
-
* convention. Birss reads position 2 of the hexagonal family along y, a tertiary direction, and
|
|
122
|
-
* position 3 along x, a secondary one (docs/conventions.md, "Where ITC and Birss differ").
|
|
123
|
-
*/
|
|
124
|
-
function positionsOf(family: CrystalFamily, c: Convention): readonly (readonly Uvw[])[] {
|
|
125
|
-
const p = LATTICE_SYMMETRY_DIRECTIONS[family];
|
|
126
|
-
return c === 'birss' && family === 'hexagonal' ? [p[0], p[2], p[1]] : p;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
110
|
/** The proper rotation part of a matrix and its order n (1 for the identity). */
|
|
130
111
|
function rotationPart(m: Mat3): { r: Mat3; n: number } {
|
|
131
112
|
const r = det(m) > 0 ? m : (m.map((row) => row.map((v) => -v)) as unknown as Mat3);
|
|
@@ -168,16 +149,40 @@ function findAxis(axes: readonly Axis[], u: Vec3, what: string): Axis {
|
|
|
168
149
|
return a;
|
|
169
150
|
}
|
|
170
151
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
152
|
+
const parallel = (a: Vec3, b: Vec3): boolean => Math.abs(Math.abs(dot(a, b)) - 1) < AXIS_TOLERANCE;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* An operation described geometrically. Its axis lies along a symmetry direction of the setting and
|
|
156
|
+
* carries the sign of the operation's Seitz symbol (ITA 2016 Tables 1.4.2.1–1.4.2.3; "Pure ITC",
|
|
157
|
+
* #114), which for n ≥ 3 fixes what the sense refers to; the sense, computed from the matrix, is
|
|
158
|
+
* checked against the printed one.
|
|
159
|
+
*/
|
|
160
|
+
function describe(
|
|
161
|
+
op: Operation,
|
|
162
|
+
axes: readonly Axis[],
|
|
163
|
+
basis: Mat3,
|
|
164
|
+
table: SeitzTable,
|
|
165
|
+
what: string,
|
|
166
|
+
): OperationDescription {
|
|
167
|
+
const proper = det(op.cartesian) > 0;
|
|
168
|
+
const { r, n } = rotationPart(op.cartesian);
|
|
174
169
|
const timeReversal = op.timeReversal;
|
|
175
|
-
if (n === 1) return Object.freeze({ kind: proper ? 'identity' : 'inversion',
|
|
176
|
-
const
|
|
177
|
-
const
|
|
178
|
-
if (
|
|
170
|
+
if (n === 1) return Object.freeze({ kind: proper ? 'identity' : 'inversion', n: 1, timeReversal });
|
|
171
|
+
const direction = findAxis(axes, rotationAxis(r, n), what);
|
|
172
|
+
const seitz = seitzOf(table, op.matrix as unknown as IntMat3);
|
|
173
|
+
if (!seitz?.axis) throw new Error(`${what}: no Seitz symbol for the matrix ${JSON.stringify(op.matrix)}`);
|
|
174
|
+
// A frozen copy: the result must not share the table's array (every result frozen, #137 C4).
|
|
175
|
+
const signed = axisOf(basis, Object.freeze([...seitz.axis]) as unknown as Uvw);
|
|
176
|
+
if (!parallel(signed.cartesian, direction.cartesian)) {
|
|
177
|
+
throw new Error(`${what}: the Seitz direction [${seitz.axis.join(',')}] is not along the axis of the operation`);
|
|
178
|
+
}
|
|
179
|
+
// The object of the symmetry direction where the signs agree, so that the two match by identity there.
|
|
180
|
+
const axis = dot(signed.cartesian, direction.cartesian) > 0 ? direction : signed;
|
|
181
|
+
const kind: OperationKind = proper ? 'rotation' : n === 2 ? 'reflection' : 'rotoinversion';
|
|
182
|
+
if (n === 2) return Object.freeze({ kind, n: 2, axis, timeReversal });
|
|
179
183
|
const sense = dot(axialVector(r), axis.cartesian) > 0 ? '+' : '-';
|
|
180
|
-
|
|
184
|
+
if (sense !== seitz.sense) throw new Error(`${what}: the sense ${sense} differs from the Seitz symbol's`);
|
|
185
|
+
return Object.freeze({ kind, n, axis, sense, timeReversal });
|
|
181
186
|
}
|
|
182
187
|
|
|
183
188
|
interface Analysis {
|
|
@@ -188,18 +193,28 @@ interface Analysis {
|
|
|
188
193
|
const cache = new Map<string, Analysis>();
|
|
189
194
|
|
|
190
195
|
function analysis(key: MagneticPointGroupKey, options?: SettingOptions): Analysis {
|
|
191
|
-
const ops = operations(key, options); // checks key
|
|
192
|
-
const
|
|
193
|
-
const
|
|
194
|
-
const cacheKey = `${key}#${setting}#${c}`;
|
|
196
|
+
const ops = operations(key, options); // checks key and setting
|
|
197
|
+
const setting = settingIndexOf(key, options);
|
|
198
|
+
const cacheKey = `${key}#${setting}`;
|
|
195
199
|
const hit = cache.get(cacheKey);
|
|
196
200
|
if (hit) return hit;
|
|
197
201
|
|
|
198
202
|
const family = crystalFamily(pointGroup(key).crystalSystem);
|
|
199
|
-
|
|
203
|
+
// The basis and the symmetry directions of the setting: for rhombohedral axes those of ITA Table
|
|
204
|
+
// 2.1.3.1 for rhombohedral axes; monoclinic and triclinic a, b, c along x, y, z, exact for the
|
|
205
|
+
// unique axis, the only symmetry direction that carries an element (itcData.ts, `itcBasis`).
|
|
206
|
+
const c = classSettingOf(key, options);
|
|
207
|
+
const basis = itcBasis(c.key, c.index);
|
|
208
|
+
const positions = itcSymmetryDirections(c.key, c.index).map((dirs) => dirs.map((d) => axisOf(basis, d)));
|
|
200
209
|
const all = positions.flat();
|
|
201
210
|
const what = `Point group ${key}`;
|
|
202
|
-
const
|
|
211
|
+
const table: SeitzTable =
|
|
212
|
+
family !== 'hexagonal'
|
|
213
|
+
? 'cubic'
|
|
214
|
+
: itcSetting(c.key, c.index).axes === 'rhombohedral'
|
|
215
|
+
? 'rhombohedral'
|
|
216
|
+
: 'hexagonal';
|
|
217
|
+
const descriptions = Object.freeze(ops.map((op) => describe(op, all, basis, table, what)));
|
|
203
218
|
|
|
204
219
|
// The full symbol of a grey group ends in 1', which is no position of the symbol.
|
|
205
220
|
const tokens =
|
|
@@ -211,14 +226,14 @@ function analysis(key: MagneticPointGroupKey, options?: SettingOptions): Analysi
|
|
|
211
226
|
const directions = Object.freeze(
|
|
212
227
|
positions.map((axes, i) => {
|
|
213
228
|
const elements = axes.map((a) => {
|
|
214
|
-
const on = descriptions.filter((d) => d.axis
|
|
229
|
+
const on = descriptions.filter((d) => d.axis !== undefined && parallel(d.axis.cartesian, a.cartesian));
|
|
215
230
|
const max = (kind: OperationKind, none: number) =>
|
|
216
|
-
on.filter((d) => d.kind === kind).reduce((m, d) => Math.max(m, d.
|
|
231
|
+
on.filter((d) => d.kind === kind).reduce((m, d) => Math.max(m, d.n), none);
|
|
217
232
|
return Object.freeze({
|
|
218
233
|
...a,
|
|
219
234
|
rotation: max('rotation', 1),
|
|
220
235
|
rotoinversion: max('rotoinversion', 0),
|
|
221
|
-
mirror: on.some((d) => d.kind === '
|
|
236
|
+
mirror: on.some((d) => d.kind === 'reflection'),
|
|
222
237
|
});
|
|
223
238
|
});
|
|
224
239
|
const position: SymmetryDirection =
|
|
@@ -228,60 +243,35 @@ function analysis(key: MagneticPointGroupKey, options?: SettingOptions): Analysi
|
|
|
228
243
|
return Object.freeze(position);
|
|
229
244
|
}),
|
|
230
245
|
);
|
|
231
|
-
const result = {
|
|
232
|
-
descriptions: c === 'birss' ? Object.freeze(descriptions.map(birssSigned)) : descriptions,
|
|
233
|
-
directions,
|
|
234
|
-
};
|
|
246
|
+
const result = { descriptions, directions };
|
|
235
247
|
cache.set(cacheKey, result);
|
|
236
248
|
return result;
|
|
237
249
|
}
|
|
238
250
|
|
|
239
|
-
const flipped = new Map<Axis, Axis>();
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* The description with the axis signed as in birss-app (docs/conventions.md, "Birss convention and
|
|
243
|
-
* birss-app"): its first non-zero Cartesian component, in the order x, y, z, is positive. If the
|
|
244
|
-
* axis of ITA Table 2.1.3.1 points the other way, axis and sense are reversed; the rotation stays
|
|
245
|
-
* the same.
|
|
246
|
-
*/
|
|
247
|
-
function birssSigned(d: OperationDescription): OperationDescription {
|
|
248
|
-
const a = d.axis;
|
|
249
|
-
if (!a) return d;
|
|
250
|
-
const first = a.cartesian.find((x) => Math.abs(x) > 1e-9) ?? 0;
|
|
251
|
-
if (first > 0) return d;
|
|
252
|
-
let axis = flipped.get(a);
|
|
253
|
-
if (!axis) {
|
|
254
|
-
axis = Object.freeze({
|
|
255
|
-
lattice: Object.freeze(a.lattice.map((x) => (x === 0 ? 0 : -x))) as unknown as Uvw,
|
|
256
|
-
cartesian: Object.freeze(a.cartesian.map((x) => (x === 0 ? 0 : -x))) as unknown as Vec3,
|
|
257
|
-
});
|
|
258
|
-
flipped.set(a, axis);
|
|
259
|
-
}
|
|
260
|
-
const sense = d.sense === '+' ? '-' : d.sense === '-' ? '+' : undefined;
|
|
261
|
-
return Object.freeze({ ...d, axis, ...(sense ? { sense } : {}) });
|
|
262
|
-
}
|
|
263
|
-
|
|
264
251
|
/**
|
|
265
252
|
* Each operation of the point group described geometrically, in the order of `operations` for
|
|
266
|
-
* the same key and options.
|
|
267
|
-
*
|
|
268
|
-
*
|
|
253
|
+
* the same key and options. An axis lies along a symmetry direction and has the sign of the
|
|
254
|
+
* operation's Seitz symbol (ITA 6th ed., Tables 1.4.2.1–1.4.2.3, p. 52), e.g. [1, 1, 0] for 2₁₁₀ in
|
|
255
|
+
* the hexagonal family, where ITA Table 2.1.3.1 lists [1̄, 1̄, 0]; for n ≥ 3 the sign fixes what the
|
|
256
|
+
* sense refers to.
|
|
269
257
|
*/
|
|
270
258
|
export function describeOperations(
|
|
271
259
|
key: MagneticPointGroupKey,
|
|
272
260
|
options?: SettingOptions,
|
|
273
261
|
): readonly OperationDescription[] {
|
|
262
|
+
checkOptions(options, SETTING_KEYS, 'describeOperations');
|
|
274
263
|
return analysis(key, options).descriptions;
|
|
275
264
|
}
|
|
276
265
|
|
|
277
266
|
/**
|
|
278
|
-
* The positions of the full Hermann–Mauguin symbol in the requested
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
* without `symbol`); the triclinic family has none.
|
|
282
|
-
*
|
|
283
|
-
*
|
|
267
|
+
* The positions of the full Hermann–Mauguin symbol in the requested setting, each with its
|
|
268
|
+
* symmetry directions (ITA Table 2.1.3.1) and the symmetry elements along them. All positions of the
|
|
269
|
+
* crystal family are listed (for rhombohedral axes the two of that row of the table), also those the
|
|
270
|
+
* symbol of the class leaves out (then without `symbol`); the triclinic family has none. A direction
|
|
271
|
+
* has the sign of ITA Table 2.1.3.1, the axis of an operation along it that of its Seitz symbol, so
|
|
272
|
+
* the two are parallel and may be opposite: match them by direction, up to sign.
|
|
284
273
|
*/
|
|
285
274
|
export function symmetryDirections(key: MagneticPointGroupKey, options?: SettingOptions): readonly SymmetryDirection[] {
|
|
275
|
+
checkOptions(options, SETTING_KEYS, 'symmetryDirections');
|
|
286
276
|
return analysis(key, options).directions;
|
|
287
277
|
}
|