@mat3ra/made 2024.3.22-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 (176) hide show
  1. package/.babelrc +10 -0
  2. package/.eslintrc.json +11 -0
  3. package/.mocharc.json +5 -0
  4. package/.prettierignore +1 -0
  5. package/.prettierrc +6 -0
  6. package/LICENSE.md +15 -0
  7. package/README.md +167 -0
  8. package/dist/abstract/array_with_ids.d.ts +43 -0
  9. package/dist/abstract/array_with_ids.js +88 -0
  10. package/dist/abstract/scalar_with_id.d.ts +25 -0
  11. package/dist/abstract/scalar_with_id.js +44 -0
  12. package/dist/basis/basis.d.ts +269 -0
  13. package/dist/basis/basis.js +499 -0
  14. package/dist/basis/constrained_basis.d.ts +56 -0
  15. package/dist/basis/constrained_basis.js +90 -0
  16. package/dist/basis/types.d.ts +1 -0
  17. package/dist/basis/types.js +2 -0
  18. package/dist/cell/cell.d.ts +45 -0
  19. package/dist/cell/cell.js +88 -0
  20. package/dist/cell/conventional_cell.d.ts +22 -0
  21. package/dist/cell/conventional_cell.js +83 -0
  22. package/dist/cell/primitive_cell.d.ts +9 -0
  23. package/dist/cell/primitive_cell.js +166 -0
  24. package/dist/constants.d.ts +2 -0
  25. package/dist/constants.js +25 -0
  26. package/dist/constraints/constraints.d.ts +45 -0
  27. package/dist/constraints/constraints.js +49 -0
  28. package/dist/lattice/lattice.d.ts +104 -0
  29. package/dist/lattice/lattice.js +208 -0
  30. package/dist/lattice/lattice_bravais.d.ts +59 -0
  31. package/dist/lattice/lattice_bravais.js +120 -0
  32. package/dist/lattice/lattice_vectors.d.ts +46 -0
  33. package/dist/lattice/lattice_vectors.js +98 -0
  34. package/dist/lattice/reciprocal/lattice_reciprocal.d.ts +75 -0
  35. package/dist/lattice/reciprocal/lattice_reciprocal.js +148 -0
  36. package/dist/lattice/reciprocal/paths.d.ts +24 -0
  37. package/dist/lattice/reciprocal/paths.js +136 -0
  38. package/dist/lattice/reciprocal/symmetry_points.d.ts +8 -0
  39. package/dist/lattice/reciprocal/symmetry_points.js +866 -0
  40. package/dist/lattice/types.d.ts +49 -0
  41. package/dist/lattice/types.js +127 -0
  42. package/dist/lattice/unit_cell.d.ts +30 -0
  43. package/dist/lattice/unit_cell.js +31 -0
  44. package/dist/made.d.ts +40 -0
  45. package/dist/made.js +39 -0
  46. package/dist/material.d.ts +1562 -0
  47. package/dist/material.js +317 -0
  48. package/dist/math.d.ts +395 -0
  49. package/dist/math.js +7 -0
  50. package/dist/parsers/cif.d.ts +10 -0
  51. package/dist/parsers/cif.js +21 -0
  52. package/dist/parsers/errors.d.ts +5 -0
  53. package/dist/parsers/errors.js +11 -0
  54. package/dist/parsers/espresso.d.ts +10 -0
  55. package/dist/parsers/espresso.js +24 -0
  56. package/dist/parsers/native_format_parsers.d.ts +26 -0
  57. package/dist/parsers/native_format_parsers.js +52 -0
  58. package/dist/parsers/parsers.d.ts +13 -0
  59. package/dist/parsers/parsers.js +17 -0
  60. package/dist/parsers/poscar.d.ts +31 -0
  61. package/dist/parsers/poscar.js +180 -0
  62. package/dist/parsers/xyz.d.ts +62 -0
  63. package/dist/parsers/xyz.js +167 -0
  64. package/dist/parsers/xyz_combinatorial_basis.d.ts +64 -0
  65. package/dist/parsers/xyz_combinatorial_basis.js +241 -0
  66. package/dist/tools/basis.d.ts +22 -0
  67. package/dist/tools/basis.js +100 -0
  68. package/dist/tools/cell.d.ts +9 -0
  69. package/dist/tools/cell.js +39 -0
  70. package/dist/tools/index.d.ts +11 -0
  71. package/dist/tools/index.js +15 -0
  72. package/dist/tools/material.d.ts +25 -0
  73. package/dist/tools/material.js +54 -0
  74. package/dist/tools/supercell.d.ts +22 -0
  75. package/dist/tools/supercell.js +62 -0
  76. package/dist/tools/surface.d.ts +10 -0
  77. package/dist/tools/surface.js +147 -0
  78. package/dist/types.d.ts +3 -0
  79. package/dist/types.js +2 -0
  80. package/package.json +89 -0
  81. package/pyproject.toml +77 -0
  82. package/src/js/abstract/array_with_ids.ts +100 -0
  83. package/src/js/abstract/scalar_with_id.ts +53 -0
  84. package/src/js/basis/basis.ts +607 -0
  85. package/src/js/basis/constrained_basis.ts +107 -0
  86. package/src/js/basis/types.ts +1 -0
  87. package/src/js/cell/cell.ts +109 -0
  88. package/src/js/cell/conventional_cell.ts +89 -0
  89. package/src/js/cell/primitive_cell.ts +189 -0
  90. package/src/js/constants.js +4 -0
  91. package/src/js/constraints/constraints.ts +63 -0
  92. package/src/js/lattice/lattice.ts +229 -0
  93. package/src/js/lattice/lattice_bravais.ts +170 -0
  94. package/src/js/lattice/lattice_vectors.ts +126 -0
  95. package/src/js/lattice/reciprocal/lattice_reciprocal.js +155 -0
  96. package/src/js/lattice/reciprocal/paths.js +134 -0
  97. package/src/js/lattice/reciprocal/symmetry_points.ts +886 -0
  98. package/src/js/lattice/types.ts +142 -0
  99. package/src/js/lattice/unit_cell.ts +66 -0
  100. package/src/js/made.js +36 -0
  101. package/src/js/material.ts +398 -0
  102. package/src/js/math.js +6 -0
  103. package/src/js/parsers/cif.js +22 -0
  104. package/src/js/parsers/errors.js +7 -0
  105. package/src/js/parsers/espresso.ts +30 -0
  106. package/src/js/parsers/native_format_parsers.js +51 -0
  107. package/src/js/parsers/parsers.js +13 -0
  108. package/src/js/parsers/poscar.ts +201 -0
  109. package/src/js/parsers/xyz.ts +216 -0
  110. package/src/js/parsers/xyz_combinatorial_basis.js +243 -0
  111. package/src/js/tools/basis.js +116 -0
  112. package/src/js/tools/cell.js +36 -0
  113. package/src/js/tools/index.js +11 -0
  114. package/src/js/tools/material.js +60 -0
  115. package/src/js/tools/supercell.ts +80 -0
  116. package/src/js/tools/surface.js +176 -0
  117. package/src/js/types.ts +4 -0
  118. package/src/py/__init__.py +0 -0
  119. package/src/py/mat3ra/__init__.py +0 -0
  120. package/src/py/mat3ra/made/__init__.py +5 -0
  121. package/tests/.gitattributes +1 -0
  122. package/tests/fixtures/AsGe-basis.json +3 -0
  123. package/tests/fixtures/C2H4-translated.json +3 -0
  124. package/tests/fixtures/C2H4.json +3 -0
  125. package/tests/fixtures/FeLiSi-basis.json +3 -0
  126. package/tests/fixtures/FeO.json +3 -0
  127. package/tests/fixtures/Ge2-basis.json +3 -0
  128. package/tests/fixtures/Graphene.json +3 -0
  129. package/tests/fixtures/Graphene.poscar +3 -0
  130. package/tests/fixtures/H2+H-final.json +3 -0
  131. package/tests/fixtures/H2+H-image.json +3 -0
  132. package/tests/fixtures/H2+H-initial.json +3 -0
  133. package/tests/fixtures/H2O.poscar +3 -0
  134. package/tests/fixtures/LiFeSi-basis.json +3 -0
  135. package/tests/fixtures/Na.json +3 -0
  136. package/tests/fixtures/Na4Cl4-cartesian.json +3 -0
  137. package/tests/fixtures/Na4Cl4.json +3 -0
  138. package/tests/fixtures/Na4Cl4.poscar +3 -0
  139. package/tests/fixtures/Ni-hex.json +3 -0
  140. package/tests/fixtures/Ni-hex.poscar +3 -0
  141. package/tests/fixtures/OSi-basis.json +3 -0
  142. package/tests/fixtures/Si-hex.json +3 -0
  143. package/tests/fixtures/Si-hex.poscar +3 -0
  144. package/tests/fixtures/Si-pwscf.in +3 -0
  145. package/tests/fixtures/Si-slab.json +3 -0
  146. package/tests/fixtures/Si-supercell.json +3 -0
  147. package/tests/fixtures/Si.json +3 -0
  148. package/tests/fixtures/Si2-basis-repeated.json +3 -0
  149. package/tests/fixtures/Si2-basis.json +3 -0
  150. package/tests/fixtures/Zr1H23Zr1H1.json +3 -0
  151. package/tests/fixtures/Zr1H23Zr1H1.poscar +3 -0
  152. package/tests/fixtures/atomic-constraints.json +3 -0
  153. package/tests/js/basis/basis.js +221 -0
  154. package/tests/js/cell/cell.js +21 -0
  155. package/tests/js/cell/primitive_cell.js +17 -0
  156. package/tests/js/constraints/constraints.js +27 -0
  157. package/tests/js/enums.js +40 -0
  158. package/tests/js/lattice/lattice.js +31 -0
  159. package/tests/js/lattice/lattice_bravais.js +17 -0
  160. package/tests/js/lattice/lattice_reciprocal.js +99 -0
  161. package/tests/js/lattice/lattice_vectors.js +10 -0
  162. package/tests/js/material.test.js +11 -0
  163. package/tests/js/parsers/espresso.js +12 -0
  164. package/tests/js/parsers/native_formats.js +30 -0
  165. package/tests/js/parsers/poscar.js +21 -0
  166. package/tests/js/parsers/xyz.js +25 -0
  167. package/tests/js/parsers/xyz_combinatorial_basis.js +153 -0
  168. package/tests/js/setup.js +6 -0
  169. package/tests/js/tools/basis.js +18 -0
  170. package/tests/js/tools/supercell.js +23 -0
  171. package/tests/js/tools/surface.js +12 -0
  172. package/tests/js/utils.js +17 -0
  173. package/tests/py/__init__.py +0 -0
  174. package/tests/py/unit/__init__.py +0 -0
  175. package/tests/py/unit/test_sample.py +10 -0
  176. package/tsconfig.json +3 -0
@@ -0,0 +1,866 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.symmetryPoints = void 0;
4
+ const POINTS = {
5
+ CUB: () => {
6
+ return [
7
+ {
8
+ point: "R",
9
+ coordinates: [0.5, 0.5, 0.5],
10
+ },
11
+ {
12
+ point: "X",
13
+ coordinates: [0.0, 0.5, 0.0],
14
+ },
15
+ {
16
+ point: "M",
17
+ coordinates: [0.5, 0.5, 0.0],
18
+ },
19
+ ];
20
+ },
21
+ FCC: () => {
22
+ return [
23
+ {
24
+ point: "K",
25
+ coordinates: [3 / 8, 3 / 8, 3 / 4],
26
+ },
27
+ {
28
+ point: "L",
29
+ coordinates: [1 / 2, 1 / 2, 1 / 2],
30
+ },
31
+ {
32
+ point: "U",
33
+ coordinates: [5 / 8, 1 / 4, 5 / 8],
34
+ },
35
+ {
36
+ point: "W",
37
+ coordinates: [1 / 2, 1 / 4, 3 / 4],
38
+ },
39
+ {
40
+ point: "X",
41
+ coordinates: [1 / 2, 0.0, 1 / 2],
42
+ },
43
+ ];
44
+ },
45
+ BCC: () => {
46
+ return [
47
+ {
48
+ point: "H",
49
+ coordinates: [1 / 2, -1 / 2, 1 / 2],
50
+ },
51
+ {
52
+ point: "P",
53
+ coordinates: [1 / 4, 1 / 4, 1 / 4],
54
+ },
55
+ {
56
+ point: "N",
57
+ coordinates: [0.0, 0.0, 1 / 2],
58
+ },
59
+ ];
60
+ },
61
+ TET: () => {
62
+ return [
63
+ {
64
+ point: "A",
65
+ coordinates: [1 / 2, 1 / 2, 1 / 2],
66
+ },
67
+ {
68
+ point: "M",
69
+ coordinates: [1 / 2, 1 / 2, 0.0],
70
+ },
71
+ {
72
+ point: "R",
73
+ coordinates: [0.0, 1 / 2, 1 / 2],
74
+ },
75
+ {
76
+ point: "X",
77
+ coordinates: [0.0, 1 / 2, 0.0],
78
+ },
79
+ {
80
+ point: "Z",
81
+ coordinates: [0.0, 0.0, 1 / 2],
82
+ },
83
+ ];
84
+ },
85
+ BCT: ({ a, c }) => {
86
+ let n;
87
+ if (c < a) {
88
+ // BCT-1
89
+ n = (1 + (c * c) / (a * a)) / 4;
90
+ return [
91
+ {
92
+ point: "M",
93
+ coordinates: [-1 / 2, 1 / 2, 1 / 2],
94
+ },
95
+ {
96
+ point: "N",
97
+ coordinates: [0.0, 1 / 2, 0.0],
98
+ },
99
+ {
100
+ point: "P",
101
+ coordinates: [1 / 4, 1 / 4, 1 / 4],
102
+ },
103
+ {
104
+ point: "X",
105
+ coordinates: [0.0, 0.0, 1 / 2],
106
+ },
107
+ {
108
+ point: "Z",
109
+ coordinates: [n, n, -n],
110
+ },
111
+ {
112
+ point: "Z1",
113
+ coordinates: [-n, 1 - n, n],
114
+ },
115
+ ];
116
+ }
117
+ // BCT-2
118
+ n = (1 + (a * a) / (c * c)) / 4;
119
+ const e = (a * a) / (2 * c * c);
120
+ return [
121
+ {
122
+ point: "N",
123
+ coordinates: [0.0, 1 / 2, 0.0],
124
+ },
125
+ {
126
+ point: "P",
127
+ coordinates: [1 / 4, 1 / 4, 1 / 4],
128
+ },
129
+ {
130
+ point: "∑",
131
+ coordinates: [-n, n, n],
132
+ },
133
+ {
134
+ point: "∑1",
135
+ coordinates: [n, 1 - n, -n],
136
+ },
137
+ {
138
+ point: "X",
139
+ coordinates: [0, 0, 1 / 2],
140
+ },
141
+ {
142
+ point: "Y",
143
+ coordinates: [-e, e, 1 / 2],
144
+ },
145
+ {
146
+ point: "Y1",
147
+ coordinates: [1 / 2, 1 / 2, -e],
148
+ },
149
+ {
150
+ point: "Z",
151
+ coordinates: [1 / 2, 1 / 2, -1 / 2],
152
+ },
153
+ ];
154
+ },
155
+ ORC: () => {
156
+ return [
157
+ {
158
+ point: "R",
159
+ coordinates: [1 / 2, 1 / 2, 1 / 2],
160
+ },
161
+ {
162
+ point: "S",
163
+ coordinates: [1 / 2, 1 / 2, 0.0],
164
+ },
165
+ {
166
+ point: "T",
167
+ coordinates: [0.0, 1 / 2, 1 / 2],
168
+ },
169
+ {
170
+ point: "U",
171
+ coordinates: [1 / 2, 0.0, 1 / 2],
172
+ },
173
+ {
174
+ point: "X",
175
+ coordinates: [1 / 2, 0.0, 0.0],
176
+ },
177
+ {
178
+ point: "Y",
179
+ coordinates: [0.0, 1 / 2, 0.0],
180
+ },
181
+ {
182
+ point: "Z",
183
+ coordinates: [0.0, 0.0, 1 / 2],
184
+ },
185
+ ];
186
+ },
187
+ ORCF: ({ a, b, c }) => {
188
+ let n;
189
+ if (1 / (a * a) >= 1 / (b * b) + 1 / (c * c)) {
190
+ // ORCF-1,3
191
+ n = (1 + (a * a) / (b * b) + (a * a) / (c * c)) / 4;
192
+ const e = (1 + (a * a) / (b * b) - (a * a) / (c * c)) / 4;
193
+ return [
194
+ {
195
+ point: "A",
196
+ coordinates: [1 / 2, 1 / 2 + e, e],
197
+ },
198
+ {
199
+ point: "A1",
200
+ coordinates: [0.0, 1 / 2 - e, 1 - e],
201
+ },
202
+ {
203
+ point: "L",
204
+ coordinates: [1 / 2, 1 / 2, 1 / 2],
205
+ },
206
+ {
207
+ point: "T",
208
+ coordinates: [1.0, 1 / 2, 1 / 2],
209
+ },
210
+ {
211
+ point: "X",
212
+ coordinates: [0.0, n, n],
213
+ },
214
+ {
215
+ point: "X1",
216
+ coordinates: [1.0, 1 - n, 1 - n],
217
+ },
218
+ {
219
+ point: "Y",
220
+ coordinates: [1 / 2, 0.0, 1 / 2],
221
+ },
222
+ {
223
+ point: "Z",
224
+ coordinates: [1 / 2, 1 / 2, 0.0],
225
+ },
226
+ ];
227
+ }
228
+ // ORCF-2
229
+ n = (1 + (a * a) / (b * b) - (a * a) / (c * c)) / 4;
230
+ const f = (1 + (c * c) / (b * b) - (c * c) / (a * a)) / 4;
231
+ const d = (1 + (b * b) / (a * a) - (b * b) / (c * c)) / 4;
232
+ return [
233
+ {
234
+ point: "C",
235
+ coordinates: [1 / 2, 1 / 2 - n, 1 - n],
236
+ },
237
+ {
238
+ point: "C1",
239
+ coordinates: [0.0, 1 / 2 + n, n],
240
+ },
241
+ {
242
+ point: "D",
243
+ coordinates: [1 / 2 - d, 1 / 2, 1 - d],
244
+ },
245
+ {
246
+ point: "D1",
247
+ coordinates: [1 / 2 + d, 1 / 2, d],
248
+ },
249
+ {
250
+ point: "L",
251
+ coordinates: [1 / 2, 1 / 2, 1 / 2],
252
+ },
253
+ {
254
+ point: "H",
255
+ coordinates: [1 - f, 1 / 2 - f, 1 / 2],
256
+ },
257
+ {
258
+ point: "H1",
259
+ coordinates: [f, 1 / 2 + f, 1 / 2],
260
+ },
261
+ {
262
+ point: "X",
263
+ coordinates: [0.0, 1 / 2, 1 / 2],
264
+ },
265
+ {
266
+ point: "Y",
267
+ coordinates: [1 / 2, 0.0, 1 / 2],
268
+ },
269
+ {
270
+ point: "Z",
271
+ coordinates: [1 / 2, 1 / 2, 0.0],
272
+ },
273
+ ];
274
+ },
275
+ ORCI: ({ a, b, c }) => {
276
+ const n = (1 + (a * a) / (c * c)) / 4;
277
+ const e = (1 + (b * b) / (c * c)) / 4;
278
+ const d = (b * b - a * a) / (4 * c * c);
279
+ const m = (b * b + a * a) / (4 * c * c);
280
+ return [
281
+ {
282
+ point: "L",
283
+ coordinates: [-m, m, 1 / 2 - d],
284
+ },
285
+ {
286
+ point: "L1",
287
+ coordinates: [m, -m, 1 / 2 + d],
288
+ },
289
+ {
290
+ point: "L2",
291
+ coordinates: [1 / 2 - d, 1 / 2 + d, -m],
292
+ },
293
+ {
294
+ point: "R",
295
+ coordinates: [0.0, 1 / 2, 0.0],
296
+ },
297
+ {
298
+ point: "S",
299
+ coordinates: [1 / 2, 0.0, 0.0],
300
+ },
301
+ {
302
+ point: "T",
303
+ coordinates: [0.0, 0.0, 1 / 2],
304
+ },
305
+ {
306
+ point: "W",
307
+ coordinates: [1 / 4, 1 / 4, 1 / 4],
308
+ },
309
+ {
310
+ point: "X",
311
+ coordinates: [-e, e, e],
312
+ },
313
+ {
314
+ point: "X1",
315
+ coordinates: [e, 1 - e, -e],
316
+ },
317
+ {
318
+ point: "Y",
319
+ coordinates: [n, -n, n],
320
+ },
321
+ {
322
+ point: "Y1",
323
+ coordinates: [1 - n, n, -n],
324
+ },
325
+ {
326
+ point: "Z",
327
+ coordinates: [1 / 2, 1 / 2, -1 / 2],
328
+ },
329
+ ];
330
+ },
331
+ ORCC: ({ a, b }) => {
332
+ const e = (1 + (a * a) / (b * b)) / 4;
333
+ return [
334
+ {
335
+ point: "A",
336
+ coordinates: [e, e, 1 / 2],
337
+ },
338
+ {
339
+ point: "A1",
340
+ coordinates: [-e, 1 - e, 1 / 2],
341
+ },
342
+ {
343
+ point: "R",
344
+ coordinates: [0.0, 1 / 2, 1 / 2],
345
+ },
346
+ {
347
+ point: "S",
348
+ coordinates: [0.0, 1 / 2, 0.0],
349
+ },
350
+ {
351
+ point: "T",
352
+ coordinates: [-1 / 2, 1 / 2, 1 / 2],
353
+ },
354
+ {
355
+ point: "X",
356
+ coordinates: [e, e, 0.0],
357
+ },
358
+ {
359
+ point: "X1",
360
+ coordinates: [-e, 1 - e, 0.0],
361
+ },
362
+ {
363
+ point: "Y",
364
+ coordinates: [-1 / 2, 1 / 2, 0.0],
365
+ },
366
+ {
367
+ point: "Z",
368
+ coordinates: [0.0, 0.0, 1 / 2],
369
+ },
370
+ ];
371
+ },
372
+ HEX: () => {
373
+ return [
374
+ {
375
+ point: "A",
376
+ coordinates: [0.0, 0.0, 1 / 2],
377
+ },
378
+ {
379
+ point: "H",
380
+ coordinates: [1 / 3, 1 / 3, 1 / 2],
381
+ },
382
+ {
383
+ point: "K",
384
+ coordinates: [1 / 3, 1 / 3, 0.0],
385
+ },
386
+ {
387
+ point: "L",
388
+ coordinates: [1 / 2, 0.0, 1 / 2],
389
+ },
390
+ {
391
+ point: "M",
392
+ coordinates: [1 / 2, 0.0, 0.0],
393
+ },
394
+ ];
395
+ },
396
+ RHL: ({ alpha }) => {
397
+ let n, v;
398
+ const cosAlpha = Math.cos((alpha / 180) * Math.PI);
399
+ if (cosAlpha > 0) {
400
+ // RHL-1
401
+ n = (1 + 4 * cosAlpha) / (2 + 4 * cosAlpha);
402
+ v = 3 / 4 - n / 2;
403
+ return [
404
+ {
405
+ point: "B",
406
+ coordinates: [n, 1 / 2, 1 - n],
407
+ },
408
+ {
409
+ point: "B1",
410
+ coordinates: [1 / 2, 1 - n, n - 1],
411
+ },
412
+ {
413
+ point: "F",
414
+ coordinates: [1 / 2, 1 / 2, 0.0],
415
+ },
416
+ {
417
+ point: "L",
418
+ coordinates: [1 / 2, 0.0, 0.0],
419
+ },
420
+ {
421
+ point: "L1",
422
+ coordinates: [0.0, 0.0, -1 / 2],
423
+ },
424
+ {
425
+ point: "P",
426
+ coordinates: [n, v, v],
427
+ },
428
+ {
429
+ point: "P1",
430
+ coordinates: [1 - v, 1 - v, 1 - n],
431
+ },
432
+ {
433
+ point: "P2",
434
+ coordinates: [v, v, n - 1],
435
+ },
436
+ {
437
+ point: "Q",
438
+ coordinates: [1 - v, v, 0.0],
439
+ },
440
+ {
441
+ point: "X",
442
+ coordinates: [v, 0.0, -v],
443
+ },
444
+ {
445
+ point: "Z",
446
+ coordinates: [1 / 2, 1 / 2, 1 / 2],
447
+ },
448
+ ];
449
+ }
450
+ // RHL-2
451
+ n = ((1 / 2) * (1 + cosAlpha)) / (1 - cosAlpha);
452
+ v = 3 / 4 - n / 2;
453
+ return [
454
+ {
455
+ point: "F",
456
+ coordinates: [1 / 2, -1 / 2, 0.0],
457
+ },
458
+ {
459
+ point: "L",
460
+ coordinates: [1 / 2, 0.0, 0.0],
461
+ },
462
+ {
463
+ point: "P",
464
+ coordinates: [1 - v, -v, 1 - v],
465
+ },
466
+ {
467
+ point: "P1",
468
+ coordinates: [v, v - 1, v - 1],
469
+ },
470
+ {
471
+ point: "Q",
472
+ coordinates: [n, n, n],
473
+ },
474
+ {
475
+ point: "Q1",
476
+ coordinates: [1 - n, -n, -n],
477
+ },
478
+ {
479
+ point: "Z",
480
+ coordinates: [1 / 2, -1 / 2, 1 / 2],
481
+ },
482
+ ];
483
+ },
484
+ MCL: ({ b, c, alpha }) => {
485
+ const cosAlpha = Math.cos((alpha / 180) * Math.PI);
486
+ const n = ((1 / 2) * (1 - (b * cosAlpha) / c)) / (1 - cosAlpha * cosAlpha);
487
+ const v = 1 / 2 - (n * c * cosAlpha) / b;
488
+ return [
489
+ {
490
+ point: "A",
491
+ coordinates: [1 / 2, 1 / 2, 0.0],
492
+ },
493
+ {
494
+ point: "C",
495
+ coordinates: [0.0, 1 / 2, 1 / 2],
496
+ },
497
+ {
498
+ point: "D",
499
+ coordinates: [1 / 2, 0.0, 1 / 2],
500
+ },
501
+ {
502
+ point: "D1",
503
+ coordinates: [1 / 2, 0.0, -1 / 2],
504
+ },
505
+ {
506
+ point: "E",
507
+ coordinates: [1 / 2, 1 / 2, 1 / 2],
508
+ },
509
+ {
510
+ point: "H",
511
+ coordinates: [0.0, n, 1 - v],
512
+ },
513
+ {
514
+ point: "H1",
515
+ coordinates: [0.0, 1 - n, v],
516
+ },
517
+ {
518
+ point: "H2",
519
+ coordinates: [0.0, n, -v],
520
+ },
521
+ {
522
+ point: "M",
523
+ coordinates: [1 / 2, n, 1 - v],
524
+ },
525
+ {
526
+ point: "M1",
527
+ coordinates: [1 / 2, 1 - n, v],
528
+ },
529
+ {
530
+ point: "M2",
531
+ coordinates: [1 / 2, n, -v],
532
+ },
533
+ {
534
+ point: "X",
535
+ coordinates: [0.0, 1 / 2, 0.0],
536
+ },
537
+ {
538
+ point: "Y",
539
+ coordinates: [0.0, 0.0, 1 / 2],
540
+ },
541
+ {
542
+ point: "Y1",
543
+ coordinates: [0.0, 0.0, -1 / 2],
544
+ },
545
+ {
546
+ point: "Z",
547
+ coordinates: [1 / 2, 0.0, 0.0],
548
+ },
549
+ ];
550
+ },
551
+ MCLC: ({ a, b, c, alpha, gamma }) => {
552
+ const cosAlpha = Math.cos((alpha / 180) * Math.PI);
553
+ let e, n, p, f, m, d, v;
554
+ if (gamma >= 90) {
555
+ // MCLC-1,2
556
+ e = (2 - (b * cosAlpha) / c) / (4 * (1 - cosAlpha * cosAlpha));
557
+ n = 1 / 2 + (2 * e * c * cosAlpha) / b;
558
+ p = 3 / 4 - (a * a) / (4 * b * b * (1 - cosAlpha * cosAlpha));
559
+ f = p + ((3 / 4 - p) * cosAlpha * b) / c;
560
+ return [
561
+ {
562
+ point: "N",
563
+ coordinates: [1 / 2, 0.0, 0.0],
564
+ },
565
+ {
566
+ point: "N1",
567
+ coordinates: [0.0, -1 / 2, 0.0],
568
+ },
569
+ {
570
+ point: "F",
571
+ coordinates: [1 - e, 1 - e, 1 - n],
572
+ },
573
+ {
574
+ point: "F1",
575
+ coordinates: [e, e, n],
576
+ },
577
+ {
578
+ point: "F2",
579
+ coordinates: [-e, -e, 1 - n],
580
+ },
581
+ {
582
+ point: "F3",
583
+ coordinates: [1 - e, -e, 1 - n],
584
+ },
585
+ {
586
+ point: "I",
587
+ coordinates: [f, 1 - f, 1 / 2],
588
+ },
589
+ {
590
+ point: "I1",
591
+ coordinates: [1 - f, f - 1, 1 / 2],
592
+ },
593
+ {
594
+ point: "L",
595
+ coordinates: [1 / 2, 1 / 2, 1 / 2],
596
+ },
597
+ {
598
+ point: "M",
599
+ coordinates: [1 / 2, 0.0, 1 / 2],
600
+ },
601
+ {
602
+ point: "X",
603
+ coordinates: [1 - p, p - 1, 0.0],
604
+ },
605
+ {
606
+ point: "X1",
607
+ coordinates: [p, 1 - p, 0.0],
608
+ },
609
+ {
610
+ point: "X2",
611
+ coordinates: [p - 1, -p, 0.0],
612
+ },
613
+ {
614
+ point: "Y",
615
+ coordinates: [1 / 2, 1 / 2, 0.0],
616
+ },
617
+ {
618
+ point: "Y1",
619
+ coordinates: [-1 / 2, -1 / 2, 0.0],
620
+ },
621
+ {
622
+ point: "Z",
623
+ coordinates: [0.0, 0.0, 1 / 2],
624
+ },
625
+ ];
626
+ }
627
+ if ((b / c) * cosAlpha + ((b * b) / (a * a)) * (1 - cosAlpha * cosAlpha) <= 1) {
628
+ // MCLC-3,4
629
+ m = (1 + (b * b) / (a * a)) / 4;
630
+ d = (b * c * cosAlpha) / (2 * a * a);
631
+ e = m - 1 / 4 + (1 - (b * cosAlpha) / c) / (4 * (1 - cosAlpha * cosAlpha));
632
+ n = 1 / 2 + (2 * e * c * cosAlpha) / b;
633
+ f = 1 + e - 2 * m;
634
+ p = n - 2 * d;
635
+ return [
636
+ {
637
+ point: "N",
638
+ coordinates: [1 / 2, 0.0, 0.0],
639
+ },
640
+ {
641
+ point: "N1",
642
+ coordinates: [0.0, -1 / 2, 0.0],
643
+ },
644
+ {
645
+ point: "F",
646
+ coordinates: [1 - f, 1 - f, 1 - p],
647
+ },
648
+ {
649
+ point: "F1",
650
+ coordinates: [f, f - 1, p],
651
+ },
652
+ {
653
+ point: "F2",
654
+ coordinates: [1 - f, -f, 1 - p],
655
+ },
656
+ {
657
+ point: "H",
658
+ coordinates: [e, e, n],
659
+ },
660
+ {
661
+ point: "H1",
662
+ coordinates: [1 - e, -e, 1 - n],
663
+ },
664
+ {
665
+ point: "H2",
666
+ coordinates: [-e, -e, 1 - n],
667
+ },
668
+ {
669
+ point: "I",
670
+ coordinates: [1 / 2, -1 / 2, 1 / 2],
671
+ },
672
+ {
673
+ point: "M",
674
+ coordinates: [1 / 2, 0.0, 1 / 2],
675
+ },
676
+ {
677
+ point: "X",
678
+ coordinates: [1 / 2, -1 / 2, 0.0],
679
+ },
680
+ {
681
+ point: "Y",
682
+ coordinates: [m, m, d],
683
+ },
684
+ {
685
+ point: "Y1",
686
+ coordinates: [1 - m, -m, -d],
687
+ },
688
+ {
689
+ point: "Y2",
690
+ coordinates: [-m, -m, -d],
691
+ },
692
+ {
693
+ point: "Y3",
694
+ coordinates: [m, m - 1, d],
695
+ },
696
+ {
697
+ point: "Z",
698
+ coordinates: [0.0, 0.0, 1 / 2],
699
+ },
700
+ ];
701
+ }
702
+ // MCLC-5
703
+ e = (1 / 4) * ((b * b) / (a * a) + (1 - (b * cosAlpha) / c) / (1 - cosAlpha * cosAlpha));
704
+ // @ts-ignore
705
+ m = n / 2 + (b * b) / (a * a) / 4 - (b * c * cosAlpha) / (2 * a * a);
706
+ // eslint-disable-next-line max-len
707
+ const w = // @ts-ignore
708
+ ((4 * v - 1 - (b * b * (1 - cosAlpha * cosAlpha)) / (a * a)) * c) / (2 * b * cosAlpha);
709
+ n = 1 / 2 + (2 * e * c * cosAlpha) / b;
710
+ d = ((e * c) / b) * cosAlpha + w / 2 - 1 / 4;
711
+ v = 1 + e - 2 * m;
712
+ const r = 1 - (e * a * a) / (b * b);
713
+ return [
714
+ {
715
+ point: "N",
716
+ coordinates: [1 / 2, 0.0, 0.0],
717
+ },
718
+ {
719
+ point: "N1",
720
+ coordinates: [0.0, -1 / 2, 0.0],
721
+ },
722
+ {
723
+ point: "F",
724
+ coordinates: [v, v, w],
725
+ },
726
+ {
727
+ point: "F1",
728
+ coordinates: [1 - v, 1 - v, 1 - w],
729
+ },
730
+ {
731
+ point: "F2",
732
+ coordinates: [v, v - 1, w],
733
+ },
734
+ {
735
+ point: "H",
736
+ coordinates: [e, e, n],
737
+ },
738
+ {
739
+ point: "H1",
740
+ coordinates: [1 - e, -e, 1 - n],
741
+ },
742
+ {
743
+ point: "H2",
744
+ coordinates: [-e, -e, 1 - n],
745
+ },
746
+ {
747
+ point: "I",
748
+ coordinates: [r, 1 - r, 1 / 2],
749
+ },
750
+ {
751
+ point: "I1",
752
+ coordinates: [1 - r, r - 1, 1 / 2],
753
+ },
754
+ {
755
+ point: "L",
756
+ coordinates: [1 / 2, 1 / 2, 1 / 2],
757
+ },
758
+ {
759
+ point: "M",
760
+ coordinates: [1 / 2, 0.0, 1 / 2],
761
+ },
762
+ {
763
+ point: "X",
764
+ coordinates: [1 / 2, -1 / 2, 0.0],
765
+ },
766
+ {
767
+ point: "Y",
768
+ coordinates: [m, m, d],
769
+ },
770
+ {
771
+ point: "Y1",
772
+ coordinates: [1 - m, -m, -d],
773
+ },
774
+ {
775
+ point: "Y2",
776
+ coordinates: [-m, -m, -d],
777
+ },
778
+ {
779
+ point: "Y3",
780
+ coordinates: [m, m - 1, d],
781
+ },
782
+ {
783
+ point: "Z",
784
+ coordinates: [0.0, 0.0, 1 / 2],
785
+ },
786
+ ];
787
+ },
788
+ TRI: ({ alpha, beta, gamma }) => {
789
+ if (alpha > 90 && beta > 90 && gamma >= 90) {
790
+ // TRI-1a,2a
791
+ return [
792
+ {
793
+ point: "L",
794
+ coordinates: [1 / 2, 1 / 2, 0.0],
795
+ },
796
+ {
797
+ point: "M",
798
+ coordinates: [0.0, 1 / 2, 1 / 2],
799
+ },
800
+ {
801
+ point: "N",
802
+ coordinates: [1 / 2, 0.0, 1 / 2],
803
+ },
804
+ {
805
+ point: "R",
806
+ coordinates: [1 / 2, 1 / 2, 1 / 2],
807
+ },
808
+ {
809
+ point: "X",
810
+ coordinates: [1 / 2, 0.0, 0.0],
811
+ },
812
+ {
813
+ point: "Y",
814
+ coordinates: [0.0, 1 / 2, 0.0],
815
+ },
816
+ {
817
+ point: "Z",
818
+ coordinates: [0.0, 0.0, 1 / 2],
819
+ },
820
+ ];
821
+ }
822
+ // TRI-1b,2b
823
+ return [
824
+ {
825
+ point: "L",
826
+ coordinates: [1 / 2, -1 / 2, 0.0],
827
+ },
828
+ {
829
+ point: "M",
830
+ coordinates: [0.0, 0.0, 1 / 2],
831
+ },
832
+ {
833
+ point: "N",
834
+ coordinates: [-1 / 2, -1 / 2, 1 / 2],
835
+ },
836
+ {
837
+ point: "R",
838
+ coordinates: [0.0, -1 / 2, 1 / 2],
839
+ },
840
+ {
841
+ point: "X",
842
+ coordinates: [0.0, -1 / 2, 0.0],
843
+ },
844
+ {
845
+ point: "Y",
846
+ coordinates: [1 / 2, 0.0, 0.0],
847
+ },
848
+ {
849
+ point: "Z",
850
+ coordinates: [-1 / 2, 0.0, 1 / 2],
851
+ },
852
+ ];
853
+ },
854
+ };
855
+ /**
856
+ * Returns a list of symmetry points for the specified lattice.
857
+ */
858
+ function symmetryPoints(lattice) {
859
+ return [
860
+ {
861
+ point: "Г",
862
+ coordinates: [0.0, 0.0, 0.0],
863
+ },
864
+ ].concat(POINTS[lattice.type](lattice) || []);
865
+ }
866
+ exports.symmetryPoints = symmetryPoints;