Coverage for eminus/data.py: 100.00%
7 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-01 11:47 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-01 11:47 +0000
1# SPDX-FileCopyrightText: 2021 The eminus developers
2# SPDX-License-Identifier: Apache-2.0
3"""Atomic data collections."""
5import math
7#: Map atom symbols and atom numbers.
8SYMBOL2NUMBER = {
9 "X": 0,
10 "H": 1,
11 "He": 2,
12 "Li": 3,
13 "Be": 4,
14 "B": 5,
15 "C": 6,
16 "N": 7,
17 "O": 8,
18 "F": 9,
19 "Ne": 10,
20 "Na": 11,
21 "Mg": 12,
22 "Al": 13,
23 "Si": 14,
24 "P": 15,
25 "S": 16,
26 "Cl": 17,
27 "Ar": 18,
28 "K": 19,
29 "Ca": 20,
30 "Sc": 21,
31 "Ti": 22,
32 "V": 23,
33 "Cr": 24,
34 "Mn": 25,
35 "Fe": 26,
36 "Co": 27,
37 "Ni": 28,
38 "Cu": 29,
39 "Zn": 30,
40 "Ga": 31,
41 "Ge": 32,
42 "As": 33,
43 "Se": 34,
44 "Br": 35,
45 "Kr": 36,
46 "Rb": 37,
47 "Sr": 38,
48 "Y": 39,
49 "Zr": 40,
50 "Nb": 41,
51 "Mo": 42,
52 "Tc": 43,
53 "Ru": 44,
54 "Rh": 45,
55 "Pd": 46,
56 "Ag": 47,
57 "Cd": 48,
58 "In": 49,
59 "Sn": 50,
60 "Sb": 51,
61 "Te": 52,
62 "I": 53,
63 "Xe": 54,
64 "Cs": 55,
65 "Ba": 56,
66 "La": 57,
67 "Ce": 58,
68 "Pr": 59,
69 "Nd": 60,
70 "Pm": 61,
71 "Sm": 62,
72 "Eu": 63,
73 "Gd": 64,
74 "Tb": 65,
75 "Dy": 66,
76 "Ho": 67,
77 "Er": 68,
78 "Tm": 69,
79 "Yb": 70,
80 "Lu": 71,
81 "Hf": 72,
82 "Ta": 73,
83 "W": 74,
84 "Re": 75,
85 "Os": 76,
86 "Ir": 77,
87 "Pt": 78,
88 "Au": 79,
89 "Hg": 80,
90 "Tl": 81,
91 "Pb": 82,
92 "Bi": 83,
93 "Po": 84,
94 "At": 85,
95 "Rn": 86,
96 # "Fr": 87,
97 # "Ra": 88,
98 "Ac": 89,
99 "Th": 90,
100 "Pa": 91,
101 "U": 92,
102 "Np": 93,
103 "Pu": 94,
104 "Am": 95,
105 "Cm": 96,
106 "Bk": 97,
107 "Cf": 98,
108 "Es": 99,
109 "Fm": 100,
110 "Md": 101,
111 "No": 102,
112 "Lr": 103,
113}
115#: Map atom numbers and atom symbols.
116NUMBER2SYMBOL = {value: key for key, value in SYMBOL2NUMBER.items()}
118#: Covalent radii per atom.
119#: Reference: Dalton Trans., 2832.
120COVALENT_RADII = {
121 "X": 0.3779452249251541,
122 "H": 0.5858150986339887,
123 "He": 0.5291233148952157,
124 "Li": 2.418849439520986,
125 "Be": 1.8141370796407394,
126 "B": 1.5873699446856468,
127 "C": 1.4361918547155854,
128 "N": 1.3417055484842968,
129 "O": 1.2472192422530084,
130 "F": 1.0771438910366888,
131 "Ne": 1.0960411522829467,
132 "Na": 3.1369453668787783,
133 "Mg": 2.6645138357223357,
134 "Al": 2.286568610797182,
135 "Si": 2.0975959983346053,
136 "P": 2.022006953349574,
137 "S": 1.9842124308570588,
138 "Cl": 1.9275206471182857,
139 "Ar": 2.0031096921033167,
140 "K": 3.836144032990313,
141 "Ca": 3.3259179793413556,
142 "Sc": 3.2125344118638095,
143 "Ti": 3.0235617994012327,
144 "V": 2.8912809706774283,
145 "Cr": 2.6267193132298203,
146 "Mn": 2.6267193132298203,
147 "Fe": 2.494438484506017,
148 "Co": 2.3810549170284707,
149 "Ni": 2.343260394535955,
150 "Cu": 2.494438484506017,
151 "Zn": 2.3054658720434396,
152 "Ga": 2.3054658720434396,
153 "Ge": 2.267671349550924,
154 "As": 2.2487740883046663,
155 "Se": 2.267671349550924,
156 "Br": 2.267671349550924,
157 "Kr": 2.1920823045658935,
158 "Rb": 4.157397474176695,
159 "Sr": 3.6849659430202517,
160 "Y": 3.590479636788963,
161 "Zr": 3.3070207180950977,
162 "Nb": 3.099150844386263,
163 "Mo": 2.910178231923686,
164 "Tc": 2.777897403199882,
165 "Ru": 2.7590001419536243,
166 "Rh": 2.6834110969685936,
167 "Pd": 2.6267193132298203,
168 "Ag": 2.740102880707367,
169 "Cd": 2.721205619461109,
170 "In": 2.6834110969685936,
171 "Sn": 2.6267193132298203,
172 "Sb": 2.6267193132298203,
173 "Te": 2.607822051983563,
174 "I": 2.6267193132298203,
175 "Xe": 2.6456165744760782,
176 "Cs": 4.610931744086879,
177 "Ba": 4.062911167945406,
178 "La": 3.911733077975344,
179 "Ce": 3.8550412942365715,
180 "Pr": 3.836144032990313,
181 "Nd": 3.798349510497798,
182 "Pm": 3.760554988005283,
183 "Sm": 3.741657726759025,
184 "Eu": 3.741657726759025,
185 "Gd": 3.7038632042665096,
186 "Tb": 3.6660686817739943,
187 "Dy": 3.628274159281479,
188 "Ho": 3.628274159281479,
189 "Er": 3.5715823755427056,
190 "Tm": 3.590479636788963,
191 "Yb": 3.5337878530501907,
192 "Lu": 3.5337878530501907,
193 "Hf": 3.3070207180950977,
194 "Ta": 3.2125344118638095,
195 "W": 3.061356321893748,
196 "Re": 2.853486448184913,
197 "Os": 2.721205619461109,
198 "Ir": 2.6645138357223357,
199 "Pt": 2.5700275294910475,
200 "Au": 2.5700275294910475,
201 "Hg": 2.494438484506017,
202 "Tl": 2.740102880707367,
203 "Pb": 2.7590001419536243,
204 "Bi": 2.79679466444614,
205 "Po": 2.6456165744760782,
206 "At": 2.8345891869386555,
207 "Rn": 2.8345891869386555,
208 "Ac": 4.913287924027003,
209 "Th": 4.176294735422952,
210 "Pa": 4.062911167945406,
211 "U": 3.892835816729087,
212 "Np": 3.7794522492515403,
213 "Pu": 3.7038632042665096,
214 "Am": 3.590479636788963,
215 "Cm": 3.5337878530501907,
216 "Bk": 3.4015070243263863,
217 "Cf": 3.1936371506175516,
218 "Es": 0.3779452249251541,
219 "Fm": 0.3779452249251541,
220 "Md": 0.3779452249251541,
221 "No": 0.3779452249251541,
222 "Lr": 0.3779452249251541,
223}
225#: CPK colors per atom.
226#: Reference: https://gitlab.com/ase/ase/-/blob/master/ase/data/colors.py
227CPK_COLORS = {
228 "X": "#ff0000",
229 "H": "#ffffff",
230 "He": "#ffc0ca",
231 "Li": "#b12121",
232 "Be": "#ff1392",
233 "B": "#00ff00",
234 "C": "#c7c7c7",
235 "N": "#8f8fff",
236 "O": "#ef0000",
237 "F": "#daa41f",
238 "Ne": "#ff1392",
239 "Na": "#0000ff",
240 "Mg": "#218a21",
241 "Al": "#808090",
242 "Si": "#daa41f",
243 "P": "#ffa400",
244 "S": "#ffc731",
245 "Cl": "#00ff00",
246 "Ar": "#ff1392",
247 "K": "#ff1392",
248 "Ca": "#808090",
249 "Sc": "#ff1392",
250 "Ti": "#808090",
251 "V": "#ff1392",
252 "Cr": "#808090",
253 "Mn": "#808090",
254 "Fe": "#ffa400",
255 "Co": "#ff1392",
256 "Ni": "#a42a2a",
257 "Cu": "#a42a2a",
258 "Zn": "#a42a2a",
259 "Ga": "#ff1392",
260 "Ge": "#ff1392",
261 "As": "#ff1392",
262 "Se": "#ff1392",
263 "Br": "#a42a2a",
264 "Kr": "#ff1392",
265 "Rb": "#ff1392",
266 "Sr": "#ff1392",
267 "Y": "#ff1392",
268 "Zr": "#ff1392",
269 "Nb": "#ff1392",
270 "Mo": "#ff1392",
271 "Tc": "#ff1392",
272 "Ru": "#ff1392",
273 "Rh": "#ff1392",
274 "Pd": "#ff1392",
275 "Ag": "#808090",
276 "Cd": "#ff1392",
277 "In": "#ff1392",
278 "Sn": "#ff1392",
279 "Sb": "#ff1392",
280 "Te": "#ff1392",
281 "I": "#9f1fef",
282 "Xe": "#ff1392",
283 "Cs": "#ff1392",
284 "Ba": "#ffa400",
285 "La": "#ff1392",
286 "Ce": "#ff1392",
287 "Pr": "#ff1392",
288 "Nd": "#ff1392",
289 "Pm": "#ff1392",
290 "Sm": "#ff1392",
291 "Eu": "#ff1392",
292 "Gd": "#ff1392",
293 "Tb": "#ff1392",
294 "Dy": "#ff1392",
295 "Ho": "#ff1392",
296 "Er": "#ff1392",
297 "Tm": "#ff1392",
298 "Yb": "#ff1392",
299 "Lu": "#ff1392",
300 "Hf": "#ff1392",
301 "Ta": "#ff1392",
302 "W": "#ff1392",
303 "Re": "#ff1392",
304 "Os": "#ff1392",
305 "Ir": "#ff1392",
306 "Pt": "#ff1392",
307 "Au": "#daa41f",
308 "Hg": "#ff1392",
309 "Tl": "#ff1392",
310 "Pb": "#ff1392",
311 "Bi": "#ff1392",
312 "Po": "#ff1392",
313 "At": "#ff1392",
314 "Rn": "#ffffff",
315 "Ac": "#ffffff",
316 "Th": "#ffffff",
317 "Pa": "#ffffff",
318 "U": "#ff1392",
319 "Np": "#ffffff",
320 "Pu": "#ff1392",
321 "Am": "#ffffff",
322 "Cm": "#ffffff",
323 "Bk": "#ffffff",
324 "Cf": "#ffffff",
325 "Es": "#ffffff",
326 "Fm": "#ffffff",
327 "Md": "#ffffff",
328 "No": "#ffffff",
329 "Lr": "#ffffff",
330}
332#: Special points in Brillouin zones of different crystal systems.
333#: Reference: Comput. Mater. Sci. 49, 299.
334SPECIAL_POINTS = {
335 "sc": {
336 "G": [0, 0, 0],
337 "M": [1 / 2, 1 / 2, 0],
338 "R": [1 / 2, 1 / 2, 1 / 2],
339 "X": [0, 1 / 2, 0],
340 },
341 "fcc": {
342 "G": [0, 0, 0],
343 "K": [3 / 8, 3 / 8, 3 / 4],
344 "L": [1 / 2, 1 / 2, 1 / 2],
345 "U": [5 / 8, 1 / 4, 5 / 8],
346 "W": [1 / 2, 1 / 4, 3 / 4],
347 "X": [1 / 2, 0, 1 / 2],
348 },
349 "bcc": {
350 "G": [0, 0, 0],
351 "H": [1 / 2, -1 / 2, 1 / 2],
352 "P": [1 / 4, 1 / 4, 1 / 4],
353 "N": [0, 0, 1 / 2],
354 },
355 "tetragonal": {
356 "G": [0, 0, 0],
357 "A": [1 / 2, 1 / 2, 1 / 2],
358 "M": [1 / 2, 1 / 2, 0],
359 "R": [0, 1 / 2, 1 / 2],
360 "X": [0, 1 / 2, 0],
361 "Z": [0, 0, 1 / 2],
362 },
363 "orthorhombic": {
364 "G": [0, 0, 0],
365 "R": [1 / 2, 1 / 2, 1 / 2],
366 "S": [1 / 2, 1 / 2, 0],
367 "T": [0, 1 / 2, 1 / 2],
368 "U": [1 / 2, 0, 1 / 2],
369 "X": [1 / 2, 0, 0],
370 "Y": [0, 1 / 2, 0],
371 "Z": [0, 0, 1 / 2],
372 },
373 "hexagonal": {
374 "G": [0, 0, 0],
375 "A": [0, 0, 1 / 2],
376 "H": [1 / 3, 1 / 3, 1 / 2],
377 "K": [1 / 3, 1 / 3, 0],
378 "L": [1 / 2, 0, 1 / 2],
379 "M": [1 / 2, 0, 0],
380 },
381}
383#: Primitive lattice vectors of different crystal systems.
384#: Reference: Comput. Mater. Sci. 49, 299.
385LATTICE_VECTORS = {
386 "sc": [
387 [1, 0, 0],
388 [0, 1, 0],
389 [0, 0, 1],
390 ],
391 "fcc": [
392 [0, 1 / 2, 1 / 2],
393 [1 / 2, 0, 1 / 2],
394 [1 / 2, 1 / 2, 0],
395 ],
396 "bcc": [
397 [-1 / 2, 1 / 2, 1 / 2],
398 [1 / 2, -1 / 2, 1 / 2],
399 [1 / 2, 1 / 2, -1 / 2],
400 ],
401 "hexagonal": [
402 [1 / 2, -math.sqrt(3) / 2, 0],
403 [1 / 2, math.sqrt(3) / 2, 0],
404 [0, 0, 1],
405 ],
406}