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,71 @@
|
|
|
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 numpy as np # pylint: disable=unused-import
|
|
20
|
+
import typing # pylint: disable=unused-import
|
|
21
|
+
from nomad.metainfo import ( # pylint: disable=unused-import
|
|
22
|
+
MSection,
|
|
23
|
+
MCategory,
|
|
24
|
+
Category,
|
|
25
|
+
Package,
|
|
26
|
+
Quantity,
|
|
27
|
+
Section,
|
|
28
|
+
SubSection,
|
|
29
|
+
SectionProxy,
|
|
30
|
+
Reference,
|
|
31
|
+
)
|
|
32
|
+
from runschema import method
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
m_package = Package()
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class Method(method.Method):
|
|
39
|
+
m_def = Section(validate=False, extends_base_section=True)
|
|
40
|
+
|
|
41
|
+
x_atk_density_convergence_criterion = Quantity(
|
|
42
|
+
type=np.float64,
|
|
43
|
+
shape=[],
|
|
44
|
+
description="""
|
|
45
|
+
Density convergence criteria to break the SCF cycle
|
|
46
|
+
""",
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
x_atk_mix_old = Quantity(
|
|
50
|
+
type=np.int32,
|
|
51
|
+
shape=[],
|
|
52
|
+
description="""
|
|
53
|
+
Number of old densities in the density mixer
|
|
54
|
+
""",
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
x_atk_mix_weight = Quantity(
|
|
58
|
+
type=np.float64,
|
|
59
|
+
shape=[],
|
|
60
|
+
description="""
|
|
61
|
+
Mixing weight in density mixer
|
|
62
|
+
""",
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
x_atk_monkhorstpack_sampling = Quantity(
|
|
66
|
+
type=np.int32,
|
|
67
|
+
shape=[3],
|
|
68
|
+
description="""
|
|
69
|
+
Monkhorstpack grid sampling
|
|
70
|
+
""",
|
|
71
|
+
)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
code_category: Atomistic code
|
|
2
|
+
code_homepage: https://www.synopsys.com/silicon/quantumatk.html
|
|
3
|
+
code_name: QuantumATK
|
|
4
|
+
metadata:
|
|
5
|
+
codeCategory: Atomistic code
|
|
6
|
+
codeLabel: QuantumATK
|
|
7
|
+
codeLabelStyle: 'capitals: Q, A, T, K'
|
|
8
|
+
codeName: atk
|
|
9
|
+
codeUrl: https://www.synopsys.com/silicon/quantumatk.html
|
|
10
|
+
parserDirName: dependencies/electronic/electronicparsers/atk/
|
|
11
|
+
parserGitUrl: https://github.com/nomad-coe/electronic-parsers.git
|
|
12
|
+
parserSpecific: 'Currently, NOMAD only supports NetCDF output of AtomistixToolKit
|
|
13
|
+
(ATK) and not the
|
|
14
|
+
|
|
15
|
+
HDF5 based output of QuantumATK.
|
|
16
|
+
|
|
17
|
+
'
|
|
18
|
+
preamble: ''
|
|
19
|
+
status: production
|
|
20
|
+
tableOfFiles: '|Input Filename| Description|
|
|
21
|
+
|
|
22
|
+
|--- | --- |
|
|
23
|
+
|
|
24
|
+
|`*.nc` | The NetCDF output is used as the **mainfile** (HDF5 output is currently
|
|
25
|
+
not yet supported) |
|
|
26
|
+
|
|
27
|
+
|`*` | Other ATK input and output files act as auxiliary files that can be downloaded,
|
|
28
|
+
put are not parsed |
|
|
29
|
+
|
|
30
|
+
'
|
|
31
|
+
name: parsers/atk
|
|
32
|
+
parser_class_name: electronicparsers.atk.parser.ATKParser
|
|
33
|
+
python_package: electronicparsers.atk
|
|
34
|
+
plugin_source_code_url: https://github.com/nomad-coe/electronic-parsers/tree/develop/electronicparsers/atk
|
|
@@ -0,0 +1,388 @@
|
|
|
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 os
|
|
20
|
+
import numpy as np
|
|
21
|
+
import re
|
|
22
|
+
import logging
|
|
23
|
+
from scipy.io.netcdf import netcdf_file
|
|
24
|
+
from ase.data import atomic_names
|
|
25
|
+
from ase import lattice as aselattice, Atoms
|
|
26
|
+
from ase.cell import Cell
|
|
27
|
+
from ase import Atoms as aseAtoms
|
|
28
|
+
|
|
29
|
+
from nomad.units import ureg
|
|
30
|
+
from nomad.parsing.file_parser import FileParser, TextParser, Quantity
|
|
31
|
+
from runschema.run import Run, Program
|
|
32
|
+
from runschema.method import Method, Electronic, Smearing, DFT, XCFunctional, Functional
|
|
33
|
+
from runschema.system import System, Atoms
|
|
34
|
+
from runschema.calculation import Calculation, Energy, EnergyEntry, Forces, ForcesEntry
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class NCParser(FileParser):
|
|
38
|
+
def __init__(self):
|
|
39
|
+
super().__init__()
|
|
40
|
+
self._configuration_types = ['MoleculeConfiguration', 'BulkConfiguration']
|
|
41
|
+
self._units = dict(angstrom=ureg.angstrom, bohr=ureg.bohr, kelvin=ureg.kelvin)
|
|
42
|
+
self._fingerprints = dict()
|
|
43
|
+
|
|
44
|
+
@property
|
|
45
|
+
def netcdf(self):
|
|
46
|
+
if self._file_handler is None:
|
|
47
|
+
try:
|
|
48
|
+
self._file_handler = netcdf_file(self.mainfile, mmap=True)
|
|
49
|
+
except Exception:
|
|
50
|
+
return
|
|
51
|
+
# prepare fingerprints required for variables
|
|
52
|
+
if hasattr(self._file_handler, 'fingerprint_table'):
|
|
53
|
+
fprints = [
|
|
54
|
+
p.split(':')
|
|
55
|
+
for p in self._file_handler.fingerprint_table.decode().split('#')
|
|
56
|
+
if p
|
|
57
|
+
] # pylint: disable=maybe-no-member
|
|
58
|
+
self._fingerprints = {p[1]: p[0] for p in fprints}
|
|
59
|
+
|
|
60
|
+
return self._file_handler
|
|
61
|
+
|
|
62
|
+
def resolve_unit(self, val):
|
|
63
|
+
val = val.split('*')
|
|
64
|
+
if len(val) == 2:
|
|
65
|
+
return (
|
|
66
|
+
(float(val[0]) * self._units.get(val[1].lower(), ureg.angstrom))
|
|
67
|
+
.to('angstrom')
|
|
68
|
+
.magnitude
|
|
69
|
+
)
|
|
70
|
+
return float(val[0])
|
|
71
|
+
|
|
72
|
+
def _resolve_configuration(self, data):
|
|
73
|
+
# TODO implement UnitCell, ghost atoms
|
|
74
|
+
|
|
75
|
+
lattices = dict(
|
|
76
|
+
FaceCenteredCubic=aselattice.FCC,
|
|
77
|
+
BodyCenteredCubic=aselattice.BCC,
|
|
78
|
+
Triclinic=aselattice.TRI,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
re_f = r'[\d\.\-\+Ee]+'
|
|
82
|
+
|
|
83
|
+
data = data.data[:].copy().tobytes().decode()
|
|
84
|
+
|
|
85
|
+
elements = re.search(r'elements = \[(.+)\]', data)
|
|
86
|
+
if not elements:
|
|
87
|
+
return
|
|
88
|
+
|
|
89
|
+
coordinates = re.search(r'coordinates *\= *(\[\s*\[[\s\S]+?\]\s*\])', data)
|
|
90
|
+
if not coordinates:
|
|
91
|
+
return
|
|
92
|
+
|
|
93
|
+
try:
|
|
94
|
+
numbers = [
|
|
95
|
+
atomic_names.index(e.strip().title())
|
|
96
|
+
for e in elements.group(1).split(',')
|
|
97
|
+
]
|
|
98
|
+
|
|
99
|
+
positions = np.array(
|
|
100
|
+
[
|
|
101
|
+
v.split(',')
|
|
102
|
+
for v in re.findall(
|
|
103
|
+
rf'\[( *{re_f} *\, *{re_f} *\, *{re_f} *)\]',
|
|
104
|
+
coordinates.group(1),
|
|
105
|
+
)
|
|
106
|
+
],
|
|
107
|
+
dtype=np.dtype(np.float64),
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
atoms = aseAtoms(numbers=numbers, positions=positions)
|
|
111
|
+
|
|
112
|
+
except Exception:
|
|
113
|
+
return
|
|
114
|
+
|
|
115
|
+
velocities = re.search(r'velocities *\= *(\[\s*\[[\s\S]+?\]\s*\])', data)
|
|
116
|
+
if velocities:
|
|
117
|
+
atoms.set_velocities(
|
|
118
|
+
np.array(
|
|
119
|
+
[
|
|
120
|
+
v.split(',')
|
|
121
|
+
for v in re.findall(
|
|
122
|
+
rf'\[( *{re_f} *\, *{re_f} *\, *{re_f} *)\]',
|
|
123
|
+
velocities.group(1),
|
|
124
|
+
)
|
|
125
|
+
],
|
|
126
|
+
dtype=np.dtype(np.float64),
|
|
127
|
+
)
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
if 'MoleculeConfiguration' in data:
|
|
131
|
+
return atoms
|
|
132
|
+
|
|
133
|
+
atoms.set_pbc(True)
|
|
134
|
+
|
|
135
|
+
lattice = re.search(r'\nlattice = (\w+) *\((.+)\)', data)
|
|
136
|
+
lattice, parameters = lattice.groups() if lattice else ('', '')
|
|
137
|
+
parameters = [
|
|
138
|
+
self.resolve_unit(p) for p in re.findall(rf'({re_f} *\* *\w+)', parameters)
|
|
139
|
+
]
|
|
140
|
+
lattice = lattices.get(lattice)
|
|
141
|
+
if lattice is None:
|
|
142
|
+
return
|
|
143
|
+
|
|
144
|
+
# ASE is more strict about the triclinic cell rules than ATK, that is
|
|
145
|
+
# why we can't use ase.lattice.TRI to instantiate it, but have to use
|
|
146
|
+
# the more generic function Cell.fromcellpar
|
|
147
|
+
try:
|
|
148
|
+
if lattice == aselattice.TRI:
|
|
149
|
+
cell = Cell.fromcellpar(parameters)
|
|
150
|
+
else:
|
|
151
|
+
cell = lattice(*parameters).tocell()
|
|
152
|
+
except Exception:
|
|
153
|
+
pass
|
|
154
|
+
else:
|
|
155
|
+
atoms.set_cell(cell, scale_atoms='fractional' in data)
|
|
156
|
+
|
|
157
|
+
return atoms
|
|
158
|
+
|
|
159
|
+
def parse(self, key):
|
|
160
|
+
val = None
|
|
161
|
+
if hasattr(self.netcdf, key):
|
|
162
|
+
val = getattr(self.netcdf, key)
|
|
163
|
+
if isinstance(val, bytes):
|
|
164
|
+
val = val.decode()
|
|
165
|
+
elif key == 'configuration_names':
|
|
166
|
+
val = []
|
|
167
|
+
re_name = re.compile(r'(\w+Configuration\_gID\d+)$')
|
|
168
|
+
for name in self.netcdf.variables.keys():
|
|
169
|
+
name = re.match(re_name, name)
|
|
170
|
+
if name:
|
|
171
|
+
val.append(name.group(1))
|
|
172
|
+
elif key == 'atoms':
|
|
173
|
+
val = dict()
|
|
174
|
+
for name in self.get('configuration_names', []):
|
|
175
|
+
data = self.netcdf.variables.get(name)
|
|
176
|
+
if data is None:
|
|
177
|
+
continue
|
|
178
|
+
val[name] = self._resolve_configuration(data)
|
|
179
|
+
elif key == 'parameters':
|
|
180
|
+
val = dict()
|
|
181
|
+
for name in self.get('configuration_names', []):
|
|
182
|
+
data = self.netcdf.variables.get('%s_calculator' % name)
|
|
183
|
+
if data is None:
|
|
184
|
+
continue
|
|
185
|
+
val[name] = data.data.tobytes()
|
|
186
|
+
elif key == 'energies':
|
|
187
|
+
val = dict()
|
|
188
|
+
# energy_keys = [k for k in self.netcdf.variables.keys() if k.startswith('TotalEnergy')]
|
|
189
|
+
energy_re = r'TotalEnergy\_(gID\d+)\_component\_(\S+)'
|
|
190
|
+
for key_n in self.netcdf.variables.keys():
|
|
191
|
+
energy_key = re.match(energy_re, key_n)
|
|
192
|
+
if energy_key:
|
|
193
|
+
fp = (
|
|
194
|
+
self.netcdf.variables[
|
|
195
|
+
'TotalEnergy_%s_finger_print' % energy_key.group(1)
|
|
196
|
+
]
|
|
197
|
+
.data.tobytes()
|
|
198
|
+
.decode()
|
|
199
|
+
)
|
|
200
|
+
val.setdefault(fp, {})
|
|
201
|
+
val[fp][energy_key.group(2)] = (
|
|
202
|
+
self.netcdf.variables[key_n].data[0] * ureg.eV
|
|
203
|
+
)
|
|
204
|
+
elif key == 'forces':
|
|
205
|
+
val = dict()
|
|
206
|
+
forces_re = r'Forces\_(gID\d+)\_atom\_resolved\_forces'
|
|
207
|
+
for key_n in self.netcdf.variables.keys():
|
|
208
|
+
forces_key = re.match(forces_re, key_n)
|
|
209
|
+
if forces_key:
|
|
210
|
+
fp = (
|
|
211
|
+
self.netcdf.variables[
|
|
212
|
+
'TotalEnergy_%s_finger_print' % forces_key.group(1)
|
|
213
|
+
]
|
|
214
|
+
.data.tobytes()
|
|
215
|
+
.decode()
|
|
216
|
+
)
|
|
217
|
+
val[fp] = self.netcdf.variables[key_n].data * (
|
|
218
|
+
ureg.eV / ureg.angstrom
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
# TODO implement stress, bandstructure, eigenvalues
|
|
222
|
+
self._results[key] = val
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
class CalculatorParser(TextParser):
|
|
226
|
+
def __init__(self):
|
|
227
|
+
super().__init__()
|
|
228
|
+
|
|
229
|
+
def init_quantities(self):
|
|
230
|
+
self._quantities = [
|
|
231
|
+
Quantity(
|
|
232
|
+
'smearing_width', r'electron_temperature *\= *([\d\.]+)', dtype=float
|
|
233
|
+
),
|
|
234
|
+
Quantity('charge', r'charge *\= *([\d\.]+)', dtype=float),
|
|
235
|
+
Quantity('xc_functional', r'exchange_correlation *\= *(\S+)'),
|
|
236
|
+
]
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
class ATKParser:
|
|
240
|
+
def __init__(self):
|
|
241
|
+
self.nc_parser = NCParser()
|
|
242
|
+
self.calculator_parser = CalculatorParser()
|
|
243
|
+
|
|
244
|
+
self._metainfo_map = {
|
|
245
|
+
'Exchange-Correlation': 'energy_xc',
|
|
246
|
+
'Kinetic': 'energy_kinetic_electronic',
|
|
247
|
+
'Entropy-Term': 'energy_correction_entropy',
|
|
248
|
+
'Electrostatic': 'energy_electrostatic',
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
self._xc_functional_map = {
|
|
252
|
+
'LDA.RPA': ['LDA_X', 'LDA_C_RPA'],
|
|
253
|
+
'LDA.PZ': ['LDA_X', 'LDA_C_PZ'],
|
|
254
|
+
'LDA.PW': ['LDA_X', 'LDA_C_PW'],
|
|
255
|
+
'GGA.PW91': ['GGA_X_PW91', 'GGA_C_PW91'],
|
|
256
|
+
'GGA.PBE': ['GGA_X_PBE', 'GGA_C_PBE'],
|
|
257
|
+
'GGA.PBES': ['GGA_X_PBE_SOL', 'GGA_C_PBE_SOL'],
|
|
258
|
+
'GGA.RPBE': ['GGA_X_RPBE', 'GGA_C_PBE'],
|
|
259
|
+
'BLYP': ['GGA_X_B88', 'GGA_C_LYP'],
|
|
260
|
+
'HCTH407': ['GGA_XC_HCTH_407'],
|
|
261
|
+
'WC': ['GGA_X_WC', 'GGA_C_PBE'],
|
|
262
|
+
'AM05': ['GGA_X_AM05', 'GGA_C_AM05'],
|
|
263
|
+
'mBEEF': ['MGGA_X_MBEEF', 'GGA_C_PBE_SOL'],
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
def init_parser(self):
|
|
267
|
+
self.nc_parser.mainfile = self.filepath
|
|
268
|
+
self.nc_parser.logger = self.logger
|
|
269
|
+
|
|
270
|
+
def parse_configurations(self):
|
|
271
|
+
sec_run = self.archive.run[0]
|
|
272
|
+
|
|
273
|
+
def parse_method(name):
|
|
274
|
+
sec_method = Method()
|
|
275
|
+
sec_run.method.append(sec_method)
|
|
276
|
+
|
|
277
|
+
parameters = self.nc_parser.get('parameters').get(name)
|
|
278
|
+
if parameters is None:
|
|
279
|
+
return sec_method
|
|
280
|
+
|
|
281
|
+
# this is only a dummy filename as we will get the info from the calculator data
|
|
282
|
+
self.calculator_parser.mainfile = self.filepath
|
|
283
|
+
self.calculator_parser._file_handler = parameters
|
|
284
|
+
|
|
285
|
+
sec_method.electronic = Electronic(
|
|
286
|
+
relativity_method='pseudo_scalar_relativistic',
|
|
287
|
+
charge=self.calculator_parser.get('charge', 0.0),
|
|
288
|
+
smearing=Smearing(
|
|
289
|
+
kind='fermi',
|
|
290
|
+
width=self.calculator_parser.get('smearing_width', 0.0),
|
|
291
|
+
),
|
|
292
|
+
)
|
|
293
|
+
|
|
294
|
+
sec_dft = DFT()
|
|
295
|
+
sec_method.dft = sec_dft
|
|
296
|
+
sec_xc_functional = XCFunctional()
|
|
297
|
+
sec_dft.xc_functional = sec_xc_functional
|
|
298
|
+
for xc_functional in self._xc_functional_map.get(
|
|
299
|
+
self.calculator_parser.get('xc_functional'), []
|
|
300
|
+
):
|
|
301
|
+
if '_XC' in xc_functional:
|
|
302
|
+
sec_xc_functional.contributions.append(
|
|
303
|
+
Functional(name=xc_functional)
|
|
304
|
+
)
|
|
305
|
+
elif '_X' in xc_functional:
|
|
306
|
+
sec_xc_functional.exchange.append(Functional(name=xc_functional))
|
|
307
|
+
elif '_C' in xc_functional:
|
|
308
|
+
sec_xc_functional.correlation.append(Functional(name=xc_functional))
|
|
309
|
+
|
|
310
|
+
# Basis set
|
|
311
|
+
# TODO: QuantumATK supports multiple types of basis sets: numeric AOs, or plane waves
|
|
312
|
+
# https://www.synopsys.com/silicon/quantumatk/resources/feature-list.html#lcao
|
|
313
|
+
|
|
314
|
+
return sec_method
|
|
315
|
+
|
|
316
|
+
def parse_system(atoms):
|
|
317
|
+
if atoms is None:
|
|
318
|
+
return
|
|
319
|
+
|
|
320
|
+
sec_system = System()
|
|
321
|
+
sec_run.system.append(sec_system)
|
|
322
|
+
sec_atoms = Atoms()
|
|
323
|
+
sec_system.atoms = sec_atoms
|
|
324
|
+
sec_atoms.labels = atoms.get_chemical_symbols()
|
|
325
|
+
sec_atoms.positions = atoms.get_positions() * ureg.angstrom
|
|
326
|
+
sec_atoms.lattice_vectors = atoms.get_cell().array * ureg.angstrom
|
|
327
|
+
sec_atoms.periodic = atoms.get_pbc()
|
|
328
|
+
velocities = atoms.get_velocities()
|
|
329
|
+
if velocities is not None:
|
|
330
|
+
sec_atoms.velocities = velocities * (ureg.angstrom / ureg.fs)
|
|
331
|
+
|
|
332
|
+
return sec_system
|
|
333
|
+
|
|
334
|
+
def parse_scc(fingerprint):
|
|
335
|
+
sec_scc = Calculation()
|
|
336
|
+
sec_run.calculation.append(sec_scc)
|
|
337
|
+
|
|
338
|
+
# energies
|
|
339
|
+
sec_energy = Energy()
|
|
340
|
+
sec_scc.energy = sec_energy
|
|
341
|
+
energy_total = 0.0
|
|
342
|
+
for key, val in self.nc_parser.get('energies').get(fingerprint, {}).items():
|
|
343
|
+
key = self._metainfo_map.get(key)
|
|
344
|
+
energy_total += val
|
|
345
|
+
if key is not None:
|
|
346
|
+
key = key.replace('energy_', '')
|
|
347
|
+
sec_energy.m_add_sub_section(
|
|
348
|
+
getattr(Energy, key), EnergyEntry(value=val)
|
|
349
|
+
)
|
|
350
|
+
sec_energy.total = EnergyEntry(value=energy_total)
|
|
351
|
+
|
|
352
|
+
# forces
|
|
353
|
+
forces = self.nc_parser.get('forces').get(fingerprint)
|
|
354
|
+
if forces is not None:
|
|
355
|
+
sec_forces = Forces()
|
|
356
|
+
sec_scc.forces = sec_forces
|
|
357
|
+
sec_forces.total = ForcesEntry(value=forces)
|
|
358
|
+
|
|
359
|
+
return sec_scc
|
|
360
|
+
|
|
361
|
+
for name, atoms in self.nc_parser.get('atoms', {}).items():
|
|
362
|
+
sec_system = parse_system(atoms)
|
|
363
|
+
sec_method = parse_method(name)
|
|
364
|
+
fingerprint = self.nc_parser._fingerprints.get(
|
|
365
|
+
'gID%s' % name.split('gID')[-1]
|
|
366
|
+
)
|
|
367
|
+
sec_scc = parse_scc(fingerprint)
|
|
368
|
+
if sec_system is not None:
|
|
369
|
+
sec_scc.system_ref = sec_system
|
|
370
|
+
if sec_method is not None:
|
|
371
|
+
sec_scc.method_ref = sec_method
|
|
372
|
+
|
|
373
|
+
def parse(self, filepath, archive, logger):
|
|
374
|
+
self.filepath = os.path.abspath(filepath)
|
|
375
|
+
self.archive = archive
|
|
376
|
+
self.logger = logger if logger is not None else logging.getLogger(__name__)
|
|
377
|
+
|
|
378
|
+
self.init_parser()
|
|
379
|
+
|
|
380
|
+
sec_run = Run()
|
|
381
|
+
self.archive.run.append(sec_run)
|
|
382
|
+
sec_run.program_name = 'ATK'
|
|
383
|
+
version = self.nc_parser.get('version', 'unavailable')
|
|
384
|
+
sec_run.program = Program(name='ATK', version=version)
|
|
385
|
+
|
|
386
|
+
self.parse_configurations()
|
|
387
|
+
|
|
388
|
+
self.nc_parser.close()
|
|
@@ -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 BigDFTParser
|
|
@@ -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.bigdft import BigDFTParser
|
|
26
|
+
|
|
27
|
+
if __name__ == '__main__':
|
|
28
|
+
configure_logging(console_log_level=logging.DEBUG)
|
|
29
|
+
archive = EntryArchive()
|
|
30
|
+
BigDFTParser().parse(sys.argv[1], archive, logging)
|
|
31
|
+
json.dump(archive.m_to_dict(), sys.stdout, indent=2)
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
#
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
code_category: Atomistic code
|
|
2
|
+
code_homepage: http://bigdft.org/
|
|
3
|
+
code_name: BigDFT
|
|
4
|
+
metadata:
|
|
5
|
+
codeCategory: Atomistic code
|
|
6
|
+
codeLabel: BigDFT
|
|
7
|
+
codeLabelStyle: 'Capitals: B,D,F,T,'
|
|
8
|
+
codeName: bigdft
|
|
9
|
+
codeUrl: http://bigdft.org/
|
|
10
|
+
parserDirName: dependencies/electronic/electronicparsers/bigdft/
|
|
11
|
+
parserGitUrl: https://github.com/nomad-coe/electronic-parsers.git
|
|
12
|
+
parserSpecific: ''
|
|
13
|
+
preamble: ''
|
|
14
|
+
status: production
|
|
15
|
+
tableOfFiles: ''
|
|
16
|
+
name: parsers/bigdft
|
|
17
|
+
parser_class_name: electronicparsers.bigdft.parser.BigDFTParser
|
|
18
|
+
python_package: electronicparsers.bigdft
|
|
19
|
+
plugin_source_code_url: https://github.com/nomad-coe/electronic-parsers/tree/develop/electronicparsers/bigdft
|