nomad-parser-plugins-workflow 1.0__py3-none-any.whl
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.
- nomad_parser_plugins_workflow-1.0.dist-info/LICENSE +202 -0
- nomad_parser_plugins_workflow-1.0.dist-info/METADATA +319 -0
- nomad_parser_plugins_workflow-1.0.dist-info/RECORD +58 -0
- nomad_parser_plugins_workflow-1.0.dist-info/WHEEL +5 -0
- nomad_parser_plugins_workflow-1.0.dist-info/entry_points.txt +11 -0
- nomad_parser_plugins_workflow-1.0.dist-info/top_level.txt +1 -0
- workflowparsers/__init__.py +314 -0
- workflowparsers/aflow/__init__.py +19 -0
- workflowparsers/aflow/__main__.py +31 -0
- workflowparsers/aflow/metainfo/__init__.py +19 -0
- workflowparsers/aflow/metainfo/aflow.py +1240 -0
- workflowparsers/aflow/parser.py +741 -0
- workflowparsers/asr/__init__.py +19 -0
- workflowparsers/asr/__main__.py +31 -0
- workflowparsers/asr/metainfo/__init__.py +19 -0
- workflowparsers/asr/metainfo/asr.py +306 -0
- workflowparsers/asr/parser.py +266 -0
- workflowparsers/atomate/__init__.py +19 -0
- workflowparsers/atomate/__main__.py +31 -0
- workflowparsers/atomate/metainfo/__init__.py +19 -0
- workflowparsers/atomate/metainfo/atomate.py +395 -0
- workflowparsers/atomate/parser.py +357 -0
- workflowparsers/elastic/__init__.py +19 -0
- workflowparsers/elastic/__main__.py +31 -0
- workflowparsers/elastic/metainfo/__init__.py +19 -0
- workflowparsers/elastic/metainfo/elastic.py +364 -0
- workflowparsers/elastic/parser.py +798 -0
- workflowparsers/fhivibes/__init__.py +19 -0
- workflowparsers/fhivibes/__main__.py +31 -0
- workflowparsers/fhivibes/metainfo/__init__.py +19 -0
- workflowparsers/fhivibes/metainfo/fhi_vibes.py +898 -0
- workflowparsers/fhivibes/parser.py +566 -0
- workflowparsers/lobster/__init__.py +19 -0
- workflowparsers/lobster/__main__.py +31 -0
- workflowparsers/lobster/metainfo/__init__.py +19 -0
- workflowparsers/lobster/metainfo/lobster.py +446 -0
- workflowparsers/lobster/parser.py +618 -0
- workflowparsers/phonopy/__init__.py +19 -0
- workflowparsers/phonopy/__main__.py +31 -0
- workflowparsers/phonopy/calculator.py +260 -0
- workflowparsers/phonopy/metainfo/__init__.py +19 -0
- workflowparsers/phonopy/metainfo/phonopy.py +83 -0
- workflowparsers/phonopy/parser.py +583 -0
- workflowparsers/quantum_espresso_epw/__init__.py +19 -0
- workflowparsers/quantum_espresso_epw/__main__.py +31 -0
- workflowparsers/quantum_espresso_epw/metainfo/__init__.py +19 -0
- workflowparsers/quantum_espresso_epw/metainfo/quantum_espresso_epw.py +579 -0
- workflowparsers/quantum_espresso_epw/parser.py +583 -0
- workflowparsers/quantum_espresso_phonon/__init__.py +19 -0
- workflowparsers/quantum_espresso_phonon/__main__.py +31 -0
- workflowparsers/quantum_espresso_phonon/metainfo/__init__.py +19 -0
- workflowparsers/quantum_espresso_phonon/metainfo/quantum_espresso_phonon.py +389 -0
- workflowparsers/quantum_espresso_phonon/parser.py +483 -0
- workflowparsers/quantum_espresso_xspectra/__init__.py +19 -0
- workflowparsers/quantum_espresso_xspectra/__main__.py +31 -0
- workflowparsers/quantum_espresso_xspectra/metainfo/__init__.py +19 -0
- workflowparsers/quantum_espresso_xspectra/metainfo/quantum_espresso_xspectra.py +290 -0
- workflowparsers/quantum_espresso_xspectra/parser.py +586 -0
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright The NOMAD Authors.
|
|
3
|
+
#
|
|
4
|
+
# This file is part of NOMAD.
|
|
5
|
+
# See https://nomad-lab.eu for further info.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
#
|
|
19
|
+
import logging
|
|
20
|
+
import os
|
|
21
|
+
import numpy as np
|
|
22
|
+
|
|
23
|
+
from nomad.units import ureg
|
|
24
|
+
from nomad.parsing.file_parser import TextParser, Quantity
|
|
25
|
+
from runschema.run import Run, Program
|
|
26
|
+
from runschema.method import Method, AtomParameters, Electronic, Smearing
|
|
27
|
+
from runschema.system import System, Atoms
|
|
28
|
+
from runschema.calculation import Calculation, VibrationalFrequencies
|
|
29
|
+
|
|
30
|
+
from .metainfo.quantum_espresso_phonon import (
|
|
31
|
+
x_qe_phonon_n_parallel,
|
|
32
|
+
x_qe_phonon_representation,
|
|
33
|
+
x_qe_phonon_scf_iteration,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
re_f = r'[-+]?\d+\.\d*(?:[Ee][-+]\d+)?'
|
|
38
|
+
re_n = r'[\n\r]'
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class MainfileParser(TextParser):
|
|
42
|
+
def init_quantities(self):
|
|
43
|
+
def to_positions(block):
|
|
44
|
+
labels, positions = [], []
|
|
45
|
+
for line in block.strip().splitlines():
|
|
46
|
+
line = line.split()
|
|
47
|
+
if not line:
|
|
48
|
+
continue
|
|
49
|
+
labels.append(line[1])
|
|
50
|
+
positions.append(line[-4:-1])
|
|
51
|
+
return labels, np.array(positions, np.dtype(np.float64))
|
|
52
|
+
|
|
53
|
+
calc_quantities = [
|
|
54
|
+
Quantity(
|
|
55
|
+
'g_cutoff_fft_grid',
|
|
56
|
+
rf'G cutoff *= *({re_f}) *\( *(\d+) G\-vectors\) *FFT grid: *\( (\d+), (\d+), (\d+)\)',
|
|
57
|
+
dtype=np.dtype(np.float64),
|
|
58
|
+
),
|
|
59
|
+
Quantity(
|
|
60
|
+
'g_cutoff_smooth_grid',
|
|
61
|
+
rf'G cutoff *= *({re_f}) *\( *(\d+) G\-vectors\) *smooth grid: *\( (\d+), (\d+), (\d+)\)',
|
|
62
|
+
dtype=np.dtype(np.float64),
|
|
63
|
+
),
|
|
64
|
+
Quantity('n_kpoints', r'number of k points *= *(\d+)', dtype=np.int32),
|
|
65
|
+
Quantity('smearing', rf'(\S+) smearing, width \(Ry\) *= *({re_f})'),
|
|
66
|
+
Quantity(
|
|
67
|
+
'pseudopot',
|
|
68
|
+
rf'(PseudoPot\. #[\s\S]+?){re_n} *{re_n}',
|
|
69
|
+
repeats=True,
|
|
70
|
+
sub_parser=TextParser(
|
|
71
|
+
quantities=[
|
|
72
|
+
Quantity('element', r'for ([A-Z][a-z]*)'),
|
|
73
|
+
Quantity('file', r' read from file\:\s+(\S+)', dtype=str),
|
|
74
|
+
Quantity('md5_check_sum', r'MD5 check sum\: +(\S+)', dtype=str),
|
|
75
|
+
Quantity('type', r'Pseudo is (.+?),', flatten=False, dtype=str),
|
|
76
|
+
Quantity('zval', rf'Zval *= *({re_f})', dtype=np.float64),
|
|
77
|
+
Quantity(
|
|
78
|
+
'n_radial_grid_points',
|
|
79
|
+
r'Using radial grid of *(\d+) points',
|
|
80
|
+
dtype=np.int32,
|
|
81
|
+
),
|
|
82
|
+
Quantity(
|
|
83
|
+
'n_beta_functions', r'(\d+) beta functions', dtype=np.int32
|
|
84
|
+
),
|
|
85
|
+
Quantity(
|
|
86
|
+
'l', r'l\(\d+\) *= *(\d+)', dtype=np.int32, repeats=True
|
|
87
|
+
),
|
|
88
|
+
Quantity(
|
|
89
|
+
'n_q_coefficients',
|
|
90
|
+
r'Q\(r\) pseudized with (\d+) coefficients',
|
|
91
|
+
dtype=np.int32,
|
|
92
|
+
),
|
|
93
|
+
Quantity(
|
|
94
|
+
'q_coefficients',
|
|
95
|
+
rf'rinner *= *((?:{re_f}\s+)+)',
|
|
96
|
+
str_operation=lambda x: x.strip().split(),
|
|
97
|
+
dytpe=np.dtype(np.float64),
|
|
98
|
+
),
|
|
99
|
+
]
|
|
100
|
+
),
|
|
101
|
+
),
|
|
102
|
+
Quantity('point_group', r', *(.+?) +point group', dtype=str, flatten=False),
|
|
103
|
+
Quantity(
|
|
104
|
+
'alpha_ewald',
|
|
105
|
+
rf' Alpha used in Ewald sum = *({re_f})',
|
|
106
|
+
dtype=np.float64,
|
|
107
|
+
),
|
|
108
|
+
Quantity(
|
|
109
|
+
'negative_rho',
|
|
110
|
+
rf'negative rho \(up, down\): *({re_f}) *({re_f})',
|
|
111
|
+
dtype=np.dtype(np.float64),
|
|
112
|
+
),
|
|
113
|
+
Quantity(
|
|
114
|
+
'representation',
|
|
115
|
+
r'(tion # *\d+ mode[\s\S]+?)(?:Represent|\Z)',
|
|
116
|
+
repeats=True,
|
|
117
|
+
sub_parser=TextParser(
|
|
118
|
+
quantities=[
|
|
119
|
+
Quantity('number', r'tion # *(\d+)', dtype=np.int32),
|
|
120
|
+
Quantity(
|
|
121
|
+
'modes',
|
|
122
|
+
r'modes* #([\d ]+)',
|
|
123
|
+
str_operation=lambda x: x.strip().split(),
|
|
124
|
+
dtype=np.int32,
|
|
125
|
+
),
|
|
126
|
+
Quantity(
|
|
127
|
+
'scf',
|
|
128
|
+
r'Self\-consistent Calculation([\s\S]+?)End of self-consistent calculation',
|
|
129
|
+
sub_parser=TextParser(
|
|
130
|
+
quantities=[
|
|
131
|
+
Quantity(
|
|
132
|
+
'iter',
|
|
133
|
+
r'iter # +(\d+)',
|
|
134
|
+
repeats=True,
|
|
135
|
+
dtype=np.int32,
|
|
136
|
+
),
|
|
137
|
+
Quantity(
|
|
138
|
+
'total_cpu_time',
|
|
139
|
+
rf'total cpu time *: *({re_f})',
|
|
140
|
+
repeats=True,
|
|
141
|
+
dtype=np.float64,
|
|
142
|
+
),
|
|
143
|
+
Quantity(
|
|
144
|
+
'time',
|
|
145
|
+
rf'av\.it\.: *({re_f})',
|
|
146
|
+
repeats=True,
|
|
147
|
+
dtype=np.float64,
|
|
148
|
+
),
|
|
149
|
+
Quantity(
|
|
150
|
+
'threshold',
|
|
151
|
+
rf'thresh *= *({re_f})',
|
|
152
|
+
repeats=True,
|
|
153
|
+
dtype=np.float64,
|
|
154
|
+
),
|
|
155
|
+
Quantity(
|
|
156
|
+
'alpha_mix',
|
|
157
|
+
rf'alpha\_mix *= *({re_f})',
|
|
158
|
+
repeats=True,
|
|
159
|
+
dtype=np.float64,
|
|
160
|
+
),
|
|
161
|
+
Quantity(
|
|
162
|
+
'ddv_scf',
|
|
163
|
+
rf'\|ddv_scf\|\^2 *= *({re_f})',
|
|
164
|
+
repeats=True,
|
|
165
|
+
dtype=np.float64,
|
|
166
|
+
),
|
|
167
|
+
Quantity(
|
|
168
|
+
'fermi_energy_shift',
|
|
169
|
+
rf'Fermi energy shift \(Ry\) *= *({re_f}) +({re_f})',
|
|
170
|
+
repeats=True,
|
|
171
|
+
dtype=np.dtype(np.float64),
|
|
172
|
+
),
|
|
173
|
+
]
|
|
174
|
+
),
|
|
175
|
+
),
|
|
176
|
+
Quantity(
|
|
177
|
+
'converged',
|
|
178
|
+
r'(Convergence has been achieved)',
|
|
179
|
+
str_operation=lambda x: True,
|
|
180
|
+
),
|
|
181
|
+
]
|
|
182
|
+
),
|
|
183
|
+
),
|
|
184
|
+
]
|
|
185
|
+
|
|
186
|
+
self._quantities = [
|
|
187
|
+
Quantity('program_version', r'Program PHONON v.([\d\.]+)', dtype=str),
|
|
188
|
+
Quantity(
|
|
189
|
+
'calculation',
|
|
190
|
+
rf'(q = +{re_f} +{re_f} +{re_f} *{re_n}[\s\S]+?)(?:Calculation of|\Z)',
|
|
191
|
+
repeats=True,
|
|
192
|
+
sub_parser=TextParser(
|
|
193
|
+
quantities=[
|
|
194
|
+
Quantity(
|
|
195
|
+
'q',
|
|
196
|
+
r'q = +({re_f} +{re_f} +{re_f})',
|
|
197
|
+
dtype=np.dtype(np.float64),
|
|
198
|
+
),
|
|
199
|
+
Quantity(
|
|
200
|
+
'n_parallel',
|
|
201
|
+
r'Parallelization info\s+\-+\s+sticks\:.+\s+'
|
|
202
|
+
r'((?:\w+ +\d+ +\d+ +\d+ +\d+ +\d+ +\d+\s+)+)',
|
|
203
|
+
str_operation=lambda x: [
|
|
204
|
+
line.strip().split()[1:]
|
|
205
|
+
for line in x.strip().splitlines()
|
|
206
|
+
],
|
|
207
|
+
dtype=np.dtype(np.int32),
|
|
208
|
+
),
|
|
209
|
+
Quantity(
|
|
210
|
+
'bravais_lattice_index',
|
|
211
|
+
r'bravais\-lattice index *= *(\d+)',
|
|
212
|
+
dtype=np.int32,
|
|
213
|
+
),
|
|
214
|
+
Quantity(
|
|
215
|
+
'lattice_parameter',
|
|
216
|
+
rf'lattice parameter \(alat\) *= *({re_f}) *a\.u\.',
|
|
217
|
+
dtype=np.float64,
|
|
218
|
+
unit=ureg.bohr,
|
|
219
|
+
),
|
|
220
|
+
Quantity(
|
|
221
|
+
'unit_cell_volume',
|
|
222
|
+
rf'unit\-cell volume *= *({re_f}) \(a\.u\.\)\^3',
|
|
223
|
+
dtype=np.float64,
|
|
224
|
+
unit=ureg.bohr**3,
|
|
225
|
+
),
|
|
226
|
+
Quantity(
|
|
227
|
+
'n_atoms_cell',
|
|
228
|
+
r'number of atoms/cell *= *(\d+)',
|
|
229
|
+
dtype=np.int32,
|
|
230
|
+
),
|
|
231
|
+
Quantity(
|
|
232
|
+
'n_atomic_types',
|
|
233
|
+
r'number of atomic types *= *(\d+)',
|
|
234
|
+
dtype=np.int32,
|
|
235
|
+
),
|
|
236
|
+
Quantity(
|
|
237
|
+
'kinetic_energy_cutoff',
|
|
238
|
+
rf'kinetic\-energy cut\-off *= *({re_f}) *Ry',
|
|
239
|
+
dtype=np.float64,
|
|
240
|
+
unit=ureg.rydberg,
|
|
241
|
+
),
|
|
242
|
+
Quantity(
|
|
243
|
+
'charge_density_cutoff',
|
|
244
|
+
rf'charge density cut\-off *= *({re_f}) *Ry',
|
|
245
|
+
dtype=np.float64,
|
|
246
|
+
unit=ureg.rydberg,
|
|
247
|
+
),
|
|
248
|
+
Quantity(
|
|
249
|
+
'convergence_threshold',
|
|
250
|
+
rf'convergence threshold *= *({re_f})',
|
|
251
|
+
dtype=np.float64,
|
|
252
|
+
),
|
|
253
|
+
Quantity('beta', rf'beta *= *({re_f})', dtype=np.float64),
|
|
254
|
+
Quantity(
|
|
255
|
+
'exchange_correlation',
|
|
256
|
+
r'Exchange\-correlation *= *(.+)',
|
|
257
|
+
dtype=str,
|
|
258
|
+
),
|
|
259
|
+
Quantity(
|
|
260
|
+
'n_kohn_sham_states',
|
|
261
|
+
r'number of Kohn\-Sham states *= *(\d+)',
|
|
262
|
+
dtype=np.int32,
|
|
263
|
+
),
|
|
264
|
+
Quantity(
|
|
265
|
+
'crystal_axes',
|
|
266
|
+
rf'crystal axes: \(cart\. coord\. in units of alat\)\s*'
|
|
267
|
+
rf'((?:a\(\d+\) *= *\( *{re_f} *{re_f} *{re_f} *\)\s*)+)',
|
|
268
|
+
str_operation=lambda x: np.array(
|
|
269
|
+
[
|
|
270
|
+
line.strip().split()[-4:-1]
|
|
271
|
+
for line in x.strip().splitlines()
|
|
272
|
+
],
|
|
273
|
+
dtype=np.dtype(np.float64),
|
|
274
|
+
),
|
|
275
|
+
),
|
|
276
|
+
Quantity(
|
|
277
|
+
'cartesian_axes',
|
|
278
|
+
rf'positions \(alat units\)\s+((?:\d+ +[A-Z][a-z]* .+{re_f} +{re_f} +{re_f} +\)\s*)+)',
|
|
279
|
+
str_operation=to_positions,
|
|
280
|
+
),
|
|
281
|
+
Quantity(
|
|
282
|
+
'dynamical_matrix',
|
|
283
|
+
r'(Computing dynamical matrix[\s\S]+?)(?:Diagonalizing|\Z)',
|
|
284
|
+
sub_parser=TextParser(quantities=calc_quantities),
|
|
285
|
+
),
|
|
286
|
+
Quantity(
|
|
287
|
+
'frequencies',
|
|
288
|
+
rf'freq \( +\d+\) += +{re_f} \[THz\] += +({re_f}) \[cm\-1\]',
|
|
289
|
+
repeats=True,
|
|
290
|
+
dtype=np.float64,
|
|
291
|
+
),
|
|
292
|
+
]
|
|
293
|
+
),
|
|
294
|
+
),
|
|
295
|
+
]
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
class QuantumEspressoPhononParser:
|
|
299
|
+
def __init__(self):
|
|
300
|
+
self.mainfile_parser = MainfileParser()
|
|
301
|
+
|
|
302
|
+
def parse(self, filepath, archive, logger):
|
|
303
|
+
logger = logging.getLogger(__name__) if logger is None else logger
|
|
304
|
+
self.archive = archive
|
|
305
|
+
self.filepath = os.path.abspath(filepath)
|
|
306
|
+
|
|
307
|
+
self.mainfile_parser.mainfile = self.filepath
|
|
308
|
+
|
|
309
|
+
sec_run = Run()
|
|
310
|
+
self.archive.run.append(sec_run)
|
|
311
|
+
sec_run.program = Program(
|
|
312
|
+
name='Quantum Espresso Phonon',
|
|
313
|
+
version=self.mainfile_parser.get('program_version', ''),
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
for calculation in self.mainfile_parser.get('calculation', []):
|
|
317
|
+
sec_calc = Calculation()
|
|
318
|
+
sec_run.calculation.append(sec_calc)
|
|
319
|
+
|
|
320
|
+
sec_method = Method()
|
|
321
|
+
sec_run.method.append(sec_method)
|
|
322
|
+
n_parallel = calculation.get('n_parallel')
|
|
323
|
+
if n_parallel is not None:
|
|
324
|
+
sec_method.x_qe_phonon_n_parallel_sticks = x_qe_phonon_n_parallel(
|
|
325
|
+
x_qe_phonon_n_parallel_min=n_parallel[0][:3],
|
|
326
|
+
x_qe_phonon_n_parallel_max=n_parallel[1][:3],
|
|
327
|
+
x_qe_phonon_n_parallel_sum=n_parallel[2][:3],
|
|
328
|
+
)
|
|
329
|
+
sec_method.x_qe_phonon_n_parallel_g_vectors = x_qe_phonon_n_parallel(
|
|
330
|
+
x_qe_phonon_n_parallel_min=n_parallel[0][3:],
|
|
331
|
+
x_qe_phonon_n_parallel_max=n_parallel[1][3:],
|
|
332
|
+
x_qe_phonon_n_parallel_sum=n_parallel[2][3:],
|
|
333
|
+
)
|
|
334
|
+
|
|
335
|
+
sec_system = System()
|
|
336
|
+
sec_run.system.append(sec_system)
|
|
337
|
+
sec_atoms = Atoms()
|
|
338
|
+
sec_system.atoms = sec_atoms
|
|
339
|
+
if calculation.get('crystal_axes') is not None:
|
|
340
|
+
sec_atoms.lattice_vectors = (
|
|
341
|
+
calculation.crystal_axes * calculation.get('alat', 1) * ureg.bohr
|
|
342
|
+
)
|
|
343
|
+
if calculation.get('cartesian_axes') is not None:
|
|
344
|
+
sec_atoms.labels = calculation.cartesian_axes[0]
|
|
345
|
+
sec_atoms.positions = (
|
|
346
|
+
calculation.cartesian_axes[1]
|
|
347
|
+
* calculation.get('alat', 1)
|
|
348
|
+
* ureg.bohr
|
|
349
|
+
)
|
|
350
|
+
sec_atoms.periodic = [True, True, True]
|
|
351
|
+
|
|
352
|
+
system_keys = [
|
|
353
|
+
'bravais_lattice_index',
|
|
354
|
+
'lattice_parameter',
|
|
355
|
+
'unit_cell_volume',
|
|
356
|
+
'n_atoms_cell',
|
|
357
|
+
'n_atomic_sites',
|
|
358
|
+
]
|
|
359
|
+
for key in system_keys:
|
|
360
|
+
setattr(sec_system, f'x_qe_phonon_{key}', calculation.get(key))
|
|
361
|
+
|
|
362
|
+
method_keys = [
|
|
363
|
+
'kinetic_energy_cutoff',
|
|
364
|
+
'charge_density_cutoff',
|
|
365
|
+
'convergence_threshold',
|
|
366
|
+
'beta',
|
|
367
|
+
'exchange_correlation',
|
|
368
|
+
'n_kohn_sham_states',
|
|
369
|
+
]
|
|
370
|
+
for key in method_keys:
|
|
371
|
+
setattr(sec_method, f'x_qe_phonon_{key}', calculation.get(key))
|
|
372
|
+
|
|
373
|
+
# vibrational frequencies
|
|
374
|
+
if calculation.frequencies is not None:
|
|
375
|
+
sec_calc.vibrational_frequencies.append(
|
|
376
|
+
VibrationalFrequencies(
|
|
377
|
+
value=calculation.frequencies * (1 / ureg.cm)
|
|
378
|
+
)
|
|
379
|
+
)
|
|
380
|
+
|
|
381
|
+
# specs and results of dynamical matrix calculation
|
|
382
|
+
if calculation.dynamical_matrix is not None:
|
|
383
|
+
for pseudopot in calculation.dynamical_matrix.get('pseudopot', []):
|
|
384
|
+
sec_atom_parameters = AtomParameters()
|
|
385
|
+
sec_method.atom_parameters.append(sec_atom_parameters)
|
|
386
|
+
sec_atom_parameters.label = pseudopot.element
|
|
387
|
+
sec_atom_parameters.n_valence_electrons = pseudopot.zval
|
|
388
|
+
atom_keys = [
|
|
389
|
+
'file',
|
|
390
|
+
'md5_check_sum',
|
|
391
|
+
'type',
|
|
392
|
+
'n_radial_grid_points',
|
|
393
|
+
'n_l',
|
|
394
|
+
'l',
|
|
395
|
+
'n_q_coefficients',
|
|
396
|
+
'q_coefficients',
|
|
397
|
+
]
|
|
398
|
+
for key in atom_keys:
|
|
399
|
+
setattr(
|
|
400
|
+
sec_atom_parameters,
|
|
401
|
+
f'x_qe_phonon_{key}',
|
|
402
|
+
pseudopot.get(key),
|
|
403
|
+
)
|
|
404
|
+
|
|
405
|
+
if calculation.dynamical_matrix.g_cutoff_fft_grid is not None:
|
|
406
|
+
sec_method.x_qe_phonon_fft_g_cutoff = (
|
|
407
|
+
calculation.dynamical_matrix.g_cutoff_fft_grid[0]
|
|
408
|
+
)
|
|
409
|
+
sec_method.x_qe_phonon_fft_g_vectors = (
|
|
410
|
+
calculation.dynamical_matrix.g_cutoff_fft_grid[1]
|
|
411
|
+
)
|
|
412
|
+
sec_method.x_qe_phonon_fft_grid = (
|
|
413
|
+
calculation.dynamical_matrix.g_cutoff_fft_grid[2:5]
|
|
414
|
+
)
|
|
415
|
+
if calculation.dynamical_matrix.g_cutoff_smooth_grid is not None:
|
|
416
|
+
sec_method.x_qe_phonon_smooth_g_cutoff = (
|
|
417
|
+
calculation.dynamical_matrix.g_cutoff_smooth_grid[0]
|
|
418
|
+
)
|
|
419
|
+
sec_method.x_qe_phonon_smooth_g_vectors = (
|
|
420
|
+
calculation.dynamical_matrix.g_cutoff_smooth_grid[1]
|
|
421
|
+
)
|
|
422
|
+
sec_method.x_qe_phonon_smooth_grid = (
|
|
423
|
+
calculation.dynamical_matrix.g_cutoff_smooth_grid[2:5]
|
|
424
|
+
)
|
|
425
|
+
|
|
426
|
+
if calculation.dynamical_matrix.smearing is not None:
|
|
427
|
+
smearing_map = {'Methfessel-Paxton': 'methfessel-paxton'}
|
|
428
|
+
sec_method.electronic = Electronic(
|
|
429
|
+
smearing=Smearing(
|
|
430
|
+
kind=smearing_map.get(
|
|
431
|
+
calculation.dynamical_matrix.smearing[0]
|
|
432
|
+
),
|
|
433
|
+
width=(calculation.dynamical_matrix.smearing[1] * ureg.Ry)
|
|
434
|
+
.to_base_units()
|
|
435
|
+
.magnitude,
|
|
436
|
+
)
|
|
437
|
+
)
|
|
438
|
+
|
|
439
|
+
sec_method.x_qe_phonon_n_kpoints = (
|
|
440
|
+
calculation.dynamical_matrix.n_kpoints
|
|
441
|
+
)
|
|
442
|
+
sec_method.x_qe_phonon_alpha_ewald = (
|
|
443
|
+
calculation.dynamical_matrix.alpha_ewald
|
|
444
|
+
)
|
|
445
|
+
sec_method.x_qe_phonon_negative_rho = (
|
|
446
|
+
calculation.dynamical_matrix.negative_rho
|
|
447
|
+
)
|
|
448
|
+
|
|
449
|
+
sec_system.x_qe_phonon_point_group = (
|
|
450
|
+
calculation.dynamical_matrix.point_group
|
|
451
|
+
)
|
|
452
|
+
|
|
453
|
+
for representation in calculation.dynamical_matrix.get(
|
|
454
|
+
'representation', []
|
|
455
|
+
):
|
|
456
|
+
sec_representation = x_qe_phonon_representation()
|
|
457
|
+
sec_calc.x_qe_phonon_representation = sec_representation
|
|
458
|
+
sec_representation.x_qe_phonon_number = representation.number
|
|
459
|
+
sec_representation.x_qe_phonon_modes = representation.modes
|
|
460
|
+
sec_representation.x_qe_phonon_converged = representation.converged
|
|
461
|
+
if representation.scf is not None:
|
|
462
|
+
for n, iter in enumerate(representation.scf.get('iter', [])):
|
|
463
|
+
sec_scf = x_qe_phonon_scf_iteration()
|
|
464
|
+
sec_representation.x_qe_phonon_scf_iteration.append(sec_scf)
|
|
465
|
+
sec_scf.x_qe_phonon_iter = iter
|
|
466
|
+
sec_scf.x_qe_phonon_total_cpu_time = (
|
|
467
|
+
representation.scf.total_cpu_time[n]
|
|
468
|
+
)
|
|
469
|
+
sec_scf.x_qe_phonon_time = representation.scf.time[n]
|
|
470
|
+
sec_scf.x_qe_phonon_threshold = (
|
|
471
|
+
representation.scf.threshold[n]
|
|
472
|
+
)
|
|
473
|
+
sec_scf.x_qe_phonon_alpha_mix = (
|
|
474
|
+
representation.scf.alpha_mix[n]
|
|
475
|
+
)
|
|
476
|
+
sec_scf.x_qe_phonon_ddv_scf = representation.scf.ddv_scf[n]
|
|
477
|
+
if representation.scf.fermi_energy_shift is not None:
|
|
478
|
+
n_modes = len(representation.get('modes', []))
|
|
479
|
+
sec_scf.x_qe_phonon_fermi_energy_shift = (
|
|
480
|
+
representation.scf.fermi_energy_shift[
|
|
481
|
+
n * n_modes : n * n_modes + 2
|
|
482
|
+
]
|
|
483
|
+
)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright The NOMAD Authors.
|
|
3
|
+
#
|
|
4
|
+
# This file is part of NOMAD.
|
|
5
|
+
# See https://nomad-lab.eu for further info.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
#
|
|
19
|
+
from .parser import QuantumEspressoXSpectraParser
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright The NOMAD Authors.
|
|
3
|
+
#
|
|
4
|
+
# This file is part of NOMAD.
|
|
5
|
+
# See https://nomad-lab.eu for further info.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
#
|
|
19
|
+
import sys
|
|
20
|
+
import json
|
|
21
|
+
import logging
|
|
22
|
+
|
|
23
|
+
from nomad.utils import configure_logging
|
|
24
|
+
from nomad.datamodel import EntryArchive
|
|
25
|
+
from workflowparsers.quantum_espresso_xspectra import QuantumEspressoXSpectraParser
|
|
26
|
+
|
|
27
|
+
if __name__ == '__main__':
|
|
28
|
+
configure_logging(console_log_level=logging.DEBUG)
|
|
29
|
+
archive = EntryArchive()
|
|
30
|
+
QuantumEspressoXSpectraParser().parse(sys.argv[1], archive, logging)
|
|
31
|
+
json.dump(archive.m_to_dict(), sys.stdout, indent=2)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright The NOMAD Authors.
|
|
3
|
+
#
|
|
4
|
+
# This file is part of NOMAD.
|
|
5
|
+
# See https://nomad-lab.eu for further info.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
#
|
|
19
|
+
from . import quantum_espresso_xspectra
|