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.
Files changed (58) hide show
  1. nomad_parser_plugins_workflow-1.0.dist-info/LICENSE +202 -0
  2. nomad_parser_plugins_workflow-1.0.dist-info/METADATA +319 -0
  3. nomad_parser_plugins_workflow-1.0.dist-info/RECORD +58 -0
  4. nomad_parser_plugins_workflow-1.0.dist-info/WHEEL +5 -0
  5. nomad_parser_plugins_workflow-1.0.dist-info/entry_points.txt +11 -0
  6. nomad_parser_plugins_workflow-1.0.dist-info/top_level.txt +1 -0
  7. workflowparsers/__init__.py +314 -0
  8. workflowparsers/aflow/__init__.py +19 -0
  9. workflowparsers/aflow/__main__.py +31 -0
  10. workflowparsers/aflow/metainfo/__init__.py +19 -0
  11. workflowparsers/aflow/metainfo/aflow.py +1240 -0
  12. workflowparsers/aflow/parser.py +741 -0
  13. workflowparsers/asr/__init__.py +19 -0
  14. workflowparsers/asr/__main__.py +31 -0
  15. workflowparsers/asr/metainfo/__init__.py +19 -0
  16. workflowparsers/asr/metainfo/asr.py +306 -0
  17. workflowparsers/asr/parser.py +266 -0
  18. workflowparsers/atomate/__init__.py +19 -0
  19. workflowparsers/atomate/__main__.py +31 -0
  20. workflowparsers/atomate/metainfo/__init__.py +19 -0
  21. workflowparsers/atomate/metainfo/atomate.py +395 -0
  22. workflowparsers/atomate/parser.py +357 -0
  23. workflowparsers/elastic/__init__.py +19 -0
  24. workflowparsers/elastic/__main__.py +31 -0
  25. workflowparsers/elastic/metainfo/__init__.py +19 -0
  26. workflowparsers/elastic/metainfo/elastic.py +364 -0
  27. workflowparsers/elastic/parser.py +798 -0
  28. workflowparsers/fhivibes/__init__.py +19 -0
  29. workflowparsers/fhivibes/__main__.py +31 -0
  30. workflowparsers/fhivibes/metainfo/__init__.py +19 -0
  31. workflowparsers/fhivibes/metainfo/fhi_vibes.py +898 -0
  32. workflowparsers/fhivibes/parser.py +566 -0
  33. workflowparsers/lobster/__init__.py +19 -0
  34. workflowparsers/lobster/__main__.py +31 -0
  35. workflowparsers/lobster/metainfo/__init__.py +19 -0
  36. workflowparsers/lobster/metainfo/lobster.py +446 -0
  37. workflowparsers/lobster/parser.py +618 -0
  38. workflowparsers/phonopy/__init__.py +19 -0
  39. workflowparsers/phonopy/__main__.py +31 -0
  40. workflowparsers/phonopy/calculator.py +260 -0
  41. workflowparsers/phonopy/metainfo/__init__.py +19 -0
  42. workflowparsers/phonopy/metainfo/phonopy.py +83 -0
  43. workflowparsers/phonopy/parser.py +583 -0
  44. workflowparsers/quantum_espresso_epw/__init__.py +19 -0
  45. workflowparsers/quantum_espresso_epw/__main__.py +31 -0
  46. workflowparsers/quantum_espresso_epw/metainfo/__init__.py +19 -0
  47. workflowparsers/quantum_espresso_epw/metainfo/quantum_espresso_epw.py +579 -0
  48. workflowparsers/quantum_espresso_epw/parser.py +583 -0
  49. workflowparsers/quantum_espresso_phonon/__init__.py +19 -0
  50. workflowparsers/quantum_espresso_phonon/__main__.py +31 -0
  51. workflowparsers/quantum_espresso_phonon/metainfo/__init__.py +19 -0
  52. workflowparsers/quantum_espresso_phonon/metainfo/quantum_espresso_phonon.py +389 -0
  53. workflowparsers/quantum_espresso_phonon/parser.py +483 -0
  54. workflowparsers/quantum_espresso_xspectra/__init__.py +19 -0
  55. workflowparsers/quantum_espresso_xspectra/__main__.py +31 -0
  56. workflowparsers/quantum_espresso_xspectra/metainfo/__init__.py +19 -0
  57. workflowparsers/quantum_espresso_xspectra/metainfo/quantum_espresso_xspectra.py +290 -0
  58. workflowparsers/quantum_espresso_xspectra/parser.py +586 -0
@@ -0,0 +1,583 @@
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
+ from datetime import datetime
23
+
24
+ from nomad.units import ureg
25
+ from nomad.parsing.file_parser import TextParser, Quantity
26
+ from runschema.run import Run, Program, TimeRun
27
+ from runschema.method import Method, Electronic, KMesh, AtomParameters
28
+ from runschema.system import System, Atoms
29
+ from runschema.calculation import Calculation, Energy
30
+ from .metainfo.quantum_espresso_epw import (
31
+ x_qe_epw_irreducible_q_point,
32
+ x_qe_epw_self_energy_migdal,
33
+ x_qe_epw_self_energy,
34
+ x_qe_epw_eliashberg_spectral_function_migdal_approximation,
35
+ x_qe_epw_timimg,
36
+ )
37
+
38
+
39
+ re_float = r'[-+]?\d+\.\d*(?:[Ee][-+]\d+)?'
40
+ re_n = r'[\n\r]'
41
+
42
+
43
+ class MainfileParser(TextParser):
44
+ def __init__(self):
45
+ super().__init__()
46
+
47
+ def init_quantities(self):
48
+ def to_positions(val_in):
49
+ labels, masses, positions = [], [], []
50
+ for line in val_in.strip().splitlines():
51
+ line = line.strip().split()
52
+ labels.append(line[1])
53
+ masses.append(line[2])
54
+ positions.append(line[-4:-1])
55
+ masses = np.array(masses, np.dtype(np.float64))
56
+ positions = np.array(positions, np.dtype(np.float64))
57
+ return labels, masses, positions
58
+
59
+ def to_k_points(val_in):
60
+ kpoints, weights = [], []
61
+ for line in val_in.strip().splitlines():
62
+ line = line.split('(')[-1].strip().split('), wk =')
63
+ kpoints.append(line[0].split())
64
+ weights.append(line[1])
65
+ return np.array(kpoints, np.dtype(np.float64)), np.array(
66
+ weights, np.dtype(np.float64)
67
+ )
68
+
69
+ self._quantities = [
70
+ Quantity('program_version', r'Program EPW v\.([\d\.]+)', dtype=str),
71
+ Quantity(
72
+ 'start_time',
73
+ r'starts on +(\w+) +at +([\d: ]+)',
74
+ flatten=False,
75
+ dtype=str,
76
+ ),
77
+ Quantity('restart', r'RESTART \- (RESTART)', dtype=str),
78
+ Quantity(
79
+ 'bravais_lattice_index',
80
+ r'bravais\-lattice index *= *(\d+)',
81
+ dtype=np.int32,
82
+ ),
83
+ Quantity(
84
+ 'lattice_parameter',
85
+ rf'lattice parameter \(a_0\) *= *({re_float}) *a\.u\.',
86
+ dtype=np.float64,
87
+ unit=ureg.bohr,
88
+ ),
89
+ Quantity(
90
+ 'unit_cell_volume',
91
+ rf'unit\-cell volume *= *({re_float}) \(a\.u\.\)\^3',
92
+ dtype=np.float64,
93
+ unit=ureg.bohr**3,
94
+ ),
95
+ Quantity('n_atoms_cell', r'number of atoms/cell *= *(\d+)', dtype=np.int32),
96
+ Quantity(
97
+ 'n_atomic_types', r'number of atomic types *= *(\d+)', dtype=np.int32
98
+ ),
99
+ Quantity(
100
+ 'kinetic_energy_cutoff',
101
+ rf'kinetic\-energy cut\-off *= *({re_float}) *Ry',
102
+ dtype=np.float64,
103
+ unit=ureg.rydberg,
104
+ ),
105
+ Quantity(
106
+ 'charge_density_cutoff',
107
+ rf'charge density cut\-off *= *({re_float}) *Ry',
108
+ dtype=np.float64,
109
+ unit=ureg.rydberg,
110
+ ),
111
+ Quantity(
112
+ 'convergence_threshold',
113
+ rf'convergence threshold *= *({re_float})',
114
+ dtype=np.float64,
115
+ ),
116
+ Quantity(
117
+ 'exchange_correlation', r'Exchange\-correlation *= *(.+)', dtype=str
118
+ ),
119
+ Quantity(
120
+ 'lattice_vectors',
121
+ rf'crystal axes: \(cart\. coord.\ in units of a_0\)\s+'
122
+ rf'a\(1\) = \( *({re_float} +{re_float} +{re_float}) *\)\s+'
123
+ rf'a\(2\) = \( *({re_float} +{re_float} +{re_float}) *\)\s+'
124
+ rf'a\(3\) = \( *({re_float} +{re_float} +{re_float}) *\)\s+',
125
+ dtype=np.dtype(np.float64),
126
+ shape=[3, 3],
127
+ ),
128
+ Quantity(
129
+ 'cartesian_axes',
130
+ rf'site n\. +atom +mass +positions \(a_0 units\)\s+'
131
+ rf'((?:\d+ +\w+ +{re_float} +tau\( *\d+\) = \( *{re_float} +{re_float} +{re_float} +\)\s+)+)',
132
+ str_operation=to_positions,
133
+ ),
134
+ Quantity(
135
+ 'g_cutoff_fft_grid',
136
+ rf'G cutoff *= *({re_float}) *\( *(\d+) G\-vectors\) *FFT grid: *\( (\d+), (\d+), (\d+)\)',
137
+ dtype=np.dtype(np.float64),
138
+ ),
139
+ Quantity(
140
+ 'g_cutoff_smooth_grid',
141
+ rf'G cutoff *= *({re_float}) *\( *(\d+) G\-vectors\) *smooth grid: *\( (\d+), (\d+), (\d+)\)',
142
+ dtype=np.dtype(np.float64),
143
+ ),
144
+ Quantity('n_kpoints', r'number of k points *= *(\d+)', dtype=np.int32),
145
+ Quantity(
146
+ 'gaussian_broadening',
147
+ rf'gaussian broad\. \(Ry\)= +({re_float})',
148
+ dtype=np.float64,
149
+ unit=ureg.rydberg,
150
+ ),
151
+ Quantity('n_gauss', r'gnauss *= *(\d+)', dtype=np.int32),
152
+ Quantity(
153
+ 'k_points',
154
+ rf'cart\. coord\. in units 2pi/a_0\s+'
155
+ rf'((?:k\( *\d+\) *= *\( +{re_float} +{re_float} +{re_float} *\), wk = +{re_float}\s+)+)',
156
+ str_operation=to_k_points,
157
+ ),
158
+ Quantity(
159
+ 'pseudopot',
160
+ rf'(PseudoPot\. #[\s\S]+?){re_n} *{re_n}',
161
+ repeats=True,
162
+ sub_parser=TextParser(
163
+ quantities=[
164
+ Quantity('element', r'for ([A-Z][a-z]*)'),
165
+ Quantity('file', r' read from file\:\s+(\S+)', dtype=str),
166
+ Quantity('md5_check_sum', r'MD5 check sum\: +(\S+)', dtype=str),
167
+ Quantity('type', r'Pseudo is (.+?),', flatten=False, dtype=str),
168
+ Quantity('zval', rf'Zval *= *({re_float})', dtype=np.float64),
169
+ Quantity(
170
+ 'n_radial_grid_points',
171
+ r'Using radial grid of *(\d+) points',
172
+ dtype=np.int32,
173
+ ),
174
+ Quantity(
175
+ 'n_beta_functions', r'(\d+) beta functions', dtype=np.int32
176
+ ),
177
+ Quantity(
178
+ 'l', r'l\(\d+\) *= *(\d+)', dtype=np.int32, repeats=True
179
+ ),
180
+ Quantity(
181
+ 'n_q_coefficients',
182
+ r'Q\(r\) pseudized with (\d+) coefficients',
183
+ dtype=np.int32,
184
+ ),
185
+ Quantity(
186
+ 'q_coefficients',
187
+ rf'rinner *= *((?:{re_float}\s+)+)',
188
+ str_operation=lambda x: x.strip().split(),
189
+ dytpe=np.dtype(np.float64),
190
+ ),
191
+ ]
192
+ ),
193
+ ),
194
+ Quantity(
195
+ 'irreducible_q_point',
196
+ r'(irreducible q point # +\d+\s+\=+[\s\S]+?\={50})',
197
+ repeats=True,
198
+ sub_parser=TextParser(
199
+ quantities=[
200
+ Quantity(
201
+ 'n_symmetries',
202
+ r'Symmetries of small group of q\: (\d+)',
203
+ dtype=np.int32,
204
+ ),
205
+ Quantity(
206
+ 'n_q_star',
207
+ r'Number of q in the star *= *(\d+)',
208
+ dtype=np.int32,
209
+ ),
210
+ Quantity(
211
+ 'q_star',
212
+ rf'List of q in the star\:\s+((?:\d+ +{re_float} +{re_float} +{re_float}\s+)+)',
213
+ dtype=np.dtype(np.float64),
214
+ ),
215
+ ]
216
+ ),
217
+ ),
218
+ Quantity(
219
+ 'n_ws_vectors_electrons',
220
+ r'Number of WS vectors for electrons *(\d+)',
221
+ dtype=np.int32,
222
+ ),
223
+ Quantity(
224
+ 'n_ws_vectors_phonons',
225
+ r'Number of WS vectors for phonons *(\d+)',
226
+ dtype=np.int32,
227
+ ),
228
+ Quantity(
229
+ 'n_ws_vectors_electron_phonon',
230
+ r'Number of WS vectors for electron\-phonon *(\d+)',
231
+ dtype=np.int32,
232
+ ),
233
+ Quantity(
234
+ 'n_max_cores',
235
+ r'Maximum number of cores for efficient parallelization *(\d+)',
236
+ dtype=np.int32,
237
+ ),
238
+ Quantity(
239
+ 'use_ws',
240
+ r'Results may improve by using use_ws == \.(TRUE)\.',
241
+ str_operation=lambda x: True,
242
+ dtype=bool,
243
+ ),
244
+ Quantity(
245
+ 'q_mesh',
246
+ r'Using uniform q\-mesh: *(\d+) +(\d+) +(\d+)',
247
+ dtype=np.dtype(np.int32),
248
+ ),
249
+ Quantity(
250
+ 'n_q_mesh',
251
+ r'Size of q point mesh for interpolation: *(\d+)',
252
+ dtype=np.int32,
253
+ ),
254
+ Quantity(
255
+ 'k_mesh',
256
+ r'Using uniform k\-mesh: *(\d+) +(\d+) +(\d+)',
257
+ dtype=np.dtype(np.int32),
258
+ ),
259
+ Quantity(
260
+ 'n_k_mesh',
261
+ r'Size of k point mesh for interpolation: *(\d+)',
262
+ dtype=np.int32,
263
+ ),
264
+ Quantity(
265
+ 'n_max_kpoints_per_pool',
266
+ r'Max number of k points per pool: *(\d+)',
267
+ dtype=np.int32,
268
+ ),
269
+ Quantity(
270
+ 'e_fermi_coarse_grid',
271
+ rf'Fermi energy coarse grid = *({re_float}) eV',
272
+ dtype=np.float64,
273
+ unit=ureg.eV,
274
+ ),
275
+ Quantity(
276
+ 'n_electrons',
277
+ rf'The Fermi level will be determined with *({re_float}) electrons',
278
+ dtype=np.float64,
279
+ ),
280
+ Quantity(
281
+ 'e_fermi',
282
+ rf'Fermi energy is calculated from the fine k\-mesh: Ef = *({re_float}) eV',
283
+ dtype=np.float64,
284
+ unit=ureg.eV,
285
+ ),
286
+ Quantity(
287
+ 'self_energy_migdal_approximation',
288
+ r'(Phonon \(Imaginary\) Self\-Energy in the Migdal Approximation\s+\=+[\s\S]+?\={50})',
289
+ sub_parser=TextParser(
290
+ quantities=[
291
+ Quantity(
292
+ 'fermi_surface_thickness',
293
+ rf'Fermi Surface thickness = *({re_float}) eV',
294
+ dtype=np.float64,
295
+ unit=ureg.eV,
296
+ ),
297
+ Quantity(
298
+ 'golden_rule_t',
299
+ rf'Golden Rule strictly enforced with T = *({re_float}) eV',
300
+ dtype=np.float64,
301
+ unit=ureg.eV,
302
+ ),
303
+ Quantity(
304
+ 'gaussian_broadening',
305
+ rf'Gaussian Broadening: *({re_float}) eV',
306
+ dtype=np.float64,
307
+ unit=ureg.eV,
308
+ ),
309
+ Quantity('n_gauss', r'gauss *= *(\d+)', dtype=np.int32),
310
+ Quantity(
311
+ 'dos_ef',
312
+ rf'DOS = *({re_float}) states/spin/eV/Unit Cell',
313
+ dtype=np.float64,
314
+ ),
315
+ Quantity(
316
+ 'e_fermi',
317
+ rf'at Ef= *({re_float}) eV',
318
+ dtype=np.float64,
319
+ unit=ureg.eV,
320
+ ),
321
+ Quantity(
322
+ 'self_energy',
323
+ r'(ismear = +\d+ iq =.+\s+\-+[\s\S]+?\-{50})',
324
+ repeats=True,
325
+ sub_parser=TextParser(
326
+ quantities=[
327
+ Quantity(
328
+ 'ismear', r'ismear = *(\d+)', dtype=np.int32
329
+ ),
330
+ Quantity('iq', r'iq = *(\d+)', dtype=np.int32),
331
+ Quantity(
332
+ 'coord',
333
+ rf'coord\.: +{re_float} +{re_float} +{re_float}',
334
+ dtype=np.dtype(np.float64),
335
+ ),
336
+ Quantity(
337
+ 'wt', rf'wt: +{re_float}', dtype=np.float64
338
+ ),
339
+ Quantity(
340
+ 'temp',
341
+ rf'Temp: *({re_float}) *K',
342
+ dtype=np.float64,
343
+ unit=ureg.K,
344
+ ),
345
+ Quantity(
346
+ 'lambda_gamma_omega',
347
+ rf'lambda___\( *\d+ *\)= *({re_float}) *gamma___= *({re_float}) meV *omega= *({re_float}) meV',
348
+ dtype=np.float64,
349
+ repeats=True,
350
+ ),
351
+ Quantity(
352
+ 'lambda_gamma_omega_tr',
353
+ rf'lambda_tr\( *\d+ *\)= *({re_float}) *gamma_tr= *({re_float}) meV *omega= *({re_float}) meV',
354
+ dtype=np.float64,
355
+ repeats=True,
356
+ ),
357
+ Quantity(
358
+ 'lambda_tot',
359
+ rf'lambda___\( *tot *\)= *({re_float})',
360
+ ),
361
+ Quantity(
362
+ 'lambda_tot_tr',
363
+ rf'lambda_tr\( *tot *\)= *({re_float})',
364
+ ),
365
+ ]
366
+ ),
367
+ ),
368
+ ]
369
+ ),
370
+ ),
371
+ Quantity(
372
+ 'eliashberg_spectral_function_migdal_approximation',
373
+ r'(Eliashberg Spectral Function in the Migdal Approximation\s+\=+[\s\S]+?\={50})',
374
+ sub_parser=TextParser(
375
+ quantities=[
376
+ Quantity(
377
+ 'lambda', rf'lambda : *({re_float})', dtype=np.float64
378
+ ),
379
+ Quantity(
380
+ 'lambda_tr', rf'lambda_tr : *({re_float})', dtype=np.float64
381
+ ),
382
+ Quantity(
383
+ 'logavg', rf'logavg = *({re_float})', dtype=np.float64
384
+ ),
385
+ Quantity('l_a2f', rf'l_a2f = *({re_float})', dtype=np.float64),
386
+ Quantity(
387
+ 'mu_tc',
388
+ rf'mu = *({re_float}) Tc = *({re_float}) K',
389
+ dtype=np.dtype(np.float64),
390
+ repeats=True,
391
+ ),
392
+ Quantity(
393
+ 'timing',
394
+ rf' +(.+?) +\: +({re_float})s CPU +({re_float})s WALL \( +(\d+) calls',
395
+ repeats=True,
396
+ str_operation=lambda x: x.rsplit(' ', 3),
397
+ ),
398
+ ]
399
+ ),
400
+ ),
401
+ ]
402
+
403
+
404
+ class QuantumEspressoEPWParser:
405
+ def __init__(self):
406
+ self.mainfile_parser = MainfileParser()
407
+
408
+ def parse(self, filepath, archive, logger):
409
+ logger = logging.getLogger(__name__) if logger is None else logger
410
+ self.archive = archive
411
+ self.filepath = os.path.abspath(filepath)
412
+
413
+ self.mainfile_parser.mainfile = self.filepath
414
+
415
+ sec_run = Run()
416
+ self.archive.run.append(sec_run)
417
+ sec_run.program = Program(
418
+ name='Quantum Espresso EPW',
419
+ version=self.mainfile_parser.get('program_version', ''),
420
+ )
421
+
422
+ start_time = self.mainfile_parser.start_time
423
+ if start_time is not None:
424
+ date = datetime.strptime(start_time.replace(' ', ''), '%d%b%Y%H:%M:%S')
425
+ sec_run.time_run = TimeRun(
426
+ date_start=(date - datetime.utcfromtimestamp(0)).total_seconds()
427
+ )
428
+
429
+ sec_method = Method()
430
+ sec_run.method.append(sec_method)
431
+ sec_method.electronic = Electronic(n_electrons=self.mainfile_parser.n_electrons)
432
+ g_cutoff_fft_grid = self.mainfile_parser.g_cutoff_fft_grid
433
+ if g_cutoff_fft_grid is not None:
434
+ sec_method.x_qe_epw_fft_g_cutoff = g_cutoff_fft_grid[0]
435
+ sec_method.x_qe_epw_fft_g_vectors = g_cutoff_fft_grid[1]
436
+ sec_method.x_qe_epw_fft_grid = g_cutoff_fft_grid[2:5]
437
+ g_cutoff_smooth_grid = self.mainfile_parser.g_cutoff_smooth_grid
438
+ if g_cutoff_smooth_grid is not None:
439
+ sec_method.x_qe_epw_smooth_g_cutoff = g_cutoff_smooth_grid[0]
440
+ sec_method.x_qe_epw_smooth_g_vectors = g_cutoff_smooth_grid[1]
441
+ sec_method.x_qe_epw_smooth_grid = g_cutoff_smooth_grid[2:5]
442
+
443
+ k_points = self.mainfile_parser.k_points
444
+ if k_points is not None:
445
+ sec_method.k_mesh = KMesh(points=k_points[0], weights=k_points[1])
446
+
447
+ for pseudopot in self.mainfile_parser.get('pseudopot', []):
448
+ sec_atom_parameters = AtomParameters()
449
+ sec_method.atom_parameters.append(sec_atom_parameters)
450
+ sec_atom_parameters.label = pseudopot.element
451
+ sec_atom_parameters.n_valence_electrons = pseudopot.zval
452
+ atom_keys = [
453
+ 'file',
454
+ 'md5_check_sum',
455
+ 'type',
456
+ 'n_radial_grid_points',
457
+ 'n_l',
458
+ 'l',
459
+ 'n_q_coefficients',
460
+ 'q_coefficients',
461
+ ]
462
+ for key in atom_keys:
463
+ setattr(sec_atom_parameters, f'x_qe_phonon_{key}', pseudopot.get(key))
464
+
465
+ method_keys = [
466
+ 'n_ws_vectors_electrons',
467
+ 'n_ws_vectors_phonons',
468
+ 'n_ws_vectors_electron_phonon',
469
+ 'n_max_cores',
470
+ 'use_ws',
471
+ 'q_mesh',
472
+ 'n_q_mesh',
473
+ 'k_mesh',
474
+ 'n_k_mesh',
475
+ 'n_max_kpoints_per_pool',
476
+ 'gaussian_broadening',
477
+ 'n_gauss',
478
+ ]
479
+ for key in method_keys:
480
+ setattr(sec_method, f'x_qe_epw_{key}', self.mainfile_parser.get(key))
481
+
482
+ # If this is a continuation (restart) run, not all fields have meaningful values so skip those
483
+ # in such case.
484
+ if self.mainfile_parser.get('restart') is None:
485
+ method_keys = [
486
+ 'kinetic_energy_cutoff',
487
+ 'charge_density_cutoff',
488
+ 'convergence_threshold',
489
+ 'exchange_correlation',
490
+ 'n_kpoints',
491
+ ]
492
+ for key in method_keys:
493
+ setattr(sec_method, f'x_qe_epw_{key}', self.mainfile_parser.get(key))
494
+
495
+ sec_system = System()
496
+ sec_run.system.append(sec_system)
497
+ sec_atoms = Atoms()
498
+ sec_system.atoms = sec_atoms
499
+ alat = self.mainfile_parser.lattice_parameter
500
+ lattice_vectors = self.mainfile_parser.lattice_vectors
501
+ if lattice_vectors is not None:
502
+ sec_atoms.lattice_vectors = np.dot(lattice_vectors, alat)
503
+
504
+ cartesian_axes = self.mainfile_parser.cartesian_axes
505
+ if cartesian_axes is not None:
506
+ sec_atoms.labels = cartesian_axes[0]
507
+ sec_atoms.positions = np.dot(cartesian_axes[2], alat)
508
+
509
+ system_keys = [
510
+ 'bravais_lattice_index',
511
+ 'lattice_parameter',
512
+ 'unit_cell_volume',
513
+ 'n_atoms_cell',
514
+ 'n_atomic_types',
515
+ ]
516
+ for key in system_keys:
517
+ setattr(sec_system, f'x_qe_epw_{key}', self.mainfile_parser.get(key))
518
+
519
+ for q_point in self.mainfile_parser.get('irreducible_q_point', []):
520
+ sec_q_point = x_qe_epw_irreducible_q_point()
521
+ sec_system.x_qe_epw_irreducible_q_point.append(sec_q_point)
522
+ sec_q_point.x_qe_epw_n_symmetries = q_point.n_symmetries
523
+ sec_q_point.x_qe_epw_n_q_star = q_point.n_q_star
524
+ sec_q_point.x_qe_epw_q_star = (
525
+ np.reshape(q_point.q_star, (q_point.n_q_star, 4)).T[1:4].T
526
+ )
527
+
528
+ sec_calc = Calculation()
529
+ sec_run.calculation.append(sec_calc)
530
+ sec_calc.energy = Energy(fermi=self.mainfile_parser.e_fermi)
531
+ sec_calc.x_qe_epw_e_fermi_coarse_grid = self.mainfile_parser.e_fermi_coarse_grid
532
+ self_energy_migdal = self.mainfile_parser.self_energy_migdal_approximation
533
+ if self_energy_migdal is not None:
534
+ sec_migdal = x_qe_epw_self_energy_migdal()
535
+ sec_calc.x_qe_epw_self_energy_migdal = sec_migdal
536
+ sec_migdal.x_qe_epw_fermi_surface_thickness = (
537
+ self_energy_migdal.fermi_surface_thickness
538
+ )
539
+ sec_migdal.x_qe_epw_golden_rule_t = self_energy_migdal.golden_rule_t
540
+ sec_migdal.x_qe_epw_gaussian_broadening = (
541
+ self_energy_migdal.gaussian_broadening
542
+ )
543
+ sec_migdal.x_qe_epw_n_gauss = self_energy_migdal.n_gauss
544
+ sec_migdal.x_qe_epw_dos_ef = self_energy_migdal.dos_ef
545
+ for self_energy in self_energy_migdal.get('self_energy', []):
546
+ sec_self_energy = x_qe_epw_self_energy()
547
+ sec_migdal.x_qe_epw_self_energy.append(sec_self_energy)
548
+ sec_self_energy.x_qe_epw_ismear = self_energy.ismear
549
+ sec_self_energy.x_qe_epw_iq = self_energy.iq
550
+ sec_self_energy.x_qe_epw_coord = self_energy.coord
551
+ sec_self_energy.x_qe_epw_wt = self_energy.wt
552
+ sec_self_energy.x_qe_epw_temp = self_energy.temp
553
+ lambda_gamma_omega = np.transpose(self_energy.lambda_gamma_omega)
554
+ sec_self_energy.x_qe_epw_lambda = lambda_gamma_omega[0]
555
+ sec_self_energy.x_qe_epw_gamma = lambda_gamma_omega[1]
556
+ sec_self_energy.x_qe_epw_omega = lambda_gamma_omega[2]
557
+ lambda_gamma_omega = np.transpose(self_energy.lambda_gamma_omega_tr)
558
+ sec_self_energy.x_qe_epw_lambda_tr = lambda_gamma_omega[0]
559
+ sec_self_energy.x_qe_epw_gamma_tr = lambda_gamma_omega[1]
560
+ sec_self_energy.x_qe_epw_omega_tr = lambda_gamma_omega[2]
561
+ sec_self_energy.x_qe_epw_lambda_tot = self_energy.lambda_tot
562
+ sec_self_energy.x_qe_epw_lambda_tot_tr = self_energy.lambda_tot_tr
563
+
564
+ spectral_migdal = (
565
+ self.mainfile_parser.eliashberg_spectral_function_migdal_approximation
566
+ )
567
+ if spectral_migdal is not None:
568
+ sec_migdal = x_qe_epw_eliashberg_spectral_function_migdal_approximation()
569
+ sec_calc.x_qe_epw_eliashberg_spectral_function_migdal_approximation = (
570
+ sec_migdal
571
+ )
572
+ sec_migdal.x_qe_epw_lambda = spectral_migdal.get('lambda')
573
+ sec_migdal.x_qe_epw_lambda_tr = spectral_migdal.lambda_tr
574
+ sec_migdal.x_qe_epw_logavg = spectral_migdal.logavg
575
+ sec_migdal.x_qe_epw_l_a2f = spectral_migdal.l_a2f
576
+ sec_migdal.x_qe_epw_mu_tc = spectral_migdal.mu_tc
577
+ for timing in spectral_migdal.get('timing', []):
578
+ sec_timing = x_qe_epw_timimg()
579
+ sec_migdal.x_qe_epw_timimg.append(sec_timing)
580
+ sec_timing.x_qe_epw_task = timing[0]
581
+ sec_timing.x_qe_epw_cpu_time = timing[1]
582
+ sec_timing.x_qe_epw_wall_time = timing[2]
583
+ sec_timing.x_qe_epw_n_calls = timing[3]
@@ -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 QuantumEspressoPhononParser
@@ -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_phonon import QuantumEspressoPhononParser
26
+
27
+ if __name__ == '__main__':
28
+ configure_logging(console_log_level=logging.DEBUG)
29
+ archive = EntryArchive()
30
+ QuantumEspressoPhononParser().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_phonon