nomad-parser-plugins-electronic 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.
- electronicparsers/__init__.py +1162 -0
- electronicparsers/abacus/__init__.py +20 -0
- electronicparsers/abacus/__main__.py +32 -0
- electronicparsers/abacus/metainfo/__init__.py +19 -0
- electronicparsers/abacus/metainfo/abacus.py +836 -0
- electronicparsers/abacus/nomad_plugin.yaml +44 -0
- electronicparsers/abacus/parser.py +1975 -0
- electronicparsers/abinit/__init__.py +19 -0
- electronicparsers/abinit/__main__.py +31 -0
- electronicparsers/abinit/metainfo/__init__.py +20 -0
- electronicparsers/abinit/metainfo/abinit.py +871 -0
- electronicparsers/abinit/metainfo/abinit_autogenerated.py +6794 -0
- electronicparsers/abinit/nomad_plugin.yaml +43 -0
- electronicparsers/abinit/parser.py +1922 -0
- electronicparsers/ams/__init__.py +19 -0
- electronicparsers/ams/__main__.py +31 -0
- electronicparsers/ams/metainfo/__init__.py +19 -0
- electronicparsers/ams/metainfo/ams.py +769 -0
- electronicparsers/ams/nomad_plugin.yaml +19 -0
- electronicparsers/ams/parser.py +1849 -0
- electronicparsers/ams/rkf.py +620 -0
- electronicparsers/atk/__init__.py +19 -0
- electronicparsers/atk/__main__.py +31 -0
- electronicparsers/atk/metainfo/__init__.py +19 -0
- electronicparsers/atk/metainfo/atk.py +71 -0
- electronicparsers/atk/nomad_plugin.yaml +34 -0
- electronicparsers/atk/parser.py +388 -0
- electronicparsers/bigdft/__init__.py +19 -0
- electronicparsers/bigdft/__main__.py +31 -0
- electronicparsers/bigdft/metainfo/__init__.py +18 -0
- electronicparsers/bigdft/nomad_plugin.yaml +19 -0
- electronicparsers/bigdft/parser.py +372 -0
- electronicparsers/castep/__init__.py +19 -0
- electronicparsers/castep/__main__.py +31 -0
- electronicparsers/castep/metainfo/__init__.py +19 -0
- electronicparsers/castep/metainfo/castep.py +2481 -0
- electronicparsers/castep/nomad_plugin.yaml +28 -0
- electronicparsers/castep/parser.py +1680 -0
- electronicparsers/charmm/__init__.py +19 -0
- electronicparsers/charmm/__main__.py +31 -0
- electronicparsers/charmm/metainfo/__init__.py +19 -0
- electronicparsers/charmm/metainfo/charmm.py +1931 -0
- electronicparsers/charmm/nomad_plugin.yaml +18 -0
- electronicparsers/charmm/parser.py +61 -0
- electronicparsers/cp2k/__init__.py +19 -0
- electronicparsers/cp2k/__main__.py +31 -0
- electronicparsers/cp2k/metainfo/__init__.py +19 -0
- electronicparsers/cp2k/metainfo/cp2k.py +59185 -0
- electronicparsers/cp2k/metainfo/cp2k_general.py +1014 -0
- electronicparsers/cp2k/nomad_plugin.yaml +49 -0
- electronicparsers/cp2k/parser.py +2324 -0
- electronicparsers/cpmd/__init__.py +19 -0
- electronicparsers/cpmd/__main__.py +31 -0
- electronicparsers/cpmd/metainfo/__init__.py +19 -0
- electronicparsers/cpmd/metainfo/cpmd.py +10733 -0
- electronicparsers/cpmd/metainfo/cpmd_general.py +988 -0
- electronicparsers/cpmd/nomad_plugin.yaml +19 -0
- electronicparsers/cpmd/parser.py +680 -0
- electronicparsers/crystal/__init__.py +19 -0
- electronicparsers/crystal/__main__.py +31 -0
- electronicparsers/crystal/metainfo/__init__.py +19 -0
- electronicparsers/crystal/metainfo/crystal.py +619 -0
- electronicparsers/crystal/nomad_plugin.yaml +36 -0
- electronicparsers/crystal/parser.py +1745 -0
- electronicparsers/dmol3/__init__.py +19 -0
- electronicparsers/dmol3/__main__.py +31 -0
- electronicparsers/dmol3/metainfo/__init__.py +19 -0
- electronicparsers/dmol3/metainfo/dmol3.py +664 -0
- electronicparsers/dmol3/nomad_plugin.yaml +19 -0
- electronicparsers/dmol3/parser.py +750 -0
- electronicparsers/edmft/__init__.py +19 -0
- electronicparsers/edmft/__main__.py +31 -0
- electronicparsers/edmft/metainfo/__init__.py +19 -0
- electronicparsers/edmft/metainfo/edmft.py +96 -0
- electronicparsers/edmft/nomad_plugin.yaml +53 -0
- electronicparsers/edmft/parser.py +912 -0
- electronicparsers/elk/__init__.py +19 -0
- electronicparsers/elk/__main__.py +31 -0
- electronicparsers/elk/metainfo/__init__.py +19 -0
- electronicparsers/elk/metainfo/elk.py +775 -0
- electronicparsers/elk/nomad_plugin.yaml +19 -0
- electronicparsers/elk/parser.py +493 -0
- electronicparsers/exciting/__init__.py +19 -0
- electronicparsers/exciting/__main__.py +31 -0
- electronicparsers/exciting/metainfo/__init__.py +19 -0
- electronicparsers/exciting/metainfo/exciting.py +2942 -0
- electronicparsers/exciting/nomad_plugin.yaml +83 -0
- electronicparsers/exciting/parser.py +3398 -0
- electronicparsers/fhiaims/__init__.py +19 -0
- electronicparsers/fhiaims/__main__.py +31 -0
- electronicparsers/fhiaims/metainfo/__init__.py +19 -0
- electronicparsers/fhiaims/metainfo/fhi_aims.py +1565 -0
- electronicparsers/fhiaims/nomad_plugin.yaml +52 -0
- electronicparsers/fhiaims/parser.py +2582 -0
- electronicparsers/fleur/__init__.py +19 -0
- electronicparsers/fleur/__main__.py +31 -0
- electronicparsers/fleur/metainfo/__init__.py +19 -0
- electronicparsers/fleur/metainfo/fleur.py +623 -0
- electronicparsers/fleur/nomad_plugin.yaml +19 -0
- electronicparsers/fleur/parser.py +952 -0
- electronicparsers/fplo/__init__.py +19 -0
- electronicparsers/fplo/__main__.py +31 -0
- electronicparsers/fplo/metainfo/__init__.py +19 -0
- electronicparsers/fplo/metainfo/fplo.py +188 -0
- electronicparsers/fplo/metainfo/fplo_input_autogenerated.py +2744 -0
- electronicparsers/fplo/metainfo/fplo_temporaries.py +319 -0
- electronicparsers/fplo/nomad_plugin.yaml +19 -0
- electronicparsers/fplo/parser.py +42 -0
- electronicparsers/gamess/__init__.py +19 -0
- electronicparsers/gamess/__main__.py +31 -0
- electronicparsers/gamess/metainfo/__init__.py +19 -0
- electronicparsers/gamess/metainfo/gamess.py +837 -0
- electronicparsers/gamess/nomad_plugin.yaml +19 -0
- electronicparsers/gamess/parser.py +941 -0
- electronicparsers/gaussian/__init__.py +19 -0
- electronicparsers/gaussian/__main__.py +31 -0
- electronicparsers/gaussian/metainfo/__init__.py +19 -0
- electronicparsers/gaussian/metainfo/gaussian.py +1707 -0
- electronicparsers/gaussian/nomad_plugin.yaml +18 -0
- electronicparsers/gaussian/parser.py +1556 -0
- electronicparsers/gpaw/__init__.py +19 -0
- electronicparsers/gpaw/__main__.py +31 -0
- electronicparsers/gpaw/metainfo/__init__.py +19 -0
- electronicparsers/gpaw/metainfo/gpaw.py +214 -0
- electronicparsers/gpaw/nomad_plugin.yaml +19 -0
- electronicparsers/gpaw/parser.py +671 -0
- electronicparsers/magres/__init__.py +19 -0
- electronicparsers/magres/__main__.py +31 -0
- electronicparsers/magres/metainfo/__init__.py +19 -0
- electronicparsers/magres/metainfo/magres.py +110 -0
- electronicparsers/magres/nomad_plugin.yaml +18 -0
- electronicparsers/magres/parser.py +505 -0
- electronicparsers/molcas/__init__.py +19 -0
- electronicparsers/molcas/__main__.py +31 -0
- electronicparsers/molcas/metainfo/__init__.py +19 -0
- electronicparsers/molcas/metainfo/molcas.py +151 -0
- electronicparsers/molcas/nomad_plugin.yaml +19 -0
- electronicparsers/molcas/parser.py +59 -0
- electronicparsers/mopac/__init__.py +19 -0
- electronicparsers/mopac/__main__.py +31 -0
- electronicparsers/mopac/metainfo/__init__.py +19 -0
- electronicparsers/mopac/metainfo/mopac.py +79 -0
- electronicparsers/mopac/nomad_plugin.yaml +19 -0
- electronicparsers/mopac/parser.py +304 -0
- electronicparsers/nwchem/__init__.py +19 -0
- electronicparsers/nwchem/__main__.py +31 -0
- electronicparsers/nwchem/metainfo/__init__.py +19 -0
- electronicparsers/nwchem/metainfo/nwchem.py +487 -0
- electronicparsers/nwchem/nomad_plugin.yaml +19 -0
- electronicparsers/nwchem/parser.py +757 -0
- electronicparsers/ocean/__init__.py +19 -0
- electronicparsers/ocean/__main__.py +31 -0
- electronicparsers/ocean/metainfo/__init__.py +19 -0
- electronicparsers/ocean/metainfo/ocean.py +410 -0
- electronicparsers/ocean/nomad_plugin.yaml +37 -0
- electronicparsers/ocean/parser.py +344 -0
- electronicparsers/octopus/__init__.py +19 -0
- electronicparsers/octopus/__main__.py +31 -0
- electronicparsers/octopus/metainfo/__init__.py +19 -0
- electronicparsers/octopus/metainfo/octopus.py +71 -0
- electronicparsers/octopus/metainfo/octopus_autogenerated.py +11647 -0
- electronicparsers/octopus/nomad_plugin.yaml +41 -0
- electronicparsers/octopus/parser.py +1214 -0
- electronicparsers/onetep/__init__.py +19 -0
- electronicparsers/onetep/__main__.py +31 -0
- electronicparsers/onetep/metainfo/__init__.py +19 -0
- electronicparsers/onetep/metainfo/onetep.py +3443 -0
- electronicparsers/onetep/nomad_plugin.yaml +19 -0
- electronicparsers/onetep/parser.py +577 -0
- electronicparsers/openmx/__init__.py +19 -0
- electronicparsers/openmx/__main__.py +31 -0
- electronicparsers/openmx/metainfo/__init__.py +19 -0
- electronicparsers/openmx/metainfo/openmx.py +24 -0
- electronicparsers/openmx/nomad_plugin.yaml +25 -0
- electronicparsers/openmx/parser.py +918 -0
- electronicparsers/orca/__init__.py +19 -0
- electronicparsers/orca/__main__.py +31 -0
- electronicparsers/orca/metainfo/__init__.py +19 -0
- electronicparsers/orca/metainfo/orca.py +1448 -0
- electronicparsers/orca/nomad_plugin.yaml +19 -0
- electronicparsers/orca/parser.py +1371 -0
- electronicparsers/psi4/__init__.py +19 -0
- electronicparsers/psi4/__main__.py +31 -0
- electronicparsers/psi4/metainfo/__init__.py +19 -0
- electronicparsers/psi4/metainfo/psi4.py +372 -0
- electronicparsers/psi4/nomad_plugin.yaml +27 -0
- electronicparsers/psi4/parser.py +1362 -0
- electronicparsers/qball/__init__.py +19 -0
- electronicparsers/qball/__main__.py +31 -0
- electronicparsers/qball/metainfo/__init__.py +19 -0
- electronicparsers/qball/metainfo/qball.py +27 -0
- electronicparsers/qball/nomad_plugin.yaml +25 -0
- electronicparsers/qball/parser.py +152 -0
- electronicparsers/qbox/__init__.py +19 -0
- electronicparsers/qbox/__main__.py +31 -0
- electronicparsers/qbox/metainfo/__init__.py +19 -0
- electronicparsers/qbox/metainfo/qbox.py +490 -0
- electronicparsers/qbox/nomad_plugin.yaml +19 -0
- electronicparsers/qbox/parser.py +508 -0
- electronicparsers/quantumespresso/__init__.py +19 -0
- electronicparsers/quantumespresso/__main__.py +31 -0
- electronicparsers/quantumespresso/metainfo/__init__.py +19 -0
- electronicparsers/quantumespresso/metainfo/quantum_espresso.py +3296 -0
- electronicparsers/quantumespresso/nomad_plugin.yaml +31 -0
- electronicparsers/quantumespresso/parser.py +3594 -0
- electronicparsers/siesta/__init__.py +19 -0
- electronicparsers/siesta/__main__.py +31 -0
- electronicparsers/siesta/metainfo/__init__.py +19 -0
- electronicparsers/siesta/metainfo/siesta.py +141 -0
- electronicparsers/siesta/metainfo/siesta_autogenerated.py +3365 -0
- electronicparsers/siesta/nomad_plugin.yaml +19 -0
- electronicparsers/siesta/parser.py +607 -0
- electronicparsers/soliddmft/__init__.py +19 -0
- electronicparsers/soliddmft/__main__.py +31 -0
- electronicparsers/soliddmft/metainfo/__init__.py +19 -0
- electronicparsers/soliddmft/metainfo/soliddmft.py +274 -0
- electronicparsers/soliddmft/nomad_plugin.yaml +26 -0
- electronicparsers/soliddmft/parser.py +727 -0
- electronicparsers/tbstudio/__init__.py +19 -0
- electronicparsers/tbstudio/__main__.py +31 -0
- electronicparsers/tbstudio/metainfo/__init__.py +19 -0
- electronicparsers/tbstudio/metainfo/tbstudio.py +34 -0
- electronicparsers/tbstudio/nomad_plugin.yaml +24 -0
- electronicparsers/tbstudio/parser.py +412 -0
- electronicparsers/turbomole/__init__.py +19 -0
- electronicparsers/turbomole/__main__.py +31 -0
- electronicparsers/turbomole/metainfo/__init__.py +19 -0
- electronicparsers/turbomole/metainfo/turbomole.py +727 -0
- electronicparsers/turbomole/nomad_plugin.yaml +18 -0
- electronicparsers/turbomole/parser.py +1585 -0
- electronicparsers/utils/__init__.py +20 -0
- electronicparsers/utils/magres_workflow.py +61 -0
- electronicparsers/utils/utils.py +636 -0
- electronicparsers/vasp/__init__.py +19 -0
- electronicparsers/vasp/__main__.py +31 -0
- electronicparsers/vasp/metainfo/__init__.py +19 -0
- electronicparsers/vasp/metainfo/vasp.py +169 -0
- electronicparsers/vasp/metainfo/vasp_incars.py +3428 -0
- electronicparsers/vasp/metainfo/vasp_incarsOut.py +3428 -0
- electronicparsers/vasp/metainfo/vasp_incarsUnknown.py +86 -0
- electronicparsers/vasp/nomad_plugin.yaml +28 -0
- electronicparsers/vasp/parser.py +2340 -0
- electronicparsers/w2dynamics/__init__.py +19 -0
- electronicparsers/w2dynamics/__main__.py +31 -0
- electronicparsers/w2dynamics/metainfo/__init__.py +19 -0
- electronicparsers/w2dynamics/metainfo/w2dynamics.py +1270 -0
- electronicparsers/w2dynamics/nomad_plugin.yaml +36 -0
- electronicparsers/w2dynamics/parser.py +674 -0
- electronicparsers/wannier90/__init__.py +19 -0
- electronicparsers/wannier90/__main__.py +31 -0
- electronicparsers/wannier90/metainfo/__init__.py +19 -0
- electronicparsers/wannier90/metainfo/wannier90.py +56 -0
- electronicparsers/wannier90/nomad_plugin.yaml +34 -0
- electronicparsers/wannier90/parser.py +671 -0
- electronicparsers/wien2k/__init__.py +19 -0
- electronicparsers/wien2k/__main__.py +31 -0
- electronicparsers/wien2k/metainfo/__init__.py +19 -0
- electronicparsers/wien2k/metainfo/wien2k.py +783 -0
- electronicparsers/wien2k/nomad_plugin.yaml +18 -0
- electronicparsers/wien2k/parser.py +1133 -0
- electronicparsers/yambo/__init__.py +19 -0
- electronicparsers/yambo/__main__.py +31 -0
- electronicparsers/yambo/metainfo/__init__.py +19 -0
- electronicparsers/yambo/metainfo/yambo.py +577 -0
- electronicparsers/yambo/nomad_plugin.yaml +31 -0
- electronicparsers/yambo/parser.py +896 -0
- nomad_parser_plugins_electronic-1.0.dist-info/LICENSE +202 -0
- nomad_parser_plugins_electronic-1.0.dist-info/METADATA +360 -0
- nomad_parser_plugins_electronic-1.0.dist-info/RECORD +272 -0
- nomad_parser_plugins_electronic-1.0.dist-info/WHEEL +5 -0
- nomad_parser_plugins_electronic-1.0.dist-info/entry_points.txt +43 -0
- nomad_parser_plugins_electronic-1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,508 @@
|
|
|
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
|
+
|
|
20
|
+
import os
|
|
21
|
+
import logging
|
|
22
|
+
import numpy as np
|
|
23
|
+
from datetime import datetime
|
|
24
|
+
|
|
25
|
+
from nomad.units import ureg
|
|
26
|
+
from nomad.parsing.file_parser import TextParser, Quantity
|
|
27
|
+
from runschema.run import Run, Program, TimeRun
|
|
28
|
+
from runschema.system import System, Atoms
|
|
29
|
+
from runschema.method import Method, DFT, XCFunctional, Functional
|
|
30
|
+
from runschema.calculation import (
|
|
31
|
+
Calculation,
|
|
32
|
+
Energy,
|
|
33
|
+
EnergyEntry,
|
|
34
|
+
ScfIteration,
|
|
35
|
+
Forces,
|
|
36
|
+
ForcesEntry,
|
|
37
|
+
Stress,
|
|
38
|
+
StressEntry,
|
|
39
|
+
Multipoles,
|
|
40
|
+
MultipolesEntry,
|
|
41
|
+
)
|
|
42
|
+
from .metainfo.qbox import x_qbox_section_MLWF
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
re_n = r'[\n\r]'
|
|
46
|
+
re_f = r'[-+]?\d+\.\d*(?:[DdEe][-+]\d+)?'
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class QboxXMLParser(TextParser):
|
|
50
|
+
def init_quantities(self):
|
|
51
|
+
run_quantities = [
|
|
52
|
+
Quantity(
|
|
53
|
+
'parameter',
|
|
54
|
+
r'\[qbox\] \<cmd\>set +(.+?)\<\/cmd\>',
|
|
55
|
+
str_operation=lambda x: x.split(' ', 1),
|
|
56
|
+
repeats=True,
|
|
57
|
+
),
|
|
58
|
+
Quantity(
|
|
59
|
+
'species',
|
|
60
|
+
r'(\<species name=[\s\S]=?)</species>',
|
|
61
|
+
repeats=True,
|
|
62
|
+
sub_parser=TextParser(
|
|
63
|
+
quantities=[
|
|
64
|
+
Quantity('symbol', r'\<symbol\>([A-Z][a-z]*)', dtype=str),
|
|
65
|
+
Quantity(
|
|
66
|
+
'atomic_numer', r'\<atomic_number\>(\d+)', dtype=np.int32
|
|
67
|
+
),
|
|
68
|
+
Quantity('mass', r'\<mass\>(\d+)', dtype=np.float64),
|
|
69
|
+
]
|
|
70
|
+
),
|
|
71
|
+
),
|
|
72
|
+
Quantity(
|
|
73
|
+
'iteration',
|
|
74
|
+
r'(\<iteration[\s\S]+?)</iteration>',
|
|
75
|
+
repeats=True,
|
|
76
|
+
sub_parser=TextParser(
|
|
77
|
+
quantities=[
|
|
78
|
+
Quantity(
|
|
79
|
+
'charge',
|
|
80
|
+
rf'total_electronic_charge: +({re_f})',
|
|
81
|
+
dtype=np.float64,
|
|
82
|
+
),
|
|
83
|
+
Quantity(
|
|
84
|
+
'energy_kinetic_electronic',
|
|
85
|
+
rf'\<ekin\> +({re_f})',
|
|
86
|
+
dtype=np.float64,
|
|
87
|
+
unit=ureg.hartree,
|
|
88
|
+
),
|
|
89
|
+
Quantity(
|
|
90
|
+
'energy_x_qbox_conf',
|
|
91
|
+
rf'\<econf\> +({re_f})',
|
|
92
|
+
dtype=np.float64,
|
|
93
|
+
unit=ureg.hartree,
|
|
94
|
+
),
|
|
95
|
+
Quantity(
|
|
96
|
+
'energy_x_qbox_ps',
|
|
97
|
+
rf'\<eps\> +({re_f})',
|
|
98
|
+
dtype=np.float64,
|
|
99
|
+
unit=ureg.hartree,
|
|
100
|
+
),
|
|
101
|
+
Quantity(
|
|
102
|
+
'energy_x_qbox_nl',
|
|
103
|
+
rf'\<enl\> +({re_f})',
|
|
104
|
+
dtype=np.float64,
|
|
105
|
+
unit=ureg.hartree,
|
|
106
|
+
),
|
|
107
|
+
Quantity(
|
|
108
|
+
'energy_coulomb',
|
|
109
|
+
rf'\<ecoul\> +({re_f})',
|
|
110
|
+
dtype=np.float64,
|
|
111
|
+
unit=ureg.hartree,
|
|
112
|
+
),
|
|
113
|
+
Quantity(
|
|
114
|
+
'energy_xc',
|
|
115
|
+
rf'\<exc\> +({re_f})',
|
|
116
|
+
dtype=np.float64,
|
|
117
|
+
unit=ureg.hartree,
|
|
118
|
+
),
|
|
119
|
+
Quantity(
|
|
120
|
+
'energy_x_qbox_sr',
|
|
121
|
+
rf'\<esr\> +({re_f})',
|
|
122
|
+
dtype=np.float64,
|
|
123
|
+
unit=ureg.hartree,
|
|
124
|
+
),
|
|
125
|
+
Quantity(
|
|
126
|
+
'energy_x_qbox_self',
|
|
127
|
+
rf'\<eself\> +({re_f})',
|
|
128
|
+
dtype=np.float64,
|
|
129
|
+
unit=ureg.hartree,
|
|
130
|
+
),
|
|
131
|
+
Quantity(
|
|
132
|
+
'energy_x_qbox_ts',
|
|
133
|
+
rf'\<ets\> +({re_f})',
|
|
134
|
+
dtype=np.float64,
|
|
135
|
+
unit=ureg.hartree,
|
|
136
|
+
),
|
|
137
|
+
Quantity(
|
|
138
|
+
'energy_x_qbox_exf',
|
|
139
|
+
rf'\<eexf\> +({re_f})',
|
|
140
|
+
dtype=np.float64,
|
|
141
|
+
unit=ureg.hartree,
|
|
142
|
+
),
|
|
143
|
+
Quantity(
|
|
144
|
+
'energy_total',
|
|
145
|
+
rf'\<etotal\> +({re_f})',
|
|
146
|
+
dtype=np.float64,
|
|
147
|
+
unit=ureg.hartree,
|
|
148
|
+
),
|
|
149
|
+
Quantity(
|
|
150
|
+
'energy_x_qbox_pv',
|
|
151
|
+
rf'\<epv\> +({re_f})',
|
|
152
|
+
dtype=np.float64,
|
|
153
|
+
unit=ureg.hartree,
|
|
154
|
+
),
|
|
155
|
+
Quantity(
|
|
156
|
+
'energy_x_qbox_efield',
|
|
157
|
+
rf'\<eefield\> +({re_f})',
|
|
158
|
+
dtype=np.float64,
|
|
159
|
+
unit=ureg.hartree,
|
|
160
|
+
),
|
|
161
|
+
Quantity(
|
|
162
|
+
'energy_x_qbox_enthalpy',
|
|
163
|
+
rf'\<enthalpy\> +({re_f})',
|
|
164
|
+
dtype=np.float64,
|
|
165
|
+
unit=ureg.hartree,
|
|
166
|
+
),
|
|
167
|
+
Quantity(
|
|
168
|
+
'stress_tensor',
|
|
169
|
+
r'(\<stress_tensor[\s\S]+?)\<\/stress_tensor\>',
|
|
170
|
+
sub_parser=TextParser(
|
|
171
|
+
quantities=[
|
|
172
|
+
Quantity(
|
|
173
|
+
'contribution',
|
|
174
|
+
r'(\<sigma_.*\_*xx\>[\s\S]+?)\<\/sigma_.*\_*xz\>',
|
|
175
|
+
repeats=True,
|
|
176
|
+
sub_parser=TextParser(
|
|
177
|
+
quantities=[
|
|
178
|
+
Quantity(
|
|
179
|
+
'kind',
|
|
180
|
+
r'\<sigma_e(.+?)\_',
|
|
181
|
+
dtype=str,
|
|
182
|
+
),
|
|
183
|
+
Quantity(
|
|
184
|
+
'value',
|
|
185
|
+
rf'\> +({re_f})',
|
|
186
|
+
dtype=np.float64,
|
|
187
|
+
repeats=True,
|
|
188
|
+
),
|
|
189
|
+
]
|
|
190
|
+
),
|
|
191
|
+
)
|
|
192
|
+
]
|
|
193
|
+
),
|
|
194
|
+
),
|
|
195
|
+
Quantity(
|
|
196
|
+
'multipole',
|
|
197
|
+
r'(\<[a-z]+pole\>[\s\S]+?)\<\/[a-z]+pole\>',
|
|
198
|
+
repeats=True,
|
|
199
|
+
sub_parser=TextParser(
|
|
200
|
+
quantities=[
|
|
201
|
+
Quantity(
|
|
202
|
+
'dipole',
|
|
203
|
+
rf'\<dipole_([a-z]+)\> +({re_f} +{re_f} +{re_f})',
|
|
204
|
+
repeats=True,
|
|
205
|
+
),
|
|
206
|
+
Quantity(
|
|
207
|
+
'quadrupole',
|
|
208
|
+
rf'\<quadrupole_([a-z]+)\>\s+'
|
|
209
|
+
rf'({re_f} +{re_f} +{re_f})\s+'
|
|
210
|
+
rf'({re_f} +{re_f} +{re_f})\s+'
|
|
211
|
+
rf'({re_f} +{re_f} +{re_f})\s+',
|
|
212
|
+
repeats=True,
|
|
213
|
+
),
|
|
214
|
+
]
|
|
215
|
+
),
|
|
216
|
+
),
|
|
217
|
+
Quantity(
|
|
218
|
+
'mlwf',
|
|
219
|
+
r'(\<mlwf_set[\s\S]+?)\<\/mlwf_set\>',
|
|
220
|
+
sub_parser=TextParser(
|
|
221
|
+
quantities=[
|
|
222
|
+
Quantity(
|
|
223
|
+
'center',
|
|
224
|
+
rf'mlwf center=\" +({re_f} +{re_f} +{re_f}) +\"\s+spread=\" +({re_f})',
|
|
225
|
+
repeats=True,
|
|
226
|
+
dtype=np.dtype(np.float64),
|
|
227
|
+
)
|
|
228
|
+
]
|
|
229
|
+
),
|
|
230
|
+
),
|
|
231
|
+
Quantity(
|
|
232
|
+
'scf',
|
|
233
|
+
r'(total_electronic_charge:.+\s+\<eigenvalue_sum[\s\S]+?)\<\/etotal_int\>',
|
|
234
|
+
repeats=True,
|
|
235
|
+
sub_parser=TextParser(
|
|
236
|
+
quantities=[
|
|
237
|
+
Quantity(
|
|
238
|
+
'charge',
|
|
239
|
+
rf'total_electronic_charge: +({re_f})',
|
|
240
|
+
dtype=np.float64,
|
|
241
|
+
),
|
|
242
|
+
Quantity(
|
|
243
|
+
'energy_sum_eigenvalues',
|
|
244
|
+
rf'\<eigenvalue_sum\> +({re_f})',
|
|
245
|
+
unit=ureg.hartree,
|
|
246
|
+
dtype=np.float64,
|
|
247
|
+
),
|
|
248
|
+
Quantity(
|
|
249
|
+
'energy_total',
|
|
250
|
+
rf'\<etotal_int\> +({re_f})',
|
|
251
|
+
unit=ureg.hartree,
|
|
252
|
+
dtype=np.float64,
|
|
253
|
+
),
|
|
254
|
+
]
|
|
255
|
+
),
|
|
256
|
+
),
|
|
257
|
+
Quantity(
|
|
258
|
+
'atomset',
|
|
259
|
+
r'(\<atomset\>[\s\S]+?)</atomset>',
|
|
260
|
+
sub_parser=TextParser(
|
|
261
|
+
quantities=[
|
|
262
|
+
Quantity(
|
|
263
|
+
'lattice_vectors',
|
|
264
|
+
rf'\<unit_cell\s+'
|
|
265
|
+
rf'a=\" +({re_f}) +({re_f}) +({re_f})\"\s+'
|
|
266
|
+
rf'b=\" +({re_f}) +({re_f}) +({re_f})\"\s+'
|
|
267
|
+
rf'c=\" +({re_f}) +({re_f}) +({re_f})\"\s+',
|
|
268
|
+
dtype=np.dtype(np.float64),
|
|
269
|
+
shape=(3, 3),
|
|
270
|
+
unit=ureg.bohr,
|
|
271
|
+
),
|
|
272
|
+
Quantity(
|
|
273
|
+
'atom',
|
|
274
|
+
r'(\<atom[\s\S]+?)\<\/atom\>',
|
|
275
|
+
repeats=True,
|
|
276
|
+
sub_parser=TextParser(
|
|
277
|
+
quantities=[
|
|
278
|
+
Quantity(
|
|
279
|
+
'label',
|
|
280
|
+
r'\<atom name=\"([A-Z][a-z]*)',
|
|
281
|
+
dtype=str,
|
|
282
|
+
),
|
|
283
|
+
Quantity(
|
|
284
|
+
'position',
|
|
285
|
+
rf'\<position\> +({re_f} +{re_f} +{re_f})',
|
|
286
|
+
dtype=np.dtype(np.float64),
|
|
287
|
+
),
|
|
288
|
+
Quantity(
|
|
289
|
+
'velocity',
|
|
290
|
+
rf'\<velocity\> +({re_f} +{re_f} +{re_f})',
|
|
291
|
+
dtype=np.dtype(np.float64),
|
|
292
|
+
),
|
|
293
|
+
Quantity(
|
|
294
|
+
'force',
|
|
295
|
+
rf'\<force\> +({re_f} +{re_f} +{re_f})',
|
|
296
|
+
dtype=np.dtype(np.float64),
|
|
297
|
+
),
|
|
298
|
+
]
|
|
299
|
+
),
|
|
300
|
+
),
|
|
301
|
+
]
|
|
302
|
+
),
|
|
303
|
+
),
|
|
304
|
+
Quantity(
|
|
305
|
+
'time_calculation',
|
|
306
|
+
rf'\<timing name=.+?({re_f}).+?{re_f}',
|
|
307
|
+
str_operation=lambda x: np.sum(
|
|
308
|
+
np.array(x.split(), dtype=np.float64)
|
|
309
|
+
),
|
|
310
|
+
),
|
|
311
|
+
]
|
|
312
|
+
),
|
|
313
|
+
),
|
|
314
|
+
]
|
|
315
|
+
|
|
316
|
+
self._quantities = [
|
|
317
|
+
Quantity('program_version', r'I qbox (\S+)', dtype=str),
|
|
318
|
+
Quantity(
|
|
319
|
+
'start_time',
|
|
320
|
+
r'\<start_time\> (\d\d\d\d\-\d\d\-\d\dT\d\d:\d\d:\d\dZ)',
|
|
321
|
+
dtype=str,
|
|
322
|
+
),
|
|
323
|
+
Quantity(
|
|
324
|
+
'end_time',
|
|
325
|
+
r'\<end_time\> (\d\d\d\d\-\d\d\-\d\dT\d\d:\d\d:\d\dZ)',
|
|
326
|
+
dtype=str,
|
|
327
|
+
),
|
|
328
|
+
Quantity(
|
|
329
|
+
'x_qbox_nodename',
|
|
330
|
+
r'\<nodename\> (.+) \<\/nodename\>',
|
|
331
|
+
dtype=str,
|
|
332
|
+
flatten=False,
|
|
333
|
+
),
|
|
334
|
+
Quantity(
|
|
335
|
+
'x_qbox_loading_xml_file', r'LoadCmd: loading from (\S+)', dtype=str
|
|
336
|
+
),
|
|
337
|
+
Quantity(
|
|
338
|
+
'run',
|
|
339
|
+
r'(\[qbox\] \<cmd\>[\s\S]+?\<timing name=\" +charge_vft.+)',
|
|
340
|
+
repeats=True,
|
|
341
|
+
sub_parser=TextParser(quantities=run_quantities),
|
|
342
|
+
),
|
|
343
|
+
]
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
class QboxParser:
|
|
347
|
+
def __init__(self):
|
|
348
|
+
self.out_parser = QboxXMLParser()
|
|
349
|
+
self._xc_map = {
|
|
350
|
+
'LDA': ['LDA_X', 'LDA_C_PZ'],
|
|
351
|
+
'VMN': ['LDA_X', 'LDA_C_VWN'],
|
|
352
|
+
'PBE': ['GGA_X_PBE', 'GGA_C_PBE'],
|
|
353
|
+
'PBE0': ['GGA_X_PBE', 'GGA_C_PBE'],
|
|
354
|
+
'B3LYP': ['HYB_GGA_XC_B3LYP5'],
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
def init_parser(self):
|
|
358
|
+
self.out_parser.mainfile = self.filepath
|
|
359
|
+
self.out_parser.logger = self.logger
|
|
360
|
+
|
|
361
|
+
def parse_run(self, index):
|
|
362
|
+
sec_run = Run()
|
|
363
|
+
self.archive.run.append(sec_run)
|
|
364
|
+
sec_run.program = Program(
|
|
365
|
+
name='qbox', version=self.out_parser.get('program_version')
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
def format_time(time):
|
|
369
|
+
if time is not None:
|
|
370
|
+
return datetime.strptime(time, '%Y-%m-%dT%H:%M:%S%z').timestamp()
|
|
371
|
+
|
|
372
|
+
sec_run.time_run = TimeRun(
|
|
373
|
+
date_start=format_time(self.out_parser.start_time),
|
|
374
|
+
date_end=format_time(self.out_parser.end_time),
|
|
375
|
+
)
|
|
376
|
+
|
|
377
|
+
sec_method = Method()
|
|
378
|
+
sec_run.method.append(sec_method)
|
|
379
|
+
parameters = {
|
|
380
|
+
key: val for key, val in self.out_parser.run[index].get('parameter', [])
|
|
381
|
+
}
|
|
382
|
+
sec_method.x_qbox_input_parameters = parameters
|
|
383
|
+
if parameters.get('xc') is not None:
|
|
384
|
+
sec_method.dft = DFT(xc_functional=XCFunctional())
|
|
385
|
+
for xc_functional in self._xc_map.get(parameters['xc'], []):
|
|
386
|
+
if '_X_' in xc_functional or xc_functional.endswith('_X'):
|
|
387
|
+
sec_method.dft.xc_functional.exchange.append(
|
|
388
|
+
Functional(name=xc_functional)
|
|
389
|
+
)
|
|
390
|
+
elif '_C_' in xc_functional or xc_functional.endswith('_C'):
|
|
391
|
+
sec_method.dft.xc_functional.correlation.append(
|
|
392
|
+
Functional(name=xc_functional)
|
|
393
|
+
)
|
|
394
|
+
elif 'HYB' in xc_functional:
|
|
395
|
+
sec_method.dft.xc_functional.hybrid.append(
|
|
396
|
+
Functional(name=xc_functional)
|
|
397
|
+
)
|
|
398
|
+
else:
|
|
399
|
+
sec_method.dft.xc_functional.contributions.append(
|
|
400
|
+
Functional(name=xc_functional)
|
|
401
|
+
)
|
|
402
|
+
|
|
403
|
+
def symmetrize_stress(stress):
|
|
404
|
+
if not stress:
|
|
405
|
+
return
|
|
406
|
+
symmetrized = np.zeros((3, 3))
|
|
407
|
+
symmetrized[0][0] = stress[0]
|
|
408
|
+
symmetrized[1][1] = stress[1]
|
|
409
|
+
symmetrized[2][2] = stress[2]
|
|
410
|
+
symmetrized[0][1] = symmetrized[1][0] = stress[3]
|
|
411
|
+
symmetrized[1][2] = symmetrized[2][1] = stress[4]
|
|
412
|
+
symmetrized[0][2] = symmetrized[2][0] = stress[5]
|
|
413
|
+
return symmetrized * ureg.GPa
|
|
414
|
+
|
|
415
|
+
for iteration in self.out_parser.run[index].get('iteration', []):
|
|
416
|
+
time_initial = (
|
|
417
|
+
sec_run.calculation[-1].time_physical
|
|
418
|
+
if sec_run.calculation
|
|
419
|
+
else 0 * ureg.s
|
|
420
|
+
)
|
|
421
|
+
sec_scc = Calculation()
|
|
422
|
+
sec_run.calculation.append(sec_scc)
|
|
423
|
+
sec_scc.energy = Energy()
|
|
424
|
+
sec_system = System()
|
|
425
|
+
sec_run.system.append(sec_system)
|
|
426
|
+
sec_scc.system_ref = sec_system
|
|
427
|
+
|
|
428
|
+
for key, val in iteration.items():
|
|
429
|
+
if key.startswith('energy_') and val is not None:
|
|
430
|
+
setattr(
|
|
431
|
+
sec_scc.energy,
|
|
432
|
+
key.replace('energy_', ''),
|
|
433
|
+
EnergyEntry(value=val),
|
|
434
|
+
)
|
|
435
|
+
|
|
436
|
+
if iteration.stress_tensor is not None:
|
|
437
|
+
sec_stress = Stress()
|
|
438
|
+
sec_scc.stress = sec_stress
|
|
439
|
+
for contribution in iteration.stress_tensor.get('contribution', []):
|
|
440
|
+
value = symmetrize_stress(contribution.get('value', []))
|
|
441
|
+
if contribution.kind is None or contribution.kind == 'ks':
|
|
442
|
+
sec_stress.total = StressEntry(value=value)
|
|
443
|
+
else:
|
|
444
|
+
sec_stress.contributions.append(
|
|
445
|
+
StressEntry(kind=contribution.kind, value=value)
|
|
446
|
+
)
|
|
447
|
+
|
|
448
|
+
if iteration.multipole is not None:
|
|
449
|
+
sec_multipoles = Multipoles()
|
|
450
|
+
sec_scc.multipoles.append(sec_multipoles)
|
|
451
|
+
for multipole in iteration.multipole:
|
|
452
|
+
# TODO add contributions
|
|
453
|
+
for dipole in multipole.get('dipole', []):
|
|
454
|
+
if dipole[0] == 'total':
|
|
455
|
+
sec_multipoles.dipole = MultipolesEntry(
|
|
456
|
+
total=np.array(dipole[1:], dtype=np.float64)
|
|
457
|
+
)
|
|
458
|
+
for quadrupole in multipole.get('quadrupole', []):
|
|
459
|
+
if quadrupole[0] == 'total':
|
|
460
|
+
sec_multipoles.quadrupole = MultipolesEntry(
|
|
461
|
+
total=np.array(quadrupole[1:], dtype=np.float64)
|
|
462
|
+
)
|
|
463
|
+
|
|
464
|
+
if iteration.mlwf is not None:
|
|
465
|
+
for center in iteration.mlwf.get('center', []):
|
|
466
|
+
sec_mlwf = x_qbox_section_MLWF()
|
|
467
|
+
sec_scc.x_qbox_section_MLWF.append(sec_mlwf)
|
|
468
|
+
sec_mlwf.x_qbox_geometry_MLWF_atom_positions = (
|
|
469
|
+
center[:3] * ureg.bohr
|
|
470
|
+
)
|
|
471
|
+
sec_mlwf.x_qbox_geometry_MLWF_atom_spread = center[3] * ureg.bohr
|
|
472
|
+
|
|
473
|
+
for scf in iteration.get('scf', []):
|
|
474
|
+
sec_scf = ScfIteration()
|
|
475
|
+
sec_scc.scf_iteration.append(sec_scf)
|
|
476
|
+
sec_scf.energy = Energy(
|
|
477
|
+
total=EnergyEntry(value=scf.energy_total),
|
|
478
|
+
sum_eigenvalues=EnergyEntry(value=scf.energy_sum_eigenvalues),
|
|
479
|
+
)
|
|
480
|
+
|
|
481
|
+
if iteration.atomset is not None:
|
|
482
|
+
atoms = iteration.atomset.get('atom', [])
|
|
483
|
+
sec_system.atoms = Atoms(
|
|
484
|
+
lattice_vectors=iteration.atomset.lattice_vectors,
|
|
485
|
+
positions=[atom.position for atom in atoms] * ureg.bohr,
|
|
486
|
+
labels=[atom.label for atom in atoms],
|
|
487
|
+
velocities=[atom.velocity for atom in atoms]
|
|
488
|
+
* (ureg.bohr / ureg.atomic_unit_of_time),
|
|
489
|
+
)
|
|
490
|
+
forces = [atom.force for atom in atoms]
|
|
491
|
+
if forces:
|
|
492
|
+
sec_scc.forces = Forces(
|
|
493
|
+
total=ForcesEntry(value=forces * (ureg.hartree / ureg.bohr))
|
|
494
|
+
)
|
|
495
|
+
|
|
496
|
+
if iteration.time_calculation is not None:
|
|
497
|
+
sec_scc.time_calculation = iteration.time_calculation
|
|
498
|
+
sec_scc.time_physical = time_initial + sec_scc.time_calculation
|
|
499
|
+
|
|
500
|
+
def parse(self, filepath, archive, logger):
|
|
501
|
+
self.filepath = os.path.abspath(filepath)
|
|
502
|
+
self.archive = archive
|
|
503
|
+
self.logger = logging.getLogger(__name__) if logger is None else logger
|
|
504
|
+
self.maindir = os.path.dirname(self.filepath)
|
|
505
|
+
self.init_parser()
|
|
506
|
+
|
|
507
|
+
for n in range(len(self.out_parser.get('run', []))):
|
|
508
|
+
self.parse_run(n)
|
|
@@ -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 QuantumEspressoParser
|
|
@@ -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 electronicparsers.quantumespresso import QuantumEspressoParser
|
|
26
|
+
|
|
27
|
+
if __name__ == '__main__':
|
|
28
|
+
configure_logging(console_log_level=logging.DEBUG)
|
|
29
|
+
archive = EntryArchive()
|
|
30
|
+
QuantumEspressoParser().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
|