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.
Files changed (272) hide show
  1. electronicparsers/__init__.py +1162 -0
  2. electronicparsers/abacus/__init__.py +20 -0
  3. electronicparsers/abacus/__main__.py +32 -0
  4. electronicparsers/abacus/metainfo/__init__.py +19 -0
  5. electronicparsers/abacus/metainfo/abacus.py +836 -0
  6. electronicparsers/abacus/nomad_plugin.yaml +44 -0
  7. electronicparsers/abacus/parser.py +1975 -0
  8. electronicparsers/abinit/__init__.py +19 -0
  9. electronicparsers/abinit/__main__.py +31 -0
  10. electronicparsers/abinit/metainfo/__init__.py +20 -0
  11. electronicparsers/abinit/metainfo/abinit.py +871 -0
  12. electronicparsers/abinit/metainfo/abinit_autogenerated.py +6794 -0
  13. electronicparsers/abinit/nomad_plugin.yaml +43 -0
  14. electronicparsers/abinit/parser.py +1922 -0
  15. electronicparsers/ams/__init__.py +19 -0
  16. electronicparsers/ams/__main__.py +31 -0
  17. electronicparsers/ams/metainfo/__init__.py +19 -0
  18. electronicparsers/ams/metainfo/ams.py +769 -0
  19. electronicparsers/ams/nomad_plugin.yaml +19 -0
  20. electronicparsers/ams/parser.py +1849 -0
  21. electronicparsers/ams/rkf.py +620 -0
  22. electronicparsers/atk/__init__.py +19 -0
  23. electronicparsers/atk/__main__.py +31 -0
  24. electronicparsers/atk/metainfo/__init__.py +19 -0
  25. electronicparsers/atk/metainfo/atk.py +71 -0
  26. electronicparsers/atk/nomad_plugin.yaml +34 -0
  27. electronicparsers/atk/parser.py +388 -0
  28. electronicparsers/bigdft/__init__.py +19 -0
  29. electronicparsers/bigdft/__main__.py +31 -0
  30. electronicparsers/bigdft/metainfo/__init__.py +18 -0
  31. electronicparsers/bigdft/nomad_plugin.yaml +19 -0
  32. electronicparsers/bigdft/parser.py +372 -0
  33. electronicparsers/castep/__init__.py +19 -0
  34. electronicparsers/castep/__main__.py +31 -0
  35. electronicparsers/castep/metainfo/__init__.py +19 -0
  36. electronicparsers/castep/metainfo/castep.py +2481 -0
  37. electronicparsers/castep/nomad_plugin.yaml +28 -0
  38. electronicparsers/castep/parser.py +1680 -0
  39. electronicparsers/charmm/__init__.py +19 -0
  40. electronicparsers/charmm/__main__.py +31 -0
  41. electronicparsers/charmm/metainfo/__init__.py +19 -0
  42. electronicparsers/charmm/metainfo/charmm.py +1931 -0
  43. electronicparsers/charmm/nomad_plugin.yaml +18 -0
  44. electronicparsers/charmm/parser.py +61 -0
  45. electronicparsers/cp2k/__init__.py +19 -0
  46. electronicparsers/cp2k/__main__.py +31 -0
  47. electronicparsers/cp2k/metainfo/__init__.py +19 -0
  48. electronicparsers/cp2k/metainfo/cp2k.py +59185 -0
  49. electronicparsers/cp2k/metainfo/cp2k_general.py +1014 -0
  50. electronicparsers/cp2k/nomad_plugin.yaml +49 -0
  51. electronicparsers/cp2k/parser.py +2324 -0
  52. electronicparsers/cpmd/__init__.py +19 -0
  53. electronicparsers/cpmd/__main__.py +31 -0
  54. electronicparsers/cpmd/metainfo/__init__.py +19 -0
  55. electronicparsers/cpmd/metainfo/cpmd.py +10733 -0
  56. electronicparsers/cpmd/metainfo/cpmd_general.py +988 -0
  57. electronicparsers/cpmd/nomad_plugin.yaml +19 -0
  58. electronicparsers/cpmd/parser.py +680 -0
  59. electronicparsers/crystal/__init__.py +19 -0
  60. electronicparsers/crystal/__main__.py +31 -0
  61. electronicparsers/crystal/metainfo/__init__.py +19 -0
  62. electronicparsers/crystal/metainfo/crystal.py +619 -0
  63. electronicparsers/crystal/nomad_plugin.yaml +36 -0
  64. electronicparsers/crystal/parser.py +1745 -0
  65. electronicparsers/dmol3/__init__.py +19 -0
  66. electronicparsers/dmol3/__main__.py +31 -0
  67. electronicparsers/dmol3/metainfo/__init__.py +19 -0
  68. electronicparsers/dmol3/metainfo/dmol3.py +664 -0
  69. electronicparsers/dmol3/nomad_plugin.yaml +19 -0
  70. electronicparsers/dmol3/parser.py +750 -0
  71. electronicparsers/edmft/__init__.py +19 -0
  72. electronicparsers/edmft/__main__.py +31 -0
  73. electronicparsers/edmft/metainfo/__init__.py +19 -0
  74. electronicparsers/edmft/metainfo/edmft.py +96 -0
  75. electronicparsers/edmft/nomad_plugin.yaml +53 -0
  76. electronicparsers/edmft/parser.py +912 -0
  77. electronicparsers/elk/__init__.py +19 -0
  78. electronicparsers/elk/__main__.py +31 -0
  79. electronicparsers/elk/metainfo/__init__.py +19 -0
  80. electronicparsers/elk/metainfo/elk.py +775 -0
  81. electronicparsers/elk/nomad_plugin.yaml +19 -0
  82. electronicparsers/elk/parser.py +493 -0
  83. electronicparsers/exciting/__init__.py +19 -0
  84. electronicparsers/exciting/__main__.py +31 -0
  85. electronicparsers/exciting/metainfo/__init__.py +19 -0
  86. electronicparsers/exciting/metainfo/exciting.py +2942 -0
  87. electronicparsers/exciting/nomad_plugin.yaml +83 -0
  88. electronicparsers/exciting/parser.py +3398 -0
  89. electronicparsers/fhiaims/__init__.py +19 -0
  90. electronicparsers/fhiaims/__main__.py +31 -0
  91. electronicparsers/fhiaims/metainfo/__init__.py +19 -0
  92. electronicparsers/fhiaims/metainfo/fhi_aims.py +1565 -0
  93. electronicparsers/fhiaims/nomad_plugin.yaml +52 -0
  94. electronicparsers/fhiaims/parser.py +2582 -0
  95. electronicparsers/fleur/__init__.py +19 -0
  96. electronicparsers/fleur/__main__.py +31 -0
  97. electronicparsers/fleur/metainfo/__init__.py +19 -0
  98. electronicparsers/fleur/metainfo/fleur.py +623 -0
  99. electronicparsers/fleur/nomad_plugin.yaml +19 -0
  100. electronicparsers/fleur/parser.py +952 -0
  101. electronicparsers/fplo/__init__.py +19 -0
  102. electronicparsers/fplo/__main__.py +31 -0
  103. electronicparsers/fplo/metainfo/__init__.py +19 -0
  104. electronicparsers/fplo/metainfo/fplo.py +188 -0
  105. electronicparsers/fplo/metainfo/fplo_input_autogenerated.py +2744 -0
  106. electronicparsers/fplo/metainfo/fplo_temporaries.py +319 -0
  107. electronicparsers/fplo/nomad_plugin.yaml +19 -0
  108. electronicparsers/fplo/parser.py +42 -0
  109. electronicparsers/gamess/__init__.py +19 -0
  110. electronicparsers/gamess/__main__.py +31 -0
  111. electronicparsers/gamess/metainfo/__init__.py +19 -0
  112. electronicparsers/gamess/metainfo/gamess.py +837 -0
  113. electronicparsers/gamess/nomad_plugin.yaml +19 -0
  114. electronicparsers/gamess/parser.py +941 -0
  115. electronicparsers/gaussian/__init__.py +19 -0
  116. electronicparsers/gaussian/__main__.py +31 -0
  117. electronicparsers/gaussian/metainfo/__init__.py +19 -0
  118. electronicparsers/gaussian/metainfo/gaussian.py +1707 -0
  119. electronicparsers/gaussian/nomad_plugin.yaml +18 -0
  120. electronicparsers/gaussian/parser.py +1556 -0
  121. electronicparsers/gpaw/__init__.py +19 -0
  122. electronicparsers/gpaw/__main__.py +31 -0
  123. electronicparsers/gpaw/metainfo/__init__.py +19 -0
  124. electronicparsers/gpaw/metainfo/gpaw.py +214 -0
  125. electronicparsers/gpaw/nomad_plugin.yaml +19 -0
  126. electronicparsers/gpaw/parser.py +671 -0
  127. electronicparsers/magres/__init__.py +19 -0
  128. electronicparsers/magres/__main__.py +31 -0
  129. electronicparsers/magres/metainfo/__init__.py +19 -0
  130. electronicparsers/magres/metainfo/magres.py +110 -0
  131. electronicparsers/magres/nomad_plugin.yaml +18 -0
  132. electronicparsers/magres/parser.py +505 -0
  133. electronicparsers/molcas/__init__.py +19 -0
  134. electronicparsers/molcas/__main__.py +31 -0
  135. electronicparsers/molcas/metainfo/__init__.py +19 -0
  136. electronicparsers/molcas/metainfo/molcas.py +151 -0
  137. electronicparsers/molcas/nomad_plugin.yaml +19 -0
  138. electronicparsers/molcas/parser.py +59 -0
  139. electronicparsers/mopac/__init__.py +19 -0
  140. electronicparsers/mopac/__main__.py +31 -0
  141. electronicparsers/mopac/metainfo/__init__.py +19 -0
  142. electronicparsers/mopac/metainfo/mopac.py +79 -0
  143. electronicparsers/mopac/nomad_plugin.yaml +19 -0
  144. electronicparsers/mopac/parser.py +304 -0
  145. electronicparsers/nwchem/__init__.py +19 -0
  146. electronicparsers/nwchem/__main__.py +31 -0
  147. electronicparsers/nwchem/metainfo/__init__.py +19 -0
  148. electronicparsers/nwchem/metainfo/nwchem.py +487 -0
  149. electronicparsers/nwchem/nomad_plugin.yaml +19 -0
  150. electronicparsers/nwchem/parser.py +757 -0
  151. electronicparsers/ocean/__init__.py +19 -0
  152. electronicparsers/ocean/__main__.py +31 -0
  153. electronicparsers/ocean/metainfo/__init__.py +19 -0
  154. electronicparsers/ocean/metainfo/ocean.py +410 -0
  155. electronicparsers/ocean/nomad_plugin.yaml +37 -0
  156. electronicparsers/ocean/parser.py +344 -0
  157. electronicparsers/octopus/__init__.py +19 -0
  158. electronicparsers/octopus/__main__.py +31 -0
  159. electronicparsers/octopus/metainfo/__init__.py +19 -0
  160. electronicparsers/octopus/metainfo/octopus.py +71 -0
  161. electronicparsers/octopus/metainfo/octopus_autogenerated.py +11647 -0
  162. electronicparsers/octopus/nomad_plugin.yaml +41 -0
  163. electronicparsers/octopus/parser.py +1214 -0
  164. electronicparsers/onetep/__init__.py +19 -0
  165. electronicparsers/onetep/__main__.py +31 -0
  166. electronicparsers/onetep/metainfo/__init__.py +19 -0
  167. electronicparsers/onetep/metainfo/onetep.py +3443 -0
  168. electronicparsers/onetep/nomad_plugin.yaml +19 -0
  169. electronicparsers/onetep/parser.py +577 -0
  170. electronicparsers/openmx/__init__.py +19 -0
  171. electronicparsers/openmx/__main__.py +31 -0
  172. electronicparsers/openmx/metainfo/__init__.py +19 -0
  173. electronicparsers/openmx/metainfo/openmx.py +24 -0
  174. electronicparsers/openmx/nomad_plugin.yaml +25 -0
  175. electronicparsers/openmx/parser.py +918 -0
  176. electronicparsers/orca/__init__.py +19 -0
  177. electronicparsers/orca/__main__.py +31 -0
  178. electronicparsers/orca/metainfo/__init__.py +19 -0
  179. electronicparsers/orca/metainfo/orca.py +1448 -0
  180. electronicparsers/orca/nomad_plugin.yaml +19 -0
  181. electronicparsers/orca/parser.py +1371 -0
  182. electronicparsers/psi4/__init__.py +19 -0
  183. electronicparsers/psi4/__main__.py +31 -0
  184. electronicparsers/psi4/metainfo/__init__.py +19 -0
  185. electronicparsers/psi4/metainfo/psi4.py +372 -0
  186. electronicparsers/psi4/nomad_plugin.yaml +27 -0
  187. electronicparsers/psi4/parser.py +1362 -0
  188. electronicparsers/qball/__init__.py +19 -0
  189. electronicparsers/qball/__main__.py +31 -0
  190. electronicparsers/qball/metainfo/__init__.py +19 -0
  191. electronicparsers/qball/metainfo/qball.py +27 -0
  192. electronicparsers/qball/nomad_plugin.yaml +25 -0
  193. electronicparsers/qball/parser.py +152 -0
  194. electronicparsers/qbox/__init__.py +19 -0
  195. electronicparsers/qbox/__main__.py +31 -0
  196. electronicparsers/qbox/metainfo/__init__.py +19 -0
  197. electronicparsers/qbox/metainfo/qbox.py +490 -0
  198. electronicparsers/qbox/nomad_plugin.yaml +19 -0
  199. electronicparsers/qbox/parser.py +508 -0
  200. electronicparsers/quantumespresso/__init__.py +19 -0
  201. electronicparsers/quantumespresso/__main__.py +31 -0
  202. electronicparsers/quantumespresso/metainfo/__init__.py +19 -0
  203. electronicparsers/quantumespresso/metainfo/quantum_espresso.py +3296 -0
  204. electronicparsers/quantumespresso/nomad_plugin.yaml +31 -0
  205. electronicparsers/quantumespresso/parser.py +3594 -0
  206. electronicparsers/siesta/__init__.py +19 -0
  207. electronicparsers/siesta/__main__.py +31 -0
  208. electronicparsers/siesta/metainfo/__init__.py +19 -0
  209. electronicparsers/siesta/metainfo/siesta.py +141 -0
  210. electronicparsers/siesta/metainfo/siesta_autogenerated.py +3365 -0
  211. electronicparsers/siesta/nomad_plugin.yaml +19 -0
  212. electronicparsers/siesta/parser.py +607 -0
  213. electronicparsers/soliddmft/__init__.py +19 -0
  214. electronicparsers/soliddmft/__main__.py +31 -0
  215. electronicparsers/soliddmft/metainfo/__init__.py +19 -0
  216. electronicparsers/soliddmft/metainfo/soliddmft.py +274 -0
  217. electronicparsers/soliddmft/nomad_plugin.yaml +26 -0
  218. electronicparsers/soliddmft/parser.py +727 -0
  219. electronicparsers/tbstudio/__init__.py +19 -0
  220. electronicparsers/tbstudio/__main__.py +31 -0
  221. electronicparsers/tbstudio/metainfo/__init__.py +19 -0
  222. electronicparsers/tbstudio/metainfo/tbstudio.py +34 -0
  223. electronicparsers/tbstudio/nomad_plugin.yaml +24 -0
  224. electronicparsers/tbstudio/parser.py +412 -0
  225. electronicparsers/turbomole/__init__.py +19 -0
  226. electronicparsers/turbomole/__main__.py +31 -0
  227. electronicparsers/turbomole/metainfo/__init__.py +19 -0
  228. electronicparsers/turbomole/metainfo/turbomole.py +727 -0
  229. electronicparsers/turbomole/nomad_plugin.yaml +18 -0
  230. electronicparsers/turbomole/parser.py +1585 -0
  231. electronicparsers/utils/__init__.py +20 -0
  232. electronicparsers/utils/magres_workflow.py +61 -0
  233. electronicparsers/utils/utils.py +636 -0
  234. electronicparsers/vasp/__init__.py +19 -0
  235. electronicparsers/vasp/__main__.py +31 -0
  236. electronicparsers/vasp/metainfo/__init__.py +19 -0
  237. electronicparsers/vasp/metainfo/vasp.py +169 -0
  238. electronicparsers/vasp/metainfo/vasp_incars.py +3428 -0
  239. electronicparsers/vasp/metainfo/vasp_incarsOut.py +3428 -0
  240. electronicparsers/vasp/metainfo/vasp_incarsUnknown.py +86 -0
  241. electronicparsers/vasp/nomad_plugin.yaml +28 -0
  242. electronicparsers/vasp/parser.py +2340 -0
  243. electronicparsers/w2dynamics/__init__.py +19 -0
  244. electronicparsers/w2dynamics/__main__.py +31 -0
  245. electronicparsers/w2dynamics/metainfo/__init__.py +19 -0
  246. electronicparsers/w2dynamics/metainfo/w2dynamics.py +1270 -0
  247. electronicparsers/w2dynamics/nomad_plugin.yaml +36 -0
  248. electronicparsers/w2dynamics/parser.py +674 -0
  249. electronicparsers/wannier90/__init__.py +19 -0
  250. electronicparsers/wannier90/__main__.py +31 -0
  251. electronicparsers/wannier90/metainfo/__init__.py +19 -0
  252. electronicparsers/wannier90/metainfo/wannier90.py +56 -0
  253. electronicparsers/wannier90/nomad_plugin.yaml +34 -0
  254. electronicparsers/wannier90/parser.py +671 -0
  255. electronicparsers/wien2k/__init__.py +19 -0
  256. electronicparsers/wien2k/__main__.py +31 -0
  257. electronicparsers/wien2k/metainfo/__init__.py +19 -0
  258. electronicparsers/wien2k/metainfo/wien2k.py +783 -0
  259. electronicparsers/wien2k/nomad_plugin.yaml +18 -0
  260. electronicparsers/wien2k/parser.py +1133 -0
  261. electronicparsers/yambo/__init__.py +19 -0
  262. electronicparsers/yambo/__main__.py +31 -0
  263. electronicparsers/yambo/metainfo/__init__.py +19 -0
  264. electronicparsers/yambo/metainfo/yambo.py +577 -0
  265. electronicparsers/yambo/nomad_plugin.yaml +31 -0
  266. electronicparsers/yambo/parser.py +896 -0
  267. nomad_parser_plugins_electronic-1.0.dist-info/LICENSE +202 -0
  268. nomad_parser_plugins_electronic-1.0.dist-info/METADATA +360 -0
  269. nomad_parser_plugins_electronic-1.0.dist-info/RECORD +272 -0
  270. nomad_parser_plugins_electronic-1.0.dist-info/WHEEL +5 -0
  271. nomad_parser_plugins_electronic-1.0.dist-info/entry_points.txt +43 -0
  272. nomad_parser_plugins_electronic-1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,19 @@
1
+ code_category: Atomistic code
2
+ code_homepage: https://siesta-project.org/siesta
3
+ code_name: SIESTA
4
+ metadata:
5
+ codeCategory: Atomistic code
6
+ codeLabel: SIESTA
7
+ codeLabelStyle: All in capitals
8
+ codeName: siesta
9
+ codeUrl: https://siesta-project.org/siesta
10
+ parserDirName: dependencies/electronic/electronicparsers/siesta/
11
+ parserGitUrl: https://github.com/nomad-coe/electronic-parsers.git
12
+ parserSpecific: ''
13
+ preamble: ''
14
+ status: production
15
+ tableOfFiles: ''
16
+ name: parsers/siesta
17
+ parser_class_name: electronicparsers.siesta.parser.SiestaParser
18
+ python_package: electronicparsers.siesta
19
+ plugin_source_code_url: https://github.com/nomad-coe/electronic-parsers/tree/develop/electronicparsers/siesta
@@ -0,0 +1,607 @@
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 logging
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 (
28
+ Method,
29
+ DFT,
30
+ XCFunctional,
31
+ Functional,
32
+ BasisSet,
33
+ BasisSetContainer,
34
+ )
35
+ from runschema.system import System, Atoms
36
+ from runschema.calculation import (
37
+ Calculation,
38
+ Energy,
39
+ EnergyEntry,
40
+ ScfIteration,
41
+ Forces,
42
+ ForcesEntry,
43
+ Stress,
44
+ StressEntry,
45
+ Multipoles,
46
+ MultipolesEntry,
47
+ Charges,
48
+ ChargesValue,
49
+ )
50
+ from simulationworkflowschema import GeometryOptimization, SinglePoint
51
+
52
+
53
+ re_n = r'[\n\r]'
54
+ re_f = r'[-+]?\d+\.\d*(?:[DdEe][-+]\d+)?'
55
+
56
+
57
+ class FDFParser(TextParser):
58
+ def init_quantities(self):
59
+ def to_parameter(val_in):
60
+ key, val = val_in.strip().split(' ', 1)
61
+ if val[0].isdecimal() or val[0] == '-':
62
+ val = val.split()[0]
63
+ elif val.lower() in ['true', 'false']:
64
+ val = val == 'true'
65
+ return [key, val]
66
+
67
+ def to_block(val_in):
68
+ key, val = val_in.strip().split(' ', 1)
69
+ return [key, [v.strip().split() for v in val.strip().splitlines()]]
70
+
71
+ self._quantities = [
72
+ Quantity(
73
+ 'parameter',
74
+ rf'([A-Za-z][\w\.]+) +([ \w\.\/]+?)(?:\#|{re_n})',
75
+ repeats=True,
76
+ str_operation=to_parameter,
77
+ ),
78
+ Quantity(
79
+ 'block',
80
+ rf'\%block ([A-Za-z][\w\.]+)\s+([\s\S]+?)\%endblock',
81
+ repeats=True,
82
+ str_operation=to_block,
83
+ ),
84
+ ]
85
+
86
+ def parse(self, key=None):
87
+ super().parse(key)
88
+
89
+ # add atoms info
90
+ species, coordinates, lattice_vectors = None, None, None
91
+ parameters = {key: val for key, val in self._results.get('parameter', [])}
92
+ self._results['parameters'] = parameters
93
+
94
+ # scaling of the lattice vectors
95
+ lattice_constant = parameters.get('LatticeConstant', 1.0) * ureg.angstrom
96
+ # units of the atomic coordinates
97
+ coordinates_format = parameters.get('AtomicCoordinatesFormat')
98
+
99
+ for block in self._results.get('block', []):
100
+ if block[0] == 'ChemicalSpeciesLabel':
101
+ species = [b[2] for b in block[1]]
102
+ elif block[0] == 'LatticeVectors':
103
+ lattice_vectors = block[1] * lattice_constant
104
+ elif block[0] == 'AtomicCoordinatesAndAtomicSpecies':
105
+ coordinates = np.array([b[0:3] for b in block[1]], dtype=np.float64)
106
+
107
+ self._results['positions'] = coordinates
108
+ self._results['labels'] = species
109
+ self._results['lattice_vectors'] = lattice_vectors
110
+ self._results['coordinates_format'] = coordinates_format
111
+
112
+
113
+ class OutParser(TextParser):
114
+ def init_quantities(self):
115
+ def to_stress_tensor(val_in):
116
+ val = val_in.strip().split()
117
+ stress = np.zeros((3, 3))
118
+ stress[0][0] = val[0]
119
+ stress[1][1] = val[1]
120
+ stress[2][2] = val[2]
121
+ stress[0][1] = stress[1][0] = val[3]
122
+ stress[1][2] = stress[2][1] = val[4]
123
+ stress[0][2] = stress[2][0] = val[5]
124
+ return stress * ureg.kbar
125
+
126
+ calc_quantities = [
127
+ Quantity(
128
+ 'lattice_vectors',
129
+ r'outcell\: Unit cell vectors \(Ang\)\:\s+([\s\d\.\-]+)',
130
+ shape=(3, 3),
131
+ dtype=np.dtype(np.float64),
132
+ unit=ureg.angstrom,
133
+ ),
134
+ Quantity(
135
+ 'atoms',
136
+ r'outcoor: Atomic coordinates(.+[\s\w\.\-]+)',
137
+ sub_parser=TextParser(
138
+ quantities=[
139
+ Quantity('coordinates_format', r'\((\S+)\)', dtype=str),
140
+ Quantity('labels', r' +([A-Z][a-z]*)', repeats=True, dtype=str),
141
+ Quantity(
142
+ 'positions',
143
+ rf'({re_f} +{re_f} +{re_f})',
144
+ repeats=True,
145
+ dtype=np.dtype(np.float64),
146
+ ),
147
+ ]
148
+ ),
149
+ ),
150
+ Quantity(
151
+ 'energy',
152
+ rf'Program\'s energy decomposition \(eV\)\:([\s\S]+?){re_n} *{re_n}',
153
+ sub_parser=TextParser(
154
+ quantities=[
155
+ Quantity(
156
+ 'contribution',
157
+ rf'siesta\: +(\S+) *= *({re_f})',
158
+ repeats=True,
159
+ )
160
+ ]
161
+ ),
162
+ ),
163
+ Quantity(
164
+ 'scf',
165
+ rf'scf\: iscf +Eharris\(eV\).+([\s\S]+?){re_n} *{re_n}',
166
+ sub_parser=TextParser(
167
+ quantities=[
168
+ Quantity(
169
+ 'step',
170
+ rf'scf\: +\d+ +({re_f} +{re_f} +{re_f} +{re_f} +{re_f})',
171
+ repeats=True,
172
+ dtype=np.dtype(np.float64),
173
+ )
174
+ ]
175
+ ),
176
+ ),
177
+ Quantity(
178
+ 'energy_total',
179
+ rf'siesta\: E_KS\(eV\) = +({re_f})',
180
+ dtype=np.float64,
181
+ unit=ureg.eV,
182
+ ),
183
+ Quantity(
184
+ 'energy',
185
+ rf'Final energy \(eV\)\:([\s\S]+?Total.+)',
186
+ sub_parser=TextParser(
187
+ quantities=[
188
+ Quantity(
189
+ 'contribution',
190
+ rf'siesta: +([ \w\.\-]+?) *= *({re_f})',
191
+ repeats=True,
192
+ str_operation=lambda x: [
193
+ v.strip() for v in x.rsplit(' ', 1)
194
+ ],
195
+ )
196
+ ]
197
+ ),
198
+ ),
199
+ Quantity(
200
+ 'forces',
201
+ r'siesta\: Atomic forces \(eV/Ang\)\:([\s\S]+?Tot.+)',
202
+ sub_parser=TextParser(
203
+ quantities=[
204
+ Quantity(
205
+ 'atomic',
206
+ rf'\d+ +({re_f} +{re_f} +{re_f})',
207
+ repeats=True,
208
+ dtype=np.dtype(np.float64),
209
+ )
210
+ ]
211
+ ),
212
+ ),
213
+ Quantity(
214
+ 'stress_tensor',
215
+ rf'Stress\-tensor\-Voigt \(kbar\)\: +({re_f} +{re_f} +{re_f} +{re_f} +{re_f} +{re_f})',
216
+ str_operation=to_stress_tensor,
217
+ ),
218
+ Quantity(
219
+ 'stress_tensor',
220
+ rf'Stress tensor \(static\) \(eV/Ang\*\*3\)\:([\s\S]+?){re_n} *{re_n}',
221
+ str_operation=lambda x: [
222
+ v.strip().split()[1:4] for v in x.strip().splitlines()
223
+ ],
224
+ dtype=np.dtype(np.float64),
225
+ unit=ureg.eV / ureg.angstrom**3,
226
+ ),
227
+ Quantity(
228
+ 'electric_dipole',
229
+ rf'Electric dipole \(Debye\) += +({re_f} +{re_f} +{re_f})',
230
+ dtype=np.dtype(np.float64),
231
+ ),
232
+ Quantity(
233
+ 'mulliken',
234
+ r'mulliken\: Atomic and Orbital Populations\:([\s\S]+?)siesta\:',
235
+ sub_parser=TextParser(
236
+ quantities=[
237
+ Quantity(
238
+ 'atom',
239
+ rf'(Species\:[\s\S]+?){re_n} *{re_n}',
240
+ repeats=True,
241
+ sub_parser=TextParser(
242
+ quantities=[
243
+ Quantity('label', r'Species\: *(\S+)', dtype=str),
244
+ Quantity(
245
+ 'orbital',
246
+ r'(\d[spdSPD]\S*) ',
247
+ dtype=str,
248
+ repeats=True,
249
+ ),
250
+ Quantity(
251
+ 'values',
252
+ rf'(\d+ +{re_f} +{re_f}[\d\.\-\s]+)',
253
+ dtype=np.dtype(np.float64),
254
+ ),
255
+ ]
256
+ ),
257
+ ),
258
+ Quantity('spin', r'(Spin DOWN)', str_operation=lambda x: 2),
259
+ Quantity(
260
+ 'q_tot',
261
+ rf'Qtot = +({re_f})',
262
+ repeats=True,
263
+ dtype=np.float64,
264
+ ),
265
+ ]
266
+ ),
267
+ ),
268
+ ]
269
+
270
+ self._quantities = [
271
+ Quantity(
272
+ 'header',
273
+ r'(S[\s\S]+?)\*',
274
+ sub_parser=TextParser(
275
+ quantities=[
276
+ Quantity(
277
+ 'program_version',
278
+ r'(?:SIESTA|Siesta Version:) *(.+)',
279
+ flatten=False,
280
+ dtype=str,
281
+ ),
282
+ Quantity(
283
+ 'x_siesta_arch',
284
+ r'Architecture *: +(.+)',
285
+ flatten=False,
286
+ dtype=str,
287
+ ),
288
+ Quantity(
289
+ 'x_siesta_compiler_flags',
290
+ r'Compiler flags *: +(.+)',
291
+ flatten=False,
292
+ dtype=str,
293
+ ),
294
+ Quantity(
295
+ 'x_siesta_parallel',
296
+ r'(PARALLEL) version',
297
+ str_operation=lambda x: True,
298
+ ),
299
+ ]
300
+ ),
301
+ ),
302
+ Quantity(
303
+ 'input_data_file',
304
+ r'(Dump of input data file.+[\s\S]+?End of input data file)',
305
+ flatten=False,
306
+ dtype=str,
307
+ ),
308
+ Quantity(
309
+ 'simulation_parameters',
310
+ r'Simulation parameters.+([\s\S]+?)\*{10}',
311
+ sub_parser=TextParser(
312
+ quantities=[
313
+ Quantity(
314
+ 'redata',
315
+ r'redata\: (.+?= +\S+)',
316
+ str_operation=lambda x: [v.strip() for v in x.rsplit('=')],
317
+ repeats=True,
318
+ )
319
+ ]
320
+ ),
321
+ ),
322
+ Quantity('x_siesta_n_nodes', r'Running on +(\d+) nodes', dtype=np.int32),
323
+ Quantity(
324
+ 'run_start',
325
+ r'Start of run: +(\d+-[A-Z]+-\d+) +(\d+:\d+:\d+)',
326
+ flatten=False,
327
+ dtype=str,
328
+ ),
329
+ Quantity(
330
+ 'run_end',
331
+ r'End of run: +(\d+-[A-Z]+-\d+) +(\d+:\d+:\d+)',
332
+ flatten=False,
333
+ dtype=str,
334
+ ),
335
+ Quantity(
336
+ 'single_point',
337
+ r'(Single\-point calculation[\s\S]+?Target enthalpy.+)',
338
+ sub_parser=TextParser(quantities=calc_quantities),
339
+ ),
340
+ Quantity(
341
+ 'geometry_optimization',
342
+ r'\={5}\s+(Begin[\s\S]+?)outcoor\: Re',
343
+ sub_parser=TextParser(
344
+ quantities=[
345
+ Quantity(
346
+ 'step',
347
+ r'(Begin.+?opt\. move += +\d+[\s\S]+?Target enthalpy.+)',
348
+ repeats=True,
349
+ sub_parser=TextParser(quantities=calc_quantities),
350
+ )
351
+ ]
352
+ ),
353
+ ),
354
+ ] + calc_quantities
355
+
356
+
357
+ class SiestaParser:
358
+ def __init__(self):
359
+ self.out_parser = OutParser()
360
+ self.fdf_parser = FDFParser()
361
+ self._xc_map = {
362
+ 'ca': ('LDA_X', 'LDA_C_PZ'),
363
+ 'pz': ('LDA_X', 'LDA_C_PZ'),
364
+ 'pw92': ('LDA_X', 'LDA_C_PW'),
365
+ # TODO 'PW91': '',
366
+ 'pbe': ('GGA_X_PBE', 'GGA_C_PBE'),
367
+ 'revpbe': ('GGA_X_PBE_R', 'GGA_C_PBE'),
368
+ 'rpbe': ('GGA_X_RPBE', 'GGA_C_PBE'),
369
+ # TODO 'WC': ('GGA_X_WC', ),
370
+ 'am05': ('GGA_X_AM05', 'GGA_C_AM05'),
371
+ 'pbesol': ('GGA_X_PBE_SOL', 'GGA_C_PBE_SOL'),
372
+ 'blyp': ('GGA_X_B88', 'GGA_C_LYP'),
373
+ 'df1': ('gga_x_pbe_r', 'vdw_c_df1'),
374
+ 'drsll': ('gga_x_pbe_r', 'vdw_c_df1'),
375
+ 'lmkll': ('gga_x_rpw86', 'vdw_c_df2'),
376
+ 'df2': ('gga_x_rpw86', 'vdw_c_df2'),
377
+ 'kbm': ('GGA_X_OPTB88_VDW', 'vdw_c_df1'),
378
+ 'c09': ('GGA_X_C09X', 'vdw_c_df1'),
379
+ 'bh': ('GGA_X_LV_RPW86', 'vdw_c_df1'),
380
+ }
381
+ self._metainfo_map = {
382
+ 'Etot': 'total',
383
+ 'FreeEng': 'free',
384
+ 'Exc': 'xc',
385
+ 'Band Struct.': 'sum_eigenvalues',
386
+ 'Hartree': 'electrostatic',
387
+ 'Exch.-corr.': 'xc',
388
+ 'Ion-ion': 'nuclear_repulsion',
389
+ 'Total': 'total',
390
+ }
391
+
392
+ def init_parser(self):
393
+ self.out_parser.mainfile = self.filepath
394
+ self.out_parser.logger = self.logger
395
+ self.fdf_parser.logger = self.logger
396
+ self._files = os.listdir(self.maindir)
397
+
398
+ def parse(self, filepath, archive, logger):
399
+ self.filepath = os.path.abspath(filepath)
400
+ self.archive = archive
401
+ self.logger = logging.getLogger(__name__) if logger is None else logger
402
+ self.maindir = os.path.dirname(self.filepath)
403
+ self.init_parser()
404
+
405
+ sec_run = Run()
406
+ archive.run.append(sec_run)
407
+ header = self.out_parser.get('header')
408
+ if header is not None:
409
+ sec_run.program = Program(name='Siesta', version=header.program_version)
410
+ for key, val in header.items():
411
+ if key.startswith('x_siesta'):
412
+ setattr(sec_run, key, val)
413
+
414
+ for key, val in self.out_parser.items():
415
+ if key.startswith('x_siesta'):
416
+ setattr(sec_run, key, val)
417
+
418
+ def get_date(time):
419
+ if time is None:
420
+ return
421
+ return datetime.strptime(time, '%d-%b-%Y %H:%M:%S').timestamp()
422
+
423
+ sec_run.time_run = TimeRun(
424
+ date_start=get_date(self.out_parser.run_start),
425
+ date_end=get_date(self.out_parser.run_end),
426
+ )
427
+
428
+ # input parameters from data file
429
+ self.fdf_parser.mainfile = self.out_parser.mainfile
430
+ if self.out_parser.input_data_file is not None:
431
+ self.fdf_parser._file_handler = self.out_parser.input_data_file.encode()
432
+
433
+ sec_method = Method()
434
+ sec_run.method.append(sec_method)
435
+ parameters = self.fdf_parser.get('parameters')
436
+ sec_method.x_siesta_input_parameters = parameters
437
+ sec_method.x_siesta_simulation_parameters = {
438
+ key: val
439
+ for key, val in self.out_parser.get('simulation_parameters', {}).get(
440
+ 'redata', []
441
+ )
442
+ }
443
+ sec_method.dft = DFT(xc_functional=XCFunctional())
444
+ for xc_functional in self._xc_map.get(parameters.get('xc.authors').lower(), []):
445
+ if '_X_' in xc_functional:
446
+ sec_method.dft.xc_functional.exchange.append(
447
+ Functional(name=xc_functional)
448
+ )
449
+ elif '_C_' in xc_functional:
450
+ sec_method.dft.xc_functional.correlation.append(
451
+ Functional(name=xc_functional)
452
+ )
453
+ elif '_HYB_' in xc_functional:
454
+ sec_method.dft.xc_functional.hybrid.append(
455
+ Functional(name=xc_functional)
456
+ )
457
+ else:
458
+ sec_method.dft.xc_functional.contributions.append(
459
+ Functional(name=xc_functional)
460
+ )
461
+ sec_method.electrons_representation = [
462
+ BasisSetContainer(
463
+ type='atom-centered orbitals',
464
+ scope=['wavefunction'],
465
+ basis_set=[
466
+ BasisSet(
467
+ type='numeric AOs',
468
+ scope=['full-election'],
469
+ )
470
+ ],
471
+ )
472
+ ]
473
+ # parse atomic basis info
474
+
475
+ def parse_system(source):
476
+ sec_system = System()
477
+ sec_run.system.append(sec_system)
478
+ lattice_vectors = source.get('lattice_vectors')
479
+ atoms = source.get('atoms')
480
+ source = atoms if atoms is not None else source
481
+ positions = source.get('positions')
482
+ if positions is not None:
483
+ coordinates_format = source.get('coordinates_format', 'Ang').lower()
484
+ if coordinates_format == 'ang':
485
+ positions = positions * ureg.angstrom
486
+ elif coordinates_format in ['fractional', 'scaledcartesian']:
487
+ if lattice_vectors is not None:
488
+ positions = np.dot(positions, lattice_vectors)
489
+
490
+ sec_system.atoms = Atoms(
491
+ positions=positions,
492
+ labels=source.get('labels'),
493
+ lattice_vectors=lattice_vectors,
494
+ )
495
+
496
+ return sec_system
497
+
498
+ def parse_calculation(source):
499
+ sec_calc = Calculation()
500
+ sec_run.calculation.append(sec_calc)
501
+ # energy
502
+ sec_energy = Energy()
503
+ sec_calc.energy = sec_energy
504
+ for key, val in source.get('energy', {}).get('contribution', []):
505
+ if key in self._metainfo_map:
506
+ setattr(
507
+ sec_energy,
508
+ self._metainfo_map[key],
509
+ EnergyEntry(value=val * ureg.eV),
510
+ )
511
+ else:
512
+ sec_energy.contributions.append(
513
+ EnergyEntry(kind=key, value=val * ureg.eV)
514
+ )
515
+ if source.energy_total is not None:
516
+ sec_energy.total = EnergyEntry(value=source.energy_total)
517
+
518
+ # forces
519
+ if source.forces is not None and source.forces.atomic is not None:
520
+ sec_calc.forces = Forces(
521
+ total=ForcesEntry(
522
+ value=source.forces.atomic * ureg.eV / ureg.angstrom
523
+ )
524
+ )
525
+
526
+ # stress tensor
527
+ if source.stress_tensor is not None:
528
+ sec_calc.stress = Stress(total=StressEntry(value=source.stress_tensor))
529
+
530
+ # dipoles
531
+ if source.electric_dipole is not None:
532
+ sec_multipoles = Multipoles()
533
+ sec_calc.multipoles.append(sec_multipoles)
534
+ sec_multipoles.kind = 'electric'
535
+ sec_multipoles.dipole = MultipolesEntry(total=source.electric_dipole)
536
+
537
+ # multipoles
538
+ if source.mulliken is not None:
539
+ sec_charges = Charges()
540
+ sec_calc.charges.append(sec_charges)
541
+ atoms = source.mulliken.get('atom', [])
542
+ spin = source.mulliken.get('spin', 1)
543
+ n_atoms = len(atoms) // spin
544
+ value = np.zeros(n_atoms)
545
+ for atom_n, atom in enumerate(atoms):
546
+ spin_n = atom_n // n_atoms
547
+ for orb_n, orb in enumerate(atom.get('orbital', [])):
548
+ # TODO map orb to lm value
549
+ sec_charges.orbital_projected.append(
550
+ ChargesValue(
551
+ spin=spin_n,
552
+ atom_label=atom.label,
553
+ orbital=orb,
554
+ value=atom.values[orb_n + 2]
555
+ * ureg.elementary_charge, # 0: index 1: sum
556
+ )
557
+ )
558
+ if spin == 2:
559
+ # spin peojected
560
+ sec_charges.spin_projected.append(
561
+ ChargesValue(
562
+ spin=spin_n,
563
+ atom_label=atom.label,
564
+ value=atom.values[1] * ureg.elementary_charge,
565
+ )
566
+ )
567
+ value[atom_n % n_atoms] += atom.values[1]
568
+
569
+ sec_charges.analysis_method = 'Mulliken'
570
+ sec_charges.value = value * ureg.elementary_charge
571
+ sec_charges.total = (
572
+ sum(source.mulliken.get('qtot', [])) * ureg.elementary_charge
573
+ )
574
+
575
+ # TODO parse more properties
576
+ # scf steps
577
+ for step in source.get('scf', {}).get('step', []):
578
+ sec_scf = ScfIteration()
579
+ sec_calc.scf_iteration.append(sec_scf)
580
+ sec_scf.energy = Energy(
581
+ total=EnergyEntry(value=step[1] * ureg.eV),
582
+ fermi=step[4] * ureg.eV,
583
+ free=EnergyEntry(value=step[2] * ureg.eV),
584
+ )
585
+ sec_scf.energy.types.append(
586
+ EnergyEntry(kind='Harris', value=step[0] * ureg.eV)
587
+ )
588
+
589
+ return sec_calc
590
+
591
+ def parse_configurations(source):
592
+ system = parse_system(source)
593
+ calc = parse_calculation(source)
594
+ calc.system_ref = system
595
+
596
+ if self.out_parser.single_point is not None:
597
+ parse_configurations(self.out_parser.single_point)
598
+ archive.workflow2 = SinglePoint()
599
+
600
+ if self.out_parser.geometry_optimization is not None:
601
+ for step in self.out_parser.geometry_optimization.get('step', []):
602
+ parse_configurations(step)
603
+ archive.workflow2 = GeometryOptimization()
604
+
605
+ # final properties
606
+ calc = parse_calculation(self.out_parser)
607
+ calc.system_ref = sec_run.system[-1]
@@ -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 SolidDMFTParser
@@ -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.soliddmft import SolidDMFTParser
26
+
27
+ if __name__ == '__main__':
28
+ configure_logging(console_log_level=logging.DEBUG)
29
+ archive = EntryArchive()
30
+ SolidDMFTParser().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 soliddmft