symcrys 0.4.0 → 0.6.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 +15 -132
- package/dist/crystalClasses.d.ts +211 -0
- package/dist/crystalClasses.d.ts.map +1 -0
- package/dist/crystalClasses.js +295 -0
- package/dist/crystalClasses.js.map +1 -0
- package/dist/index.d.ts +11 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -8
- package/dist/index.js.map +1 -1
- package/dist/magnetic.d.ts +35 -0
- package/dist/magnetic.d.ts.map +1 -0
- package/dist/magnetic.js +22 -0
- package/dist/magnetic.js.map +1 -0
- package/dist/operations.d.ts +8 -0
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +25 -0
- package/dist/operations.js.map +1 -1
- package/dist/pointGroups/data.d.ts +34 -0
- package/dist/pointGroups/data.d.ts.map +1 -1
- package/dist/pointGroups/data.js +29 -21
- package/dist/pointGroups/data.js.map +1 -1
- package/dist/pointGroups/elements.d.ts +12 -5
- package/dist/pointGroups/elements.d.ts.map +1 -1
- package/dist/pointGroups/elements.js +6 -1
- package/dist/pointGroups/elements.js.map +1 -1
- package/dist/pointGroups/magneticData.d.ts +61 -0
- package/dist/pointGroups/magneticData.d.ts.map +1 -0
- package/dist/pointGroups/magneticData.js +180 -0
- package/dist/pointGroups/magneticData.js.map +1 -0
- package/dist/pointGroups/magneticSymbols.d.ts +22 -0
- package/dist/pointGroups/magneticSymbols.d.ts.map +1 -0
- package/dist/pointGroups/magneticSymbols.js +103 -0
- package/dist/pointGroups/magneticSymbols.js.map +1 -0
- package/dist/pointGroups/pointGroups.d.ts +94 -24
- package/dist/pointGroups/pointGroups.d.ts.map +1 -1
- package/dist/pointGroups/pointGroups.js +293 -47
- package/dist/pointGroups/pointGroups.js.map +1 -1
- package/dist/pointGroups/properties.d.ts +25 -16
- package/dist/pointGroups/properties.d.ts.map +1 -1
- package/dist/pointGroups/properties.js +46 -56
- package/dist/pointGroups/properties.js.map +1 -1
- package/dist/pointGroups/wyckoff.d.ts +2 -1
- package/dist/pointGroups/wyckoff.d.ts.map +1 -1
- package/dist/pointGroups/wyckoff.js +6 -2
- package/dist/pointGroups/wyckoff.js.map +1 -1
- package/dist/tensors/propertyTable.d.ts +35 -0
- package/dist/tensors/propertyTable.d.ts.map +1 -0
- package/dist/tensors/propertyTable.js +32 -0
- package/dist/tensors/propertyTable.js.map +1 -0
- package/dist/tensors/tensorForm.d.ts +16 -10
- package/dist/tensors/tensorForm.d.ts.map +1 -1
- package/dist/tensors/tensorForm.js +23 -24
- package/dist/tensors/tensorForm.js.map +1 -1
- package/dist/tensors/tensorProperties.d.ts +30 -0
- package/dist/tensors/tensorProperties.d.ts.map +1 -0
- package/dist/tensors/tensorProperties.js +44 -0
- package/dist/tensors/tensorProperties.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +9 -26
- package/src/crystalClasses.ts +436 -0
- package/src/index.ts +32 -38
- package/src/magnetic.ts +87 -0
- package/src/operations.ts +29 -0
- package/src/pointGroups/data.ts +29 -21
- package/src/pointGroups/elements.ts +23 -7
- package/src/pointGroups/magneticData.ts +322 -0
- package/src/pointGroups/magneticSymbols.ts +110 -0
- package/src/pointGroups/pointGroups.ts +380 -65
- package/src/pointGroups/properties.ts +47 -56
- package/src/pointGroups/wyckoff.ts +15 -2
- package/src/tensors/propertyTable.ts +79 -0
- package/src/tensors/tensorForm.ts +34 -28
- package/src/tensors/tensorProperties.ts +50 -0
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -1,149 +1,32 @@
|
|
|
1
1
|
# symcrys
|
|
2
2
|
|
|
3
|
-
Crystallographic symmetry calculations in TypeScript: point groups
|
|
4
|
-
|
|
5
|
-
library without runtime dependencies that runs unbundled in browsers and in Node.
|
|
6
|
-
|
|
7
|
-
> **Status: pre-release.** So far: the 32 crystallographic point groups with their symmetry elements,
|
|
8
|
-
> site symmetry and Wyckoff positions, and the forms of property tensors of rank 0 to 4.
|
|
9
|
-
> The API will change without notice until 1.0.0.
|
|
10
|
-
|
|
11
|
-
## Scope
|
|
12
|
-
|
|
13
|
-
symcrys holds calculations, not presentation. Planned, in this order:
|
|
14
|
-
|
|
15
|
-
1. Point groups: the 32 crystallographic and the 122 magnetic point groups as data (generators),
|
|
16
|
-
group generation, settings, Hermann–Mauguin, Schoenflies and Shubnikov symbols, derived
|
|
17
|
-
properties (centrosymmetric, polar, chiral, magnetoelectric …), subgroups.
|
|
18
|
-
2. Plane groups.
|
|
19
|
-
3. Space groups.
|
|
20
|
-
|
|
21
|
-
Property tensors: the symmetry-reduced form of a tensor of rank 0 to 4 under a point group or any
|
|
22
|
-
set of operations, from birss-app; results are numbers (coefficient matrices). Rendering (LaTeX,
|
|
23
|
-
SVG, relation strings, view models) and translated display names stay in the applications that use
|
|
24
|
-
symcrys.
|
|
25
|
-
|
|
26
|
-
**Conventions.** Point groups follow the _International Tables for Crystallography_ by default
|
|
27
|
-
(Vol. A for the crystal classes, Vol. D Ch. 1.5 for the magnetic point groups). The convention of
|
|
28
|
-
Birss, _Symmetry and Magnetism_ (1966), is available as an option. Where the two differ is
|
|
29
|
-
documented in [`docs/conventions.md`](docs/conventions.md).
|
|
30
|
-
|
|
31
|
-
symcrys is the computational core of the crystallography teaching apps
|
|
32
|
-
([stereography](https://github.com/manganite/stereography),
|
|
33
|
-
[plane-groups](https://github.com/manganite/plane-groups)) and of
|
|
34
|
-
[birss-app](https://github.com/manganite/birss-app); its calculations start from those of
|
|
35
|
-
birss-app.
|
|
36
|
-
|
|
37
|
-
## Use
|
|
3
|
+
Crystallographic symmetry calculations in TypeScript: point groups with their settings, symbols,
|
|
4
|
+
symmetry elements, site symmetry and Wyckoff positions, and the forms of property tensors they
|
|
5
|
+
allow. A library without runtime dependencies that runs unbundled in browsers and in Node.
|
|
38
6
|
|
|
39
7
|
```bash
|
|
40
8
|
npm install symcrys
|
|
41
9
|
```
|
|
42
10
|
|
|
43
|
-
Each release on GitHub also carries the package as `symcrys-X.Y.Z.tgz`.
|
|
44
|
-
|
|
45
11
|
```ts
|
|
46
|
-
import {
|
|
47
|
-
describeOperations,
|
|
48
|
-
isPiezoelectric,
|
|
49
|
-
operations,
|
|
50
|
-
settings,
|
|
51
|
-
siteSymmetry,
|
|
52
|
-
symbol,
|
|
53
|
-
symmetryDirections,
|
|
54
|
-
tensorForm,
|
|
55
|
-
tensorFormOf,
|
|
56
|
-
wyckoffPositionOf,
|
|
57
|
-
wyckoffPositions,
|
|
58
|
-
} from 'symcrys';
|
|
12
|
+
import { operations, symbol, tensorForm } from 'symcrys';
|
|
59
13
|
|
|
60
14
|
symbol('32'); // '321': ITC short symbol of the default setting
|
|
61
|
-
symbol('32', { convention: 'birss' }); // '32'
|
|
62
|
-
settings('32'); // setting 1: 312, setting 2: 321 (the ITC default)
|
|
63
15
|
operations('-3m'); // 12 operations, Cartesian matrices; x ∥ a, z ∥ c
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
wyckoffPositions('4mm')[2]; // { letter: 'b', multiplicity: 4, siteSymmetry: '..m', millerIndices: 'h,h,l', … }
|
|
67
|
-
wyckoffPositionOf('4mm', [0, 0, -1]).letter; // 'a'
|
|
68
|
-
|
|
69
|
-
const SHG = { rank: 3, parity: 'polar', timeParity: 'i', intrinsic: 'jk' } as const;
|
|
70
|
-
tensorForm('mm2', SHG).parameters; // [[0,0,2], [1,1,2], [2,0,0], [2,1,1], [2,2,2]]: xxz, yyz, zxx, zyy, zzz
|
|
71
|
-
tensorForm('3m', SHG, { convention: 'birss' }).parameters[0]; // [0, 0, 0]: xxx (ITC default 3m1: xxy)
|
|
72
|
-
isPiezoelectric('432'); // false
|
|
73
|
-
// SHG at the (111) surface of an m-3m crystal: the form under the site symmetry of the normal
|
|
74
|
-
const ops = operations('m-3m');
|
|
75
|
-
tensorFormOf(
|
|
76
|
-
siteSymmetry(ops, [1, 1, 1]).operations.map((i) => ops[i]),
|
|
77
|
-
SHG,
|
|
78
|
-
).basis.length; // 4
|
|
16
|
+
tensorForm('mm2', { rank: 3, parity: 'polar', intrinsic: 'jk' }).parameters;
|
|
17
|
+
// [[0,0,2], [1,1,2], [2,0,0], [2,1,1], [2,2,2]]: xxz, yyz, zxx, zyy, zzz
|
|
79
18
|
```
|
|
80
19
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
Conventions, frames and symbols: [`docs/conventions.md`](docs/conventions.md).
|
|
86
|
-
|
|
87
|
-
Without a build step, copy `dist/` (from the tarball, or built with `npm run build`) next to your
|
|
88
|
-
code and import `dist/index.js` directly: every module in `dist/` imports only relative `.js`
|
|
89
|
-
paths.
|
|
20
|
+
`symcrys` is the crystallographic API: the 32 crystal classes, without time reversal. The 122
|
|
21
|
+
magnetic point groups are in `symcrys/magnetic`, under the same function names; there `'32'` is a
|
|
22
|
+
white group, and a crystal without magnetic order has the grey group of its class:
|
|
90
23
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
Development requires Node 22 (22.13 or later) or 24; CI runs on both. The library itself needs only
|
|
94
|
-
an ES2022 runtime with ES modules.
|
|
24
|
+
```ts
|
|
25
|
+
import { allowedProperties } from 'symcrys/magnetic';
|
|
95
26
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
npm run typecheck # TypeScript 6: tests and scripts with Node types, library code without
|
|
99
|
-
npm run typecheck:ts7 # the same with TypeScript 7
|
|
100
|
-
npm run lint # ESLint
|
|
101
|
-
npm run format:check # Prettier (npm run format fixes)
|
|
102
|
-
npm test # vitest
|
|
103
|
-
npm run build # dist/: JavaScript, .d.ts, source maps
|
|
104
|
-
npm run check:dist # dist/ loads, imports only relative .js paths, has no test-only code
|
|
27
|
+
allowedProperties("321'"); // ['piezoelectric', 'gyrotropic']: quartz
|
|
28
|
+
allowedProperties("m'm'2"); // six of the seven names, 'ferromagnetic' among them
|
|
105
29
|
```
|
|
106
30
|
|
|
107
|
-
|
|
108
|
-
[
|
|
109
|
-
[stereography](https://github.com/manganite/stereography) checked out next to this repository:
|
|
110
|
-
`npm run audit:point-groups` writes `audit/point-groups/report.md`, and `npm run audit:birss-app`
|
|
111
|
-
captures the pins of the Birss convention as JSON (`src/pointGroups/birssApp.pins.json` for the
|
|
112
|
-
operations, `src/tensors/birssApp.pins.json` for the tensor forms).
|
|
113
|
-
|
|
114
|
-
CI runs these seven gates on every pull request, on Node 22 and 24. Tests sit next to their
|
|
115
|
-
module (`foo.ts`, `foo.test.ts`). Working rules for contributors, human or agent: `CLAUDE.md`.
|
|
116
|
-
|
|
117
|
-
## Releases
|
|
118
|
-
|
|
119
|
-
1. Release PR: version in `package.json`, `package-lock.json` (`npm install --package-lock-only`)
|
|
120
|
-
and `src/version.ts`; move the `Unreleased` entries of `CHANGELOG.md` under
|
|
121
|
-
`## [X.Y.Z] - YYYY-MM-DD` and update the link definitions at the bottom (`[Unreleased]` compares
|
|
122
|
-
`vX.Y.Z...HEAD`, `[X.Y.Z]` compares the previous tag with `vX.Y.Z`).
|
|
123
|
-
2. After the merge: `git fetch origin`, check that `origin/main` is the merge commit of the release PR,
|
|
124
|
-
then `git tag -a vX.Y.Z -m "symcrys X.Y.Z" origin/main && git push origin vX.Y.Z`.
|
|
125
|
-
3. The tag runs `.github/workflows/release.yml`: it checks that the tag matches `package.json`,
|
|
126
|
-
runs all gates, and creates the GitHub release with the `CHANGELOG.md` section as notes and the
|
|
127
|
-
`npm pack` tarball attached. Check that the workflow is green and the release carries
|
|
128
|
-
`symcrys-X.Y.Z.tgz`.
|
|
129
|
-
|
|
130
|
-
**npm.** The `npm` job of `release.yml` submits the same tarball to npm as a staged version
|
|
131
|
-
(trusted publishing, no token). Its log shows the tarball's shasum and integrity and the stage id. The version
|
|
132
|
-
goes live only after approval with two-factor authentication (npm 11.15 or later):
|
|
133
|
-
|
|
134
|
-
1. `npm stage list symcrys`, then `npm stage view <stage-id>`: version and shasum must match the log
|
|
135
|
-
of the `npm` job (or "Staged Packages" on npmjs.com).
|
|
136
|
-
2. `npm stage approve <stage-id>`. npm first runs an automated review of the staged version; until
|
|
137
|
-
it has finished, approval fails with `E409 … automated review hasn't finished`. Then approve again
|
|
138
|
-
a little later (for 0.1.1 it took a few minutes).
|
|
139
|
-
3. `npm view symcrys` shows the version as `latest`.
|
|
140
|
-
|
|
141
|
-
If staging fails, re-run the `npm` job (a staged version cannot be staged twice, so check
|
|
142
|
-
`npm stage list` first). An authentication error usually means the trusted publisher on npmjs.com
|
|
143
|
-
does not match (repository, workflow `release.yml`); the stage step runs with `--loglevel verbose`,
|
|
144
|
-
so its log shows the OIDC exchange. As a fallback, stage the release asset by hand:
|
|
145
|
-
`npm stage publish ./symcrys-X.Y.Z.tgz` (then without provenance, which only CI can attest).
|
|
146
|
-
|
|
147
|
-
## Licence
|
|
148
|
-
|
|
149
|
-
[MIT](LICENSE) © 2026 Thomas Lottermoser
|
|
31
|
+
Documentation, conventions (ITC and Birss) and their print sources, and the Python package of the
|
|
32
|
+
same version: [github.com/manganite/symcrys](https://github.com/manganite/symcrys).
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The crystallographic API: the 32 crystal classes, without time reversal. It is what `index.ts`
|
|
3
|
+
* exports. Nothing here mentions time reversal: an operation is its matrix, a tensor has no time
|
|
4
|
+
* parity, and the named properties are those of time-even tensors. A question that involves time
|
|
5
|
+
* reversal (a magnetic point group, a time-odd tensor or property, an operation combined with time
|
|
6
|
+
* reversal) is a RangeError that names the magnetic API (`magnetic.ts`, `symcrys/magnetic`), where
|
|
7
|
+
* the key `'32'` is the white group and a crystal without magnetic order has the grey group of its
|
|
8
|
+
* class (`"321'"`; docs/conventions.md, "Two entry points").
|
|
9
|
+
*
|
|
10
|
+
* Everything is computed by the modules that serve both entry points; this module checks what
|
|
11
|
+
* comes in and leaves time reversal out of what goes back.
|
|
12
|
+
*/
|
|
13
|
+
import type { CrystalSystem } from './lattice.js';
|
|
14
|
+
import type { Mat3, Vec3 } from './linalg.js';
|
|
15
|
+
import * as elements from './pointGroups/elements.js';
|
|
16
|
+
import type { Convention, PointGroupKey, Setting, SettingOptions, SymbolOptions } from './pointGroups/pointGroups.js';
|
|
17
|
+
import * as wyckoff from './pointGroups/wyckoff.js';
|
|
18
|
+
import * as site from './siteSymmetry.js';
|
|
19
|
+
import type { TensorPropertyName as MagneticTensorPropertyName } from './tensors/propertyTable.js';
|
|
20
|
+
import type { IntrinsicSymmetry, TensorForm, TensorParity, TensorRank } from './tensors/tensorForm.js';
|
|
21
|
+
/** A point operation: an orthogonal Cartesian matrix (rotation, rotoinversion, mirror, inversion). */
|
|
22
|
+
export interface Operation {
|
|
23
|
+
readonly matrix: Mat3;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A crystal class with the properties that are fixed by its operations. None of them depends on
|
|
27
|
+
* the setting or the convention (docs/conventions.md, "Properties").
|
|
28
|
+
*/
|
|
29
|
+
export interface PointGroup {
|
|
30
|
+
readonly key: PointGroupKey;
|
|
31
|
+
readonly crystalSystem: CrystalSystem;
|
|
32
|
+
/** Number of operations. */
|
|
33
|
+
readonly order: number;
|
|
34
|
+
/** Contains the inversion. */
|
|
35
|
+
readonly centrosymmetric: boolean;
|
|
36
|
+
/** Polar (pyroelectric class): some direction is left unchanged by every operation. */
|
|
37
|
+
readonly polar: boolean;
|
|
38
|
+
/** Chiral (enantiomorphic class): proper rotations only. */
|
|
39
|
+
readonly chiral: boolean;
|
|
40
|
+
/** The Laue class: the centrosymmetric crystal class generated by the class and the inversion. */
|
|
41
|
+
readonly laueClass: PointGroupKey;
|
|
42
|
+
}
|
|
43
|
+
/** A crystal class in a given setting. */
|
|
44
|
+
export interface PointGroupInSetting {
|
|
45
|
+
readonly key: PointGroupKey;
|
|
46
|
+
readonly setting: number;
|
|
47
|
+
}
|
|
48
|
+
/** One point operation described geometrically. */
|
|
49
|
+
export type OperationDescription = Omit<elements.OperationDescription, 'timeReversal'>;
|
|
50
|
+
/** The kind of tensor. */
|
|
51
|
+
export interface TensorSpec {
|
|
52
|
+
readonly rank: TensorRank;
|
|
53
|
+
readonly parity: TensorParity;
|
|
54
|
+
readonly intrinsic: IntrinsicSymmetry;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* An operation as a caller may pass it: its matrix. `timeReversal: false` is accepted, so that an
|
|
58
|
+
* operation of the magnetic API without time reversal can be handed on from plain JavaScript; with
|
|
59
|
+
* `timeReversal: true` it is refused, at compile time and at run time.
|
|
60
|
+
*/
|
|
61
|
+
type OperationArgument = Operation & {
|
|
62
|
+
readonly timeReversal?: false;
|
|
63
|
+
};
|
|
64
|
+
/** A tensor specification as a caller may pass it; `timeParity: 'i'` is accepted, `'c'` refused. */
|
|
65
|
+
type TensorSpecArgument = TensorSpec & {
|
|
66
|
+
readonly timeParity?: 'i';
|
|
67
|
+
};
|
|
68
|
+
export interface TensorProperty {
|
|
69
|
+
/** The kind of tensor whose non-zero form means that the property is allowed. */
|
|
70
|
+
readonly spec: TensorSpec;
|
|
71
|
+
/** The physical quantity the tensor relates. */
|
|
72
|
+
readonly description: string;
|
|
73
|
+
/** Print source of the definition, with printed page. */
|
|
74
|
+
readonly source: string;
|
|
75
|
+
}
|
|
76
|
+
/** Name of a tensor property in `TENSOR_PROPERTIES`. */
|
|
77
|
+
export type TensorPropertyName = Extract<MagneticTensorPropertyName, 'pyroelectric' | 'ferroaxial' | 'piezoelectric' | 'gyrotropic'>;
|
|
78
|
+
/**
|
|
79
|
+
* The named tensor properties of the crystal classes: those of time-even tensors. `'gyrotropic'`
|
|
80
|
+
* is optical activity. The properties of time-odd tensors (`'ferromagnetic'`, …) are in the
|
|
81
|
+
* magnetic API.
|
|
82
|
+
*/
|
|
83
|
+
export declare const TENSOR_PROPERTIES: Readonly<Record<TensorPropertyName, TensorProperty>>;
|
|
84
|
+
export { POINT_GROUP_KEYS } from './pointGroups/pointGroups.js';
|
|
85
|
+
/** True if `key` is the key of one of the 32 crystal classes. */
|
|
86
|
+
export declare function isPointGroupKey(key: string): key is PointGroupKey;
|
|
87
|
+
/** The crystal class with this key. Throws a RangeError for an unknown key. */
|
|
88
|
+
export declare function pointGroup(key: PointGroupKey): PointGroup;
|
|
89
|
+
/** All 32 crystal classes, in the order of `POINT_GROUP_KEYS` (by crystal system, as in ITA). */
|
|
90
|
+
export declare function pointGroups(): readonly PointGroup[];
|
|
91
|
+
/**
|
|
92
|
+
* Finds a crystal class by a Hermann–Mauguin symbol in the given convention (default `'itc'`): the
|
|
93
|
+
* short symbol of a setting, a full symbol, or the key (spaces are ignored). A symbol that names
|
|
94
|
+
* one setting gives that setting; the key, and a short symbol that several settings share (the
|
|
95
|
+
* monoclinic ones: `2` for unique axis b and c), give the default setting of the convention.
|
|
96
|
+
* Returns undefined if nothing matches, also for a value that is not a string and for the
|
|
97
|
+
* symbol of a magnetic group with time reversal. Symbols are written as in this library: `-` for
|
|
98
|
+
* the overbar, also in the Birss convention (`m-3m`, where Birss prints `m3m`; docs/conventions.md,
|
|
99
|
+
* "Where ITC and Birss differ").
|
|
100
|
+
*/
|
|
101
|
+
export declare function findPointGroup(hm: string, conventionName?: Convention): PointGroupInSetting | undefined;
|
|
102
|
+
/** The settings of a crystal class, with symbols and the default of the given convention (default `'itc'`). */
|
|
103
|
+
export declare function settings(key: PointGroupKey, conventionName?: Convention): readonly Setting[];
|
|
104
|
+
/**
|
|
105
|
+
* All operations of the crystal class in the requested setting (default: the convention's default
|
|
106
|
+
* setting). ITC convention: in ITA's order, identity first, then as ITA numbers the general
|
|
107
|
+
* position. Birss convention: in birss-app's order (docs/conventions.md, "Order of the
|
|
108
|
+
* operations"). The matrices are Cartesian (docs/conventions.md, "Cartesian frame").
|
|
109
|
+
*/
|
|
110
|
+
export declare function operations(key: PointGroupKey, options?: SettingOptions): readonly Operation[];
|
|
111
|
+
/**
|
|
112
|
+
* Generators of the crystal class in the requested setting (docs/conventions.md, "Generators"). ITC
|
|
113
|
+
* convention: ITA's selected generators in printed order, without the identity and ITA's lattice
|
|
114
|
+
* translations, so the list is empty for `1`; for `mm2` settings 2 and 3, which ITA does not list,
|
|
115
|
+
* those of setting 1 carried into their frame. Birss convention: birss-app's generators (for `1`
|
|
116
|
+
* the identity, as in birss-app).
|
|
117
|
+
*/
|
|
118
|
+
export declare function generators(key: PointGroupKey, options?: SettingOptions): readonly Operation[];
|
|
119
|
+
/** A symbol of the crystal class in the requested convention and setting. */
|
|
120
|
+
export declare function symbol(key: PointGroupKey, options?: SymbolOptions): string;
|
|
121
|
+
export { holohedry } from './pointGroups/properties.js';
|
|
122
|
+
/**
|
|
123
|
+
* True if the group generated by `operations` contains the inversion, e.g. for the operations of a
|
|
124
|
+
* distorted crystal. A list that is not closed is closed first. For a crystal class, read
|
|
125
|
+
* `pointGroup(key).centrosymmetric`.
|
|
126
|
+
*/
|
|
127
|
+
export declare function isCentrosymmetricOf(operations: readonly OperationArgument[]): boolean;
|
|
128
|
+
/**
|
|
129
|
+
* True if the group generated by `operations` is chiral: proper rotations only. For a crystal
|
|
130
|
+
* class, read `pointGroup(key).chiral`. Polar is the named property `'pyroelectric'`:
|
|
131
|
+
* `allowsPropertyOf(operations, 'pyroelectric')`.
|
|
132
|
+
*/
|
|
133
|
+
export declare function isChiralOf(operations: readonly OperationArgument[]): boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Each operation of the crystal class described geometrically, in the order of `operations` for
|
|
136
|
+
* the same key and options. Axes are named by the symmetry direction they lie along: in the ITC
|
|
137
|
+
* convention with the sign of ITA Table 2.1.3.1, in the Birss convention signed as birss-app signs
|
|
138
|
+
* them (first non-zero Cartesian component positive); the sign fixes what the sense refers to.
|
|
139
|
+
*/
|
|
140
|
+
export declare function describeOperations(key: PointGroupKey, options?: SettingOptions): readonly OperationDescription[];
|
|
141
|
+
/**
|
|
142
|
+
* The positions of the full Hermann–Mauguin symbol in the requested convention and setting, each
|
|
143
|
+
* with its symmetry directions (ITA Table 2.1.3.1) and the symmetry elements along them. All
|
|
144
|
+
* positions of the crystal family are listed, also those the symbol of the class leaves out (then
|
|
145
|
+
* without `symbol`); the triclinic family has none. The directions keep the sign of Table 2.1.3.1
|
|
146
|
+
* in both conventions; in the Birss convention an axis of `describeOperations` may be reversed, so
|
|
147
|
+
* match it to a direction by |dot| = 1, not by identity.
|
|
148
|
+
*/
|
|
149
|
+
export declare function symmetryDirections(key: PointGroupKey, options?: SettingOptions): readonly elements.SymmetryDirection[];
|
|
150
|
+
/**
|
|
151
|
+
* The site symmetry of `direction` (any non-zero vector, Cartesian) under `operations`, which may
|
|
152
|
+
* be any list of point operations (for instance those of a distorted crystal). The operations
|
|
153
|
+
* fixing the direction within the tolerance are closed under the products found in the list and
|
|
154
|
+
* the direction is set onto their fixed space, repeated until stable, so that for a group the
|
|
155
|
+
* result is a subgroup and the set direction lies exactly on its elements. For a list that is not a
|
|
156
|
+
* group, `multiplicity` may not be an integer. Throws a RangeError for a zero vector, and if the
|
|
157
|
+
* closed operations fix no common direction (a tolerance far too large, e.g. 0.5).
|
|
158
|
+
*/
|
|
159
|
+
export declare function siteSymmetry(operations: readonly OperationArgument[], direction: Vec3, options?: site.SiteSymmetryOptions): site.SiteSymmetry;
|
|
160
|
+
/**
|
|
161
|
+
* The Wyckoff positions of a crystal class for directions, as ITA tabulates them (general position
|
|
162
|
+
* first), in the ITC convention only (docs/conventions.md, "Site symmetry and Wyckoff positions").
|
|
163
|
+
*/
|
|
164
|
+
export declare function wyckoffPositions(key: PointGroupKey, options?: SettingOptions): readonly wyckoff.WyckoffPosition[];
|
|
165
|
+
/**
|
|
166
|
+
* The Wyckoff position of a direction (Cartesian) in a crystal class: the position whose site
|
|
167
|
+
* symmetry is conjugate to that of the direction (ITA's definition). `tolerance` as for
|
|
168
|
+
* `siteSymmetry`.
|
|
169
|
+
*/
|
|
170
|
+
export declare function wyckoffPositionOf(key: PointGroupKey, direction: Vec3, options?: wyckoff.WyckoffOptions): wyckoff.WyckoffPosition;
|
|
171
|
+
/**
|
|
172
|
+
* The form of a tensor under a crystal class in the requested setting (default: the default
|
|
173
|
+
* setting of the convention, `'itc'` unless given). The tensor is given by its specification or by
|
|
174
|
+
* the name of a property in `TENSOR_PROPERTIES` (`'piezoelectric'`). The convention matters only
|
|
175
|
+
* through the setting: the same setting index gives the same form in both conventions
|
|
176
|
+
* (docs/conventions.md, "Tensors").
|
|
177
|
+
*/
|
|
178
|
+
export declare function tensorForm(key: PointGroupKey, spec: TensorSpecArgument | TensorPropertyName, options?: SettingOptions): TensorForm;
|
|
179
|
+
/**
|
|
180
|
+
* The form of a tensor under the group generated by `operations`, e.g. the site symmetry of a
|
|
181
|
+
* surface normal (`siteSymmetry`) or the operations of a distorted crystal. The tensor is given by
|
|
182
|
+
* its specification or by the name of a property in `TENSOR_PROPERTIES`. The operations are
|
|
183
|
+
* Cartesian and orthogonal; a list that is not closed is closed first.
|
|
184
|
+
*/
|
|
185
|
+
export declare function tensorFormOf(operations: readonly OperationArgument[], spec: TensorSpecArgument | TensorPropertyName): TensorForm;
|
|
186
|
+
/**
|
|
187
|
+
* The components of `tensor` (length 3^rank, flat index) in a frame rotated by the orthogonal
|
|
188
|
+
* matrix `rotation`: t′_{i…} = f·Σ R_{ia}…R_{…}·t_{a…}, with f = det(R) for an axial tensor and 1
|
|
189
|
+
* for a polar one. To express a tensor in the frame of a surface, pass the matrix whose rows are
|
|
190
|
+
* the new axes in the old frame. The kind of tensor is given by its specification or by the name
|
|
191
|
+
* of a property in `TENSOR_PROPERTIES`.
|
|
192
|
+
*/
|
|
193
|
+
export declare function rotateTensor(tensor: readonly number[], rotation: Mat3, specOrName: TensorSpecArgument | TensorPropertyName): number[];
|
|
194
|
+
/**
|
|
195
|
+
* True if the crystal class allows the named property, e.g. `allowsProperty('-6m2',
|
|
196
|
+
* 'piezoelectric')`: the tensor that describes it (`TENSOR_PROPERTIES`) has a non-zero form under
|
|
197
|
+
* the class. Symmetry only allows a property; whether a crystal shows it is a question of the
|
|
198
|
+
* material. It does not depend on setting or convention. Throws a RangeError for an unknown key or
|
|
199
|
+
* name.
|
|
200
|
+
*/
|
|
201
|
+
export declare function allowsProperty(key: PointGroupKey, name: TensorPropertyName): boolean;
|
|
202
|
+
/** The named properties the crystal class allows, in the order of `TENSOR_PROPERTIES`. */
|
|
203
|
+
export declare function allowedProperties(key: PointGroupKey): TensorPropertyName[];
|
|
204
|
+
/**
|
|
205
|
+
* True if the group generated by `operations` allows the named property, e.g. for the site
|
|
206
|
+
* symmetry of a surface normal or the operations of a distorted crystal.
|
|
207
|
+
*/
|
|
208
|
+
export declare function allowsPropertyOf(operations: readonly OperationArgument[], name: TensorPropertyName): boolean;
|
|
209
|
+
/** The named properties the group generated by `operations` allows. */
|
|
210
|
+
export declare function allowedPropertiesOf(operations: readonly OperationArgument[]): TensorPropertyName[];
|
|
211
|
+
//# sourceMappingURL=crystalClasses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crystalClasses.d.ts","sourceRoot":"","sources":["../src/crystalClasses.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,KAAK,QAAQ,MAAM,2BAA2B,CAAC;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAEtH,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAC;AACpD,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAE1C,OAAO,KAAK,EAAE,kBAAkB,IAAI,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAEnG,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAKvG,sGAAsG;AACtG,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,MAAM,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