cyrusyc commited on
Commit
361efec
·
1 Parent(s): f143089

add vacancy input script

Browse files
mlip_arena/tasks/vacancy_migration/__init__.py ADDED
File without changes
mlip_arena/tasks/vacancy_migration/input.py ADDED
@@ -0,0 +1,192 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from mp_api.client import MPRester
2
+
3
+ from ase import Atom
4
+ from ase.data import covalent_radii
5
+ from ase.spacegroup import crystal
6
+
7
+ fcc_elements = [
8
+ "Ac",
9
+ "Ag",
10
+ "Al",
11
+ "Ar",
12
+ "Au",
13
+ "Ba",
14
+ "Be",
15
+ "Ca",
16
+ "Cd",
17
+ "Ce",
18
+ "Co",
19
+ "Cs",
20
+ "Cu",
21
+ "Dy",
22
+ "Er",
23
+ "Fe",
24
+ "Ga",
25
+ "Ge",
26
+ "He",
27
+ "Hf",
28
+ "Ho",
29
+ "In",
30
+ "Ir",
31
+ "K",
32
+ "Kr",
33
+ "La",
34
+ "Li",
35
+ "Mg",
36
+ "Mn",
37
+ "Na",
38
+ "Ni",
39
+ "Os",
40
+ "Pa",
41
+ "Pb",
42
+ "Pd",
43
+ "Pr",
44
+ "Pt",
45
+ "Rb",
46
+ "Re",
47
+ "Rh",
48
+ "Ru",
49
+ "Sc",
50
+ "Sn",
51
+ "Sr",
52
+ "Ta",
53
+ "Tb",
54
+ "Tc",
55
+ "Th",
56
+ "Ti",
57
+ "Tl",
58
+ "W",
59
+ "Xe",
60
+ "Y",
61
+ "Zr"
62
+ ]
63
+
64
+ def get_fcc_pristine(mp_api_key = None):
65
+ for element in fcc_elements:
66
+ with MPRester(mp_api_key) as mpr:
67
+ docs = mpr.materials.summary.search(
68
+ formula=element, spacegroup_number=225, fields=["structure", "energy_above_hull"]
69
+ )
70
+
71
+ docs = sorted(docs, key=lambda x: x.energy_above_hull)
72
+
73
+ if len(docs) != 0:
74
+ pristine = docs[0].structure.to_conventional().to_ase_atoms(msonable=False) * (3, 3, 3)
75
+
76
+ if len(pristine) != 108:
77
+ v = pristine.get_volume() / len(pristine)
78
+ r = v**(1/3)
79
+ a = 2*(2**0.5)*r
80
+
81
+ pristine = crystal(
82
+ symbols=[element]*4,
83
+ basis=[(0, 0, 0), (0.5, 0.5, 0), (0.5, 0, 0.5), (0, 0.5, 0.5)],
84
+ spacegroup=225,
85
+ cellpar=[a, a, a, 90, 90, 90],
86
+ ) * (3, 3, 3)
87
+ else:
88
+ r = covalent_radii[Atom(element).number] or 4
89
+ a = 2*(2**0.5)*r
90
+ pristine = crystal(
91
+ symbols=[element]*4,
92
+ basis=[(0, 0, 0), (0.5, 0.5, 0), (0.5, 0, 0.5), (0, 0.5, 0.5)],
93
+ spacegroup=225,
94
+ cellpar=[a, a, a, 90, 90, 90],
95
+ ) * (3, 3, 3)
96
+ yield pristine
97
+
98
+ hcp_elements = [
99
+ "Ag",
100
+ "Al",
101
+ "Ar",
102
+ "Au",
103
+ "Ba",
104
+ "Be",
105
+ "Ca",
106
+ "Cd",
107
+ "Ce",
108
+ "Co",
109
+ "Cr",
110
+ "Cs",
111
+ "Cu",
112
+ "Fe",
113
+ "Ga",
114
+ "Ge",
115
+ "He",
116
+ "Hf",
117
+ "Ho",
118
+ "In",
119
+ "Ir",
120
+ "K",
121
+ "Kr",
122
+ "La",
123
+ "Li",
124
+ "Mg",
125
+ "Mn",
126
+ "Mo",
127
+ "Nb",
128
+ "Ne",
129
+ "Ni",
130
+ "Os",
131
+ "P",
132
+ "Pb",
133
+ "Pd",
134
+ "Pt",
135
+ "Rb",
136
+ "Re",
137
+ "Rh",
138
+ "Ru",
139
+ "Sc",
140
+ "Si",
141
+ "Sn",
142
+ "Sr",
143
+ "Ta",
144
+ "Tc",
145
+ "Te",
146
+ "Th",
147
+ "Ti",
148
+ "Tl",
149
+ "V",
150
+ "W",
151
+ "Xe",
152
+ "Y",
153
+ "Zn",
154
+ "Zr"
155
+ ]
156
+
157
+ def get_hcp_pristine(mp_api_key = None):
158
+ for element in hcp_elements:
159
+ with MPRester(mp_api_key) as mpr:
160
+ docs = mpr.materials.summary.search(
161
+ formula=element, spacegroup_number=194, fields=["structure", "energy_above_hull"]
162
+ )
163
+
164
+ docs = sorted(docs, key=lambda x: x.energy_above_hull)
165
+
166
+ if len(docs) != 0:
167
+ pristine = docs[0].structure.to_conventional().to_ase_atoms(msonable=False) * (3, 3, 1)
168
+
169
+ if len(pristine) != 36:
170
+ v = pristine.get_volume() / len(pristine)
171
+ r = v**(1/3)
172
+ a = 2*r
173
+ c = 4 * ((2/3) ** 0.5) * r
174
+
175
+ pristine = crystal(
176
+ [element],
177
+ [(1.0 / 3.0, 2.0 / 3.0, 3.0 / 4.0)],
178
+ spacegroup=194,
179
+ cellpar=[a, a, c, 90, 90, 120],
180
+ ) * (3, 3, 2)
181
+ else:
182
+ r = covalent_radii[Atom(element).number] or 4
183
+ a = 2*r
184
+ c = 4 * ((2/3) ** 0.5) * r
185
+
186
+ pristine = crystal(
187
+ [element],
188
+ [(1.0 / 3.0, 2.0 / 3.0, 3.0 / 4.0)],
189
+ spacegroup=194,
190
+ cellpar=[a, a, c, 90, 90, 120],
191
+ ) * (3, 3, 2)
192
+ yield pristine