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,941 @@
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 numpy as np
21
+ import logging
22
+ from ase.data import chemical_symbols
23
+
24
+ from nomad.units import ureg
25
+ from nomad.parsing.file_parser import TextParser, Quantity
26
+
27
+ from runschema.run import Run, Program
28
+ from runschema.method import (
29
+ Method,
30
+ AtomParameters,
31
+ DFT,
32
+ XCFunctional,
33
+ Functional,
34
+ Electronic,
35
+ BasisSet,
36
+ BasisSetAtomCentered,
37
+ BasisSetContainer,
38
+ )
39
+ from runschema.system import System, Atoms
40
+ from runschema.calculation import (
41
+ Calculation,
42
+ ScfIteration,
43
+ Energy,
44
+ EnergyEntry,
45
+ Forces,
46
+ ForcesEntry,
47
+ BandEnergies,
48
+ Charges,
49
+ ChargesValue,
50
+ Multipoles,
51
+ MultipolesEntry,
52
+ )
53
+
54
+
55
+ re_n = r'[\n\r]'
56
+ re_f = r'[-+]?\d+\.\d*(?:[Ee][-+]\d+)?'
57
+
58
+
59
+ class OutParser(TextParser):
60
+ def __init__(self):
61
+ super().__init__()
62
+
63
+ def init_quantities(self):
64
+ key_val_quantity = Quantity('key_val', r'([A-Z]+) *= *(\S+)', repeats=True)
65
+
66
+ def to_gradient(val_in):
67
+ gradient = []
68
+ for val in val_in.strip().splitlines():
69
+ val = val.strip()
70
+ if val and val[0].isdecimal():
71
+ gradient.append(val.split()[-3:])
72
+ return np.array(gradient, dtype=np.float64) * ureg.hartree / ureg.bohr
73
+
74
+ def to_charges(val_in):
75
+ charges = []
76
+ for val in val_in.strip().splitlines():
77
+ val = val.strip()
78
+ if val and val[0].isdecimal():
79
+ charges.append(val.split()[2:])
80
+ return np.transpose(charges)
81
+
82
+ calc_quantities = [
83
+ Quantity(
84
+ 'scf',
85
+ r'(SCF CALCULATION[\s\S]+?)END OF .+? CALCULATION',
86
+ sub_parser=TextParser(
87
+ quantities=[
88
+ Quantity(
89
+ 'iteration',
90
+ rf'ITER.+?TOTAL ENERGY.+([\s\S]+?){re_n} *{re_n}',
91
+ sub_parser=TextParser(
92
+ quantities=[
93
+ Quantity(
94
+ 'iter',
95
+ rf'({re_f} +{re_f}).+',
96
+ dtype=np.dtype(np.float64),
97
+ repeats=True,
98
+ )
99
+ ]
100
+ ),
101
+ ),
102
+ Quantity(
103
+ 'energy_total',
104
+ rf'FINAL .+? ENERGY IS +({re_f})',
105
+ unit=ureg.hartree,
106
+ ),
107
+ Quantity(
108
+ 'converged',
109
+ r'(DENSITY CONVERGED)',
110
+ str_operation=lambda x: True,
111
+ ),
112
+ Quantity(
113
+ 'eigenvectors',
114
+ r'EIGENVECTORS\s+\-+([\s\S]+?)(?:\.{6}|\-{10})',
115
+ sub_parser=TextParser(
116
+ quantities=[
117
+ Quantity(
118
+ 'eigenvalues',
119
+ rf'{re_n} +({re_f}.+)',
120
+ str_operation=lambda x: x.split(),
121
+ repeats=True,
122
+ )
123
+ ]
124
+ ),
125
+ ),
126
+ ]
127
+ ),
128
+ ),
129
+ Quantity(
130
+ 'time_physical',
131
+ rf'TOTAL WALL CLOCK TIME= *({re_f}) SECONDS',
132
+ repeats=True,
133
+ ),
134
+ Quantity(
135
+ 'coordinates',
136
+ rf'((?:COORDINATES OF ALL ATOMS ARE \(ANGS\)\s+ATOM +|ATOM +ATOMIC +COORDINATES \(BOHR\)\s+)'
137
+ rf'CHARGE +X +Y +Z\s+\-*[\s\S]+?)INTERNUCLEAR',
138
+ sub_parser=TextParser(
139
+ quantities=[
140
+ Quantity('unit', r'\((\S+)\)'),
141
+ Quantity(
142
+ 'label_charge',
143
+ rf'([A-Z]+[a-z]*\d*) +({re_f})',
144
+ repeats=True,
145
+ ),
146
+ Quantity(
147
+ 'position',
148
+ rf'({re_f} +{re_f} +{re_f}) *{re_n}',
149
+ dtype=np.dtype(np.float64),
150
+ repeats=True,
151
+ ),
152
+ ]
153
+ ),
154
+ ),
155
+ Quantity(
156
+ 'gradient',
157
+ r'ATOM +ZNUC + DE/DX +DE/DY +DE/DZ\s+\-+([\s\S]+?)MAXIMUM',
158
+ str_operation=to_gradient,
159
+ ),
160
+ Quantity(
161
+ 'properties',
162
+ r'(?:properties for the|PROPERTY VALUES FOR THE|PROPERTIES FOR THE)([\s\S]+?)END OF PROPERTY EVALUATION',
163
+ sub_parser=TextParser(
164
+ quantities=[
165
+ Quantity(
166
+ 'energy_components',
167
+ r'ENERGY COMPONENTS\s+\-+([\s\S]+?VIRIAL RATIO.+)',
168
+ str_operation=lambda x: [
169
+ v.strip().split('=')
170
+ for v in x.strip().splitlines()
171
+ if '=' in v
172
+ ],
173
+ ),
174
+ Quantity(
175
+ 'population_analysis',
176
+ r'MULLIKEN AND LOWDIN POPULATION ANALYSES\s+\-+([\s\S]+?(?:\-{30}|\Z))',
177
+ sub_parser=TextParser(
178
+ quantities=[
179
+ Quantity(
180
+ 'atomic',
181
+ rf'TOTAL MULLIKEN AND LOWDIN ATOMIC POPULATIONS\s+'
182
+ rf'ATOM +MULL.POP\. +CHARGE +LOW\.POP\. +CHARGE\s+([\s\S]+?)(?:{re_n} +[A-Z]|\Z)',
183
+ str_operation=to_charges,
184
+ ),
185
+ Quantity(
186
+ 'spherical_harmonics',
187
+ rf'SPHERICAL HARMONIC POPULATIONS\s+ATOM.+\s+([\s\S]+?)(?:{re_n} +[A-Z]|\Z)',
188
+ str_operation=to_charges,
189
+ repeats=True,
190
+ ),
191
+ Quantity(
192
+ 'atomic_orbitals',
193
+ r'POPULATIONS IN EACH AO +\-+\s+MULLIKEN +LOWDIN\s+([\s\S]+?)\-\-\-\-\-',
194
+ str_operation=to_charges,
195
+ ),
196
+ Quantity(
197
+ 'spins',
198
+ r'ATOMIC SPIN POPULATION \(ALPHA MINUS BETA\)\s+ATOM.+\s+([\s\S]+?)\-\-\-\-\-',
199
+ str_operation=to_charges,
200
+ ),
201
+ ]
202
+ ),
203
+ ),
204
+ Quantity(
205
+ 'electrostatic_moments',
206
+ r'ELECTROSTATIC MOMENTS\s+\-+([\s\S]+?)\.\.\.\.\.\.',
207
+ sub_parser=TextParser(
208
+ quantities=[
209
+ Quantity(
210
+ 'dipole',
211
+ r'(POINT +\d+[\s\S]+?DEBYE.+\s+.+)',
212
+ repeats=True,
213
+ sub_parser=TextParser(
214
+ quantities=[
215
+ Quantity(
216
+ 'origin',
217
+ rf'CHARGE\s+({re_f} +{re_f} +{re_f})',
218
+ dtype=np.dtype(np.float64),
219
+ ),
220
+ Quantity(
221
+ 'value',
222
+ rf'DEBYE\)\s+({re_f} +{re_f} +{re_f})',
223
+ dtype=np.dtype(np.float64),
224
+ ),
225
+ ]
226
+ ),
227
+ )
228
+ ]
229
+ ),
230
+ ),
231
+ ]
232
+ ),
233
+ ),
234
+ ]
235
+
236
+ self._quantities = [
237
+ Quantity(
238
+ 'program_version',
239
+ r'GAMESS VERSION *\= *(.+?) *\*|(Firefly version [\d\.]+)',
240
+ str_operation=lambda x: x.strip(),
241
+ ),
242
+ Quantity(
243
+ 'x_gamess_program_implementation',
244
+ r'\*{16} (\d+[A-Z ]+) +\*{16}',
245
+ str_operation=lambda x: x.strip(),
246
+ ),
247
+ Quantity(
248
+ 'x_gamess_program_execution_date',
249
+ r'EXECUTION OF GAMESS BEGUN ([\w\: ]+)',
250
+ str_operation=lambda x: x.strip(),
251
+ ),
252
+ Quantity(
253
+ 'x_gamess_memory', r'(\d+) WORDS OF MEMORY AVAILABLE', dtype=np.int32
254
+ ),
255
+ Quantity(
256
+ 'basis_options',
257
+ rf'BASIS OPTIONS\s+\-+([\s\S]+?){re_n} *{re_n} *{re_n}',
258
+ sub_parser=TextParser(quantities=[key_val_quantity]),
259
+ ),
260
+ Quantity(
261
+ 'control_options',
262
+ rf'CONTRL OPTIONS\s+\-+([\s\S]+?)\$',
263
+ sub_parser=TextParser(quantities=[key_val_quantity]),
264
+ ),
265
+ Quantity(
266
+ 'system_options',
267
+ rf'SYSTEM OPTIONS\s+\-+([\s\S]+?)\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-',
268
+ sub_parser=TextParser(quantities=[key_val_quantity]),
269
+ ),
270
+ Quantity(
271
+ 'parameters',
272
+ rf'(NUMBER OF BASIS SET SHELLS += +\d+[\s\S]+?){re_n} *{re_n}',
273
+ str_operation=lambda x: [
274
+ v.strip().split('=') for v in x.strip().splitlines()
275
+ ],
276
+ ),
277
+ Quantity(
278
+ 'geometry_opt',
279
+ r'GEOMETRY SEARCH POINT([\s\S]+?)(?:BEGINNING|END OF GEOMETRY SEARCH|\Z)',
280
+ repeats=True,
281
+ sub_parser=TextParser(quantities=calc_quantities),
282
+ ),
283
+ ] + calc_quantities
284
+
285
+
286
+ class GamessParser:
287
+ def __init__(self):
288
+ self._nspin = None
289
+ self._units = {'ANGS': ureg.angstrom, 'BOHR': ureg.bohr}
290
+ self._xc_map = {
291
+ 'SLATER': [{'name': 'LDA_X'}],
292
+ 'VWN': [{'name': 'LDA_C_VWN_5'}],
293
+ 'VWN3': [{'name': 'LDA_C_VWN_3'}],
294
+ 'VWN1RPA': [{'name': 'LDA_C_VWN1RPA'}],
295
+ 'BECKE': [{'name': 'GGA_X_B88'}],
296
+ 'OPTX': [{'name': 'GGA_X_OPTX'}],
297
+ 'GILL': [{'name': 'GGA_X_G96'}],
298
+ 'PW91X': [{'name': 'GGA_X_PW91'}],
299
+ 'PBEX': [{'name': 'GGA_X_PBE'}],
300
+ 'PZ81': [{'name': 'GGA_C_PZ'}],
301
+ 'P86': [{'name': 'GGA_C_P86'}],
302
+ 'LYP': [{'name': 'GGA_C_LYP'}],
303
+ 'PW91C': [{'name': 'GGA_C_PW91'}],
304
+ 'PBEC': [{'name': 'GGA_C_PBE'}],
305
+ 'OP': [{'name': 'GGA_C_OP'}],
306
+ 'SVWN': [{'name': 'LDA_C_VWN_5'}, {'name': 'LDA_X'}],
307
+ 'SVWN1RPA': [{'name': 'LDA_C_VWN1RPA'}, {'name': 'LDA_X'}],
308
+ 'SVWN3': [{'name': 'LDA_C_VWN_3'}, {'name': 'LDA_X'}],
309
+ 'SPZ81': [{'name': 'GGA_C_PZ'}, {'name': 'LDA_X'}],
310
+ 'SP86': [{'name': 'GGA_C_P86'}, {'name': 'LDA_X'}],
311
+ 'SLYP': [{'name': 'GGA_C_LYP'}, {'name': 'LDA_X'}],
312
+ 'SPW91': [{'name': 'GGA_C_PW91'}, {'name': 'LDA_X'}],
313
+ 'SPBE': [{'name': 'GGA_C_PBE'}, {'name': 'LDA_X'}],
314
+ 'SOP': [{'name': 'GGA_C_OP'}, {'name': 'LDA_X'}],
315
+ 'BVWN': [{'name': 'LDA_C_VWN_5'}, {'name': 'LDA_X_B88'}],
316
+ 'BVWN1RPA': [{'name': 'LDA_C_VWN1RPA'}, {'name': 'LDA_X_B88'}],
317
+ 'BVWN3': [{'name': 'LDA_C_VWN_3'}, {'name': 'LDA_X_B88'}],
318
+ 'BPZ81': [{'name': 'GGA_C_PZ'}, {'name': 'LDA_X_B88'}],
319
+ 'BP86': [{'name': 'GGA_C_P86'}, {'name': 'LDA_X_B88'}],
320
+ 'BLYP': [{'name': 'GGA_C_LYP'}, {'name': 'LDA_X_B88'}],
321
+ 'BPW91': [{'name': 'GGA_C_PW91'}, {'name': 'LDA_X_B88'}],
322
+ 'BPBE': [{'name': 'GGA_C_PBE'}, {'name': 'LDA_X_B88'}],
323
+ 'BOP': [{'name': 'GGA_C_OP'}, {'name': 'LDA_X_B88'}],
324
+ 'GVWN': [{'name': 'LDA_C_VWN_5'}, {'name': 'GGA_X_G96'}],
325
+ 'GVWN1RPA': [{'name': 'LDA_C_VWN1RPA'}, {'name': 'GGA_X_G96'}],
326
+ 'GVWN3': [{'name': 'LDA_C_VWN_3'}, {'name': 'GGA_X_G96'}],
327
+ 'GPZ81': [{'name': 'GGA_C_PZ'}, {'name': 'GGA_X_G96'}],
328
+ 'GP86': [{'name': 'GGA_C_P86'}, {'name': 'GGA_X_G96'}],
329
+ 'GLYP': [{'name': 'GGA_C_LYP'}, {'name': 'GGA_X_G96'}],
330
+ 'GPW91': [{'name': 'GGA_C_PW91'}, {'name': 'GGA_X_G96'}],
331
+ 'GPBE': [{'name': 'GGA_C_PBE'}, {'name': 'GGA_X_G96'}],
332
+ 'GOP': [{'name': 'GGA_C_OP'}, {'name': 'GGA_X_G96'}],
333
+ 'OVWN': [{'name': 'LDA_C_VWN_5'}, {'name': 'GGA_X_OPTX'}],
334
+ 'OVWN1RPA': [{'name': 'LDA_C_VWN1RPA'}, {'name': 'GGA_X_OPTX'}],
335
+ 'OVWN3': [{'name': 'LDA_C_VWN_3'}, {'name': 'GGA_X_OPTX'}],
336
+ 'OPZ81': [{'name': 'GGA_C_PZ'}, {'name': 'GGA_X_OPTX'}],
337
+ 'OP86': [{'name': 'GGA_C_P86'}, {'name': 'GGA_X_OPTX'}],
338
+ 'OLYP': [{'name': 'GGA_C_LYP'}, {'name': 'GGA_X_OPTX'}],
339
+ 'OPW91': [{'name': 'GGA_C_PW91'}, {'name': 'GGA_X_OPTX'}],
340
+ 'OPBE': [{'name': 'GGA_C_PBE'}, {'name': 'GGA_X_OPTX'}],
341
+ 'OOP': [{'name': 'GGA_C_OP'}, {'name': 'GGA_X_OPTX'}],
342
+ 'PW91VWN': [{'name': 'LDA_C_VWN_5'}, {'name': 'GGA_X_PW91'}],
343
+ 'PW91VWN1RPA': [{'name': 'LDA_C_VWN1RPA'}, {'name': 'GGA_X_PW91'}],
344
+ 'PW91VWN3': [{'name': 'LDA_C_VWN_3'}, {'name': 'GGA_X_PW91'}],
345
+ 'PW91PZ81': [{'name': 'GGA_C_PZ'}, {'name': 'GGA_X_PW91'}],
346
+ 'PW91P86': [{'name': 'GGA_C_P86'}, {'name': 'GGA_X_PW91'}],
347
+ 'PW91LYP': [{'name': 'GGA_C_LYP'}, {'name': 'GGA_X_PW91'}],
348
+ 'PW91': [{'name': 'GGA_C_PW91'}, {'name': 'GGA_X_PW91'}],
349
+ 'PW91PBE': [{'name': 'GGA_C_PBE'}, {'name': 'GGA_X_PW91'}],
350
+ 'PW91OP': [{'name': 'GGA_C_OP'}, {'name': 'GGA_X_PW91'}],
351
+ 'PBEVWN': [{'name': 'LDA_C_VWN_5'}, {'name': 'GGA_X_PBE'}],
352
+ 'PBEVWN1RPA': [{'name': 'LDA_C_VWN1RPA'}, {'name': 'GGA_X_PBE'}],
353
+ 'PBEVWN3': [{'name': 'LDA_C_VWN_3'}, {'name': 'GGA_X_PBE'}],
354
+ 'PBEPZ81': [{'name': 'GGA_C_PZ'}, {'name': 'GGA_X_PBE'}],
355
+ 'PBEP86': [{'name': 'GGA_C_P86'}, {'name': 'GGA_X_PBE'}],
356
+ 'PBELYP': [{'name': 'GGA_C_LYP'}, {'name': 'GGA_X_PBE'}],
357
+ 'PBEPW91': [{'name': 'GGA_C_PW91'}, {'name': 'GGA_X_PBE'}],
358
+ 'PBE': [{'name': 'GGA_C_PBE'}, {'name': 'GGA_X_PBE'}],
359
+ 'PBEOP': [{'name': 'GGA_C_OP'}, {'name': 'GGA_X_PBE'}],
360
+ 'EDF1': [{'name': 'GGA_XC_EDF1'}],
361
+ 'REVPBE': [{'name': 'GGA_XC_REVPBE'}],
362
+ 'RPBE': [{'name': 'GGA_XC_RPBE'}],
363
+ 'PBESOL': [{'name': 'GGA_XC_PBESOL'}],
364
+ 'HCTH93': [{'name': 'GGA_XC_HCTH_93'}],
365
+ 'HCTH147': [{'name': 'GGA_XC_HCTH_147'}],
366
+ 'HCTH407': [{'name': 'GGA_XC_HCTH_407'}],
367
+ 'SOGGA': [{'name': 'GGA_XC_SOGGA'}],
368
+ 'SOGGA11': [{'name': 'GGA_XC_SOGGA11'}],
369
+ 'MOHLYP': [{'name': 'GGA_XC_MOHLYP'}],
370
+ 'B97-D': [{'name': 'GGA_XC_B97D'}],
371
+ 'BHHLYP': [{'name': 'HYB_GGA_XC_BHANDHLYP'}],
372
+ 'B3PW91': [{'name': 'HYB_GGA_XC_B3PW91'}],
373
+ 'B3LYP': [{'name': 'HYB_GGA_XC_B3LYP'}],
374
+ 'B3LYPV1R': [{'name': 'HYB_GGA_XC_B3LYPVWN1RPA'}],
375
+ 'B3LYPV3': [{'name': 'HYB_GGA_XC_B3LYPVWN3'}],
376
+ 'B3P86': [{'name': 'HYB_GGA_XC_B3P86'}],
377
+ 'B3P86V1R': [{'name': 'HYB_GGA_XC_B3P86VWN1RPA'}],
378
+ 'B3P86V5': [{'name': 'HYB_GGA_XC_B3P86VWN5'}],
379
+ 'B97': [{'name': 'HYB_GGA_XC_B97'}],
380
+ 'B97-1': [{'name': 'HYB_GGA_XC_B971'}],
381
+ 'B97-2': [{'name': 'HYB_GGA_XC_B972'}],
382
+ 'B97-3': [{'name': 'HYB_GGA_XC_B973'}],
383
+ 'B97-K': [{'name': 'HYB_GGA_XC_B97K'}],
384
+ 'B98': [{'name': 'HYB_GGA_XC_B98'}],
385
+ 'PBE0': [{'name': 'HYB_GGA_XC_PBEH'}],
386
+ 'X3LYP': [{'name': 'HYB_GGA_XC_X3LYP'}],
387
+ 'SOGGA11X': [{'name': 'HYB_GGA_XC_SOGGA11X'}],
388
+ 'CAMB3LYP': [{'name': 'CAM-B3LYP'}],
389
+ 'WB97': [{'name': 'WB97'}],
390
+ 'WB97X': [{'name': 'WB97X'}],
391
+ 'WB97X-D': [{'name': 'WB97XD'}],
392
+ 'B2-PLYP': [{'name': 'B2PLYP'}],
393
+ 'B2K-PLYP': [{'name': 'B2KPLYP'}],
394
+ 'B2T-PLYP': [{'name': 'B2TPLYP'}],
395
+ 'B2GP-PLYP': [{'name': 'B2GPPLYP'}],
396
+ 'WB97X-2': [{'name': 'WB97X2'}],
397
+ 'WB97X-2L': [{'name': 'WB97X2L'}],
398
+ 'VS98': [{'name': 'MGGA_XC_VSXC'}],
399
+ 'PKZB': [{'name': 'MGGA_XC_PKZB'}],
400
+ 'THCTH': [{'name': 'MGGA_XC_TAU_HCTH'}],
401
+ 'THCTHHYB': [{'name': 'MGGA_XC_TAU_HCTHHYB'}],
402
+ 'BMK': [{'name': 'MGGA_XC_BMK'}],
403
+ 'TPSS': [{'name': 'MGGA_XC_TPSS'}],
404
+ 'TPSSH': [{'name': 'MGGA_XC_TPSSHYB'}],
405
+ 'TPSSM': [{'name': 'MGGA_XC_TPSSMOD'}],
406
+ 'REVTPSS': [{'name': 'MGGA_XC_REVISEDTPSS'}],
407
+ 'DLDF': [{'name': 'MGGA_XC_DLDF'}],
408
+ 'M05': [{'name': 'HYB_MGGA_XC_M05'}],
409
+ 'M05-2X': [{'name': 'HYB_MGGA_XC_M05_2X'}],
410
+ 'M06': [{'name': 'MGGA_C_M06'}, {'name': 'HYB_MGGA_X_M06'}],
411
+ 'M06-L': [{'name': 'MGGA_C_M06_L'}, {'name': 'MGGA_X_M06_L'}],
412
+ 'M06-2X': [{'name': 'MGGA_C_M06_2X'}, {'name': 'HYB_MGGA_X_M06_2X'}],
413
+ 'M06-HF': [{'name': 'MGGA_C_M06_HF'}, {'name': 'HYB_MGGA_X_M06_HF'}],
414
+ 'M08-HX': [{'name': 'MGGA_C_M08_HX'}, {'name': 'HYB_MGGA_X_M08_HX'}],
415
+ 'M08-SO': [{'name': 'MGGA_C_M08_SO'}, {'name': 'HYB_MGGA_X_M08_SO'}],
416
+ 'M11-L': [{'name': 'MGGA_C_M11_L'}, {'name': 'MGGA_X_M11_L'}],
417
+ 'M11': [{'name': 'MGGA_C_M11_L'}, {'name': 'MGGA_X_M11'}],
418
+ 'RHF': [{'name': 'RHF_X'}],
419
+ 'UHF': [{'name': 'UHF_X'}],
420
+ 'ROHF': [{'name': 'ROHF_X'}],
421
+ 'LCBOPLRD': [{'name': 'HYB_GGA_XC_HSE03'}],
422
+ 'XALPHA': [{'name': 'XALPHA_X_GRIDFREE'}],
423
+ 'DEPRISTO': [{'name': 'DEPRISTO_X_GRIDFREE'}],
424
+ 'CAMA': [{'name': 'CAMA_X_GRIDFREE'}],
425
+ 'HALF': [{'name': 'HYB_GGA_XC_HALF_GRIDFREE'}],
426
+ # 'VWN': [{'name': 'LDA_C_VWN5_GRIDFREE'}],
427
+ 'PWLOC': [{'name': 'PWLOC_C_GRIDFREE'}],
428
+ 'BPWLOC': [{'name': 'PWLOC_C_GRIDFREE'}, {'name': 'GGA_X_B88_GRIDFREE'}],
429
+ 'CAMB': [
430
+ {'name': 'GGA_C_CAMBRIDGE_GRIDFREE'},
431
+ {'name': 'GGA_X_CAMA_GRIDFREE'},
432
+ ],
433
+ 'XVWN': [{'name': 'LDA_C_VWN5_GRIDFREE'}, {'name': 'XALPHA_X_GRIDFREE'}],
434
+ 'XPWLOC': [{'name': 'GGA_C_PW91_GRIDFREE'}, {'name': 'XALPHA_X_GRIDFREE'}],
435
+ 'SPWLOC': [{'name': 'PWLOC_C_GRIDFREE'}, {'name': 'LDA_X_GRIDFREE'}],
436
+ 'WIGNER': [{'name': 'GGA_XC_WIGNER_GRIDFREE'}],
437
+ 'WS': [{'name': 'GGA_XC_WIGNER_GRIDFREE'}],
438
+ 'WIGEXP': [{'name': 'GGA_XC_WIGNER_GRIDFREE'}],
439
+ 'NONE': [{'name': 'NONE'}],
440
+ }
441
+ self._method_map = {
442
+ 'RHF': [{'name': 'RHF'}],
443
+ 'UHF': [{'name': 'UHF'}],
444
+ 'ROHF': [{'name': 'ROHF'}],
445
+ 'GVB': [{'name': 'GVB'}],
446
+ 'MCSCF': [{'name': 'MCSCF'}],
447
+ 'EXCITE': [{'name': 'TDDFT'}],
448
+ 'SPNFLP': [{'name': 'SF-TDDFT'}],
449
+ 'POL': [{'name': 'HYPERPOL'}],
450
+ 'VB2000': [{'name': 'VB'}],
451
+ 'CIS': [{'name': 'CIS'}],
452
+ 'SFCIS': [{'name': 'SF-CIS'}],
453
+ 'ALDET': [{'name': 'DET-MCSCF'}],
454
+ 'ORMAS': [{'name': 'ORMAS'}],
455
+ 'FSOCI': [{'name': 'SECONDORDER-CI'}],
456
+ 'GENCI': [{'name': 'GENERAL-CI'}],
457
+ 'LCCD': [{'name': 'L-CCSD'}],
458
+ 'CCD': [{'name': 'CCD'}],
459
+ 'CCSD': [{'name': 'CCSD'}],
460
+ 'CCSD(T)': [{'name': 'CCSD(T)'}],
461
+ 'R-CC': [{'name': 'R-CCSD(T)&R-CCSD[T]'}],
462
+ 'CR-CC': [{'name': 'CR-CCSD(T)&CR-CCSD[T]'}],
463
+ 'CR-CCL': [{'name': 'CR-CC(2,3)'}],
464
+ 'CCSD(TQ)': [{'name': 'CCSD(TQ)&R-CCSD(TQ)'}],
465
+ 'CR-CC(Q)': [{'name': 'CR-CCSD(TQ)'}],
466
+ 'EOM-CCSD': [{'name': 'EOM-CCSD'}],
467
+ 'CR-EOM': [{'name': 'CR-EOMCCSD(T)'}],
468
+ 'CR-EOML': [{'name': 'CR-EOMCC(2,3)'}],
469
+ 'IP-EOM2': [{'name': 'IP-EOMCCSD'}],
470
+ 'IP-EOM3A': [{'name': 'IP-EOMCCSDt'}],
471
+ 'EA-EOM2': [{'name': 'EA-EOMCCSD'}],
472
+ 'EA-EOM3A': [{'name': 'EA-EOMCCSDt'}],
473
+ 'IOTC': [{'name': 'SCALAR_RELATIVISTIC'}],
474
+ 'DK': [{'name': 'SCALAR_RELATIVISTIC'}],
475
+ 'RESC': [{'name': 'SCALAR_RELATIVISTIC'}],
476
+ 'NESC': [{'name': 'SCALAR_RELATIVISTIC'}],
477
+ 'SBKJC': [{'name': 'PSEUDO_SCALAR_RELATIVISTIC'}],
478
+ 'HW': [{'name': 'PSEUDO_SCALAR_RELATIVISTIC'}],
479
+ 'MCP': [{'name': 'PSEUDO_SCALAR_RELATIVISTIC'}],
480
+ 'TAMMD': [{'name': 'TAMM-DANCOFF'}],
481
+ 'DFTB': [{'name': 'DFTB'}],
482
+ 'MP2': [{'name': 'MP2'}],
483
+ 'RIMP2': [{'name': 'RESOLUTIONOFIDENTITY-MP2'}],
484
+ 'CPHF': [{'name': 'COUPLEDPERTURBED-HF'}],
485
+ 'G3MP2': [{'name': 'G3(MP2)'}],
486
+ 'G32CCSD': [{'name': 'G3(MP2,CCSD(T))'}],
487
+ 'G4MP2': [{'name': 'G4(MP2)'}],
488
+ 'G4MP2-6X': [{'name': 'G4(MP2)-6X'}],
489
+ 'CCCA-S4': [{'name': 'CCCA-S4'}],
490
+ 'CCCA-CCL': [{'name': 'CCCA-CC(2,3)'}],
491
+ 'MCQDPT': [{'name': 'MCQDPT2'}],
492
+ 'DETMRPT': [{'name': 'MRPT2'}],
493
+ 'FORS': [{'name': 'CASSCF'}],
494
+ 'FOCI': [{'name': 'FIRSTORDER-CI'}],
495
+ 'SOCI': [{'name': 'SECONDORDER-CI'}],
496
+ 'DM': [{'name': 'TRANSITIONMOMENTS'}],
497
+ 'HSO1': [{'name': 'ONEELEC-SOC'}],
498
+ 'HSO2P': [{'name': 'PARTIALTWOELEC-SOC'}],
499
+ 'HSO2': [{'name': 'TWOELEC-SOC'}],
500
+ 'HSO2FF': [{'name': 'TWOELECFORMFACTOR-SOC'}],
501
+ 'GUGA': [{'name': 'GUGA-CI'}],
502
+ 'NONE': [{'name': 'NOCORRELATEDMETHOD'}],
503
+ }
504
+ self._basis_set_map = {
505
+ 'STO': [{'name': 'STO'}],
506
+ 'N21': [{'name': 'N21'}],
507
+ 'N31': [{'name': 'N31'}],
508
+ 'N311': [{'name': 'N311'}],
509
+ 'MINI': [{'name': 'MINI'}],
510
+ 'MIDI': [{'name': 'MIDI'}],
511
+ 'DZV': [{'name': 'DZV'}],
512
+ 'DH': [{'name': 'DH'}],
513
+ 'TZV': [{'name': 'TZV'}],
514
+ 'MC': [{'name': 'MC'}],
515
+ 'G3L': [{'name': 'G3MP2LARGE'}],
516
+ 'G3LX': [{'name': 'G3MP2LARGEXP'}],
517
+ 'CCD': [{'name': 'CC_PVDZ'}],
518
+ 'CCT': [{'name': 'CC_PVTZ'}],
519
+ 'CCQ': [{'name': 'CC_PVQZ'}],
520
+ 'CC5': [{'name': 'CC_PV5Z'}],
521
+ 'CC6': [{'name': 'CC_PV6Z'}],
522
+ 'ACCD': [{'name': 'AUG-CC-PVDZ'}],
523
+ 'ACCT': [{'name': 'AUG-CC-PVTZ'}],
524
+ 'ACCQ': [{'name': 'AUG-CC-PVQZ'}],
525
+ 'ACC5': [{'name': 'AUG-CC-PV5Z'}],
526
+ 'ACC6': [{'name': 'AUG-CC-PV6Z'}],
527
+ 'CCDC': [{'name': 'CC-PCVDZ'}],
528
+ 'CCTC': [{'name': 'CC-PCVTZ'}],
529
+ 'CCQC': [{'name': 'CC-PCVQZ'}],
530
+ 'CC5C': [{'name': 'CC-PCV5Z'}],
531
+ 'CC6C': [{'name': 'CC-PCV6Z'}],
532
+ 'ACCDC': [{'name': 'AUG-CC-PCVDZ'}],
533
+ 'ACCTC': [{'name': 'AUG-CC-PCVTZ'}],
534
+ 'ACCQC': [{'name': 'AUG-CC-PCVQZ'}],
535
+ 'ACC5C': [{'name': 'AUG-CC-PCV5Z'}],
536
+ 'ACC6C': [{'name': 'AUG-CC-PCV6Z'}],
537
+ 'CCDWC': [{'name': 'CC-PWCVDZ'}],
538
+ 'CCTWC': [{'name': 'CC-PWCVTZ'}],
539
+ 'CCQWC': [{'name': 'CC-PWCVQZ'}],
540
+ 'CC5WC': [{'name': 'CC-PWCV5Z'}],
541
+ 'CC6WC': [{'name': 'CC-PWCV6Z'}],
542
+ 'ACCDWC': [{'name': 'AUG-CC-PWCVDZ'}],
543
+ 'ACCTWC': [{'name': 'AUG-CC-PWCVTZ'}],
544
+ 'ACCQWC': [{'name': 'AUG-CC-PWCVQZ'}],
545
+ 'ACC5WC': [{'name': 'AUG-CC-PWCV5Z'}],
546
+ 'ACC6WC': [{'name': 'AUG-CC-PWCV6Z'}],
547
+ 'PCSEG-0': [{'name': 'PCSEG-0'}],
548
+ 'PCSEG-1': [{'name': 'PCSEG-1'}],
549
+ 'PCSEG-2': [{'name': 'PCSEG-2'}],
550
+ 'PCSEG-3': [{'name': 'PCSEG-3'}],
551
+ 'PCSEG-4': [{'name': 'PCSEG-4'}],
552
+ 'APCSEG-0': [{'name': 'AUG-PCSEG-0'}],
553
+ 'APCSEG-1': [{'name': 'AUG-PCSEG-1'}],
554
+ 'APCSEG-2': [{'name': 'AUG-PCSEG-2'}],
555
+ 'APCSEG-3': [{'name': 'AUG-PCSEG-3'}],
556
+ 'APCSEG-4': [{'name': 'AUG-PCSEG-4'}],
557
+ 'SPK-DZP': [{'name': 'SPK-DZP'}],
558
+ 'SPK-DTP': [{'name': 'SPK-DTP'}],
559
+ 'SPK-DQP': [{'name': 'SPK-DQP'}],
560
+ 'SPK-ADZP': [{'name': 'AUG-SPK-DZP'}],
561
+ 'SPK-ATZP': [{'name': 'AUG-SPK-TZP'}],
562
+ 'SPK-AQZP': [{'name': 'AUG-SPK-QZP'}],
563
+ 'SPKRDZP': [{'name': 'SPK-RELDZP'}],
564
+ 'SPKRDTP': [{'name': 'SPK-RELDTP'}],
565
+ 'SPKRDQP': [{'name': 'SPK-RELDQP'}],
566
+ 'SPKRADZP': [{'name': 'AUG-SPK-RELDZP'}],
567
+ 'SPKRATZP': [{'name': 'AUG-SPK-RELTZP'}],
568
+ 'SPKRAQZP': [{'name': 'AUG-SPK-RELQZP'}],
569
+ 'SPK-DZC': [{'name': 'SPK-DZC'}],
570
+ 'SPK-TZC': [{'name': 'SPK-TZC'}],
571
+ 'SPK-QZC': [{'name': 'SPK-QZC'}],
572
+ 'SPK-DZCD': [{'name': 'SPK-DZCD'}],
573
+ 'SPK-TZCD': [{'name': 'SPK-TZCD'}],
574
+ 'SPK-QZCD': [{'name': 'SPK-QZCD'}],
575
+ 'SPKRDZC': [{'name': 'SPK-RELDZC'}],
576
+ 'SPKRTZC': [{'name': 'SPK-RELTZC'}],
577
+ 'SPKRQZC': [{'name': 'SPK-RELQZC'}],
578
+ 'SPKRDZCD': [{'name': 'SPK-RELDZCD'}],
579
+ 'SPKRTZCD': [{'name': 'SPK-RELTZCD'}],
580
+ 'SPKRQZCD': [{'name': 'SPK-RELQZCD'}],
581
+ 'KTZV': [{'name': 'KARLSRUHETZV'}],
582
+ 'KTZVP': [{'name': 'KARLSRUHETZVP'}],
583
+ 'KTZVPP': [{'name': 'KARLSRUHETZVPP'}],
584
+ 'MCP-DZP': [{'name': 'MCP-DZP'}],
585
+ 'MCP-TZP': [{'name': 'MCP-TZP'}],
586
+ 'MCP-QZP': [{'name': 'MCP-QZP'}],
587
+ 'MCP-ATZP': [{'name': 'AUG-MCP-TZP'}],
588
+ 'MCP-AQZP': [{'name': 'AUG-MCP-QZP'}],
589
+ 'MCPCDZP': [{'name': 'MCPCDZP'}],
590
+ 'MCPCTZP': [{'name': 'MCPCTZP'}],
591
+ 'MCPCQZP': [{'name': 'MCPCQZP'}],
592
+ 'MCPACDZP': [{'name': 'AUG-MCPCDZP'}],
593
+ 'MCPACTZP': [{'name': 'AUG-MCPCTZP'}],
594
+ 'MCPACQZP': [{'name': 'AUG-MCPCQZP'}],
595
+ 'IMCP-SR1': [{'name': 'IMPROVEDMCP-SCALREL1'}],
596
+ 'IMCP-SR2': [{'name': 'IMPROVEDMCP-SCALREL2'}],
597
+ 'ZFK3-DK3': [{'name': 'ZFK3-DK3'}],
598
+ 'ZFK4-DK3': [{'name': 'ZFK4-DK3'}],
599
+ 'ZFK5-DK3': [{'name': 'ZFK5-DK3'}],
600
+ 'ZFK3LDK3': [{'name': 'ZFK3LDK3'}],
601
+ 'ZFK4LDK3': [{'name': 'ZFK4LDK3'}],
602
+ 'ZFK5LDK3': [{'name': 'ZFK5LDK3'}],
603
+ 'SLATER-MNDO': [{'name': 'SLATER-MNDO'}],
604
+ 'AM1': [{'name': 'SLATER-AM1'}],
605
+ 'PM3': [{'name': 'SLATER-PM3'}],
606
+ 'RM1': [{'name': 'SLATER-RM1'}],
607
+ 'DFTB': [{'name': 'SLATER-DFTB'}],
608
+ }
609
+ self._metainfo_map = {
610
+ 'one electron': 'x_gamess_one_electron',
611
+ 'two electron': 'x_gamess_two_electron',
612
+ 'virial ratio (v/t)': 'x_gamess_virial_ratio',
613
+ }
614
+
615
+ self.out_parser = OutParser()
616
+
617
+ @property
618
+ def nspin(self):
619
+ if self._nspin is None:
620
+ for key, val in self.out_parser.get('control_options', {}).get(
621
+ 'key_val', []
622
+ ):
623
+ if key == 'MULT':
624
+ self._nspin = 1 if val == 1 else 2
625
+ break
626
+ return self._nspin
627
+
628
+ def init_parser(self):
629
+ self.out_parser.mainfile = self.filepath
630
+ self.out_parser.logger = self.logger
631
+ self._nspin = None
632
+
633
+ def parse_method(self):
634
+ sec_method = Method()
635
+ self.archive.run[-1].method.append(sec_method)
636
+
637
+ for key in ['basis', 'control', 'system']:
638
+ setattr(
639
+ sec_method,
640
+ 'x_gamess_%s_options' % key,
641
+ {
642
+ key: val
643
+ for key, val in self.out_parser.get('%s_options' % key, {}).get(
644
+ 'key_val', []
645
+ )
646
+ },
647
+ )
648
+
649
+ for key, val in self.out_parser.get('basis_options', {}).get('key_val', []):
650
+ setattr(sec_method, 'x_gamess_basis_set_%s' % key.lower(), val)
651
+
652
+ for value in self.out_parser.get('coordinates', {}).get('label_charge', []):
653
+ atom = AtomParameters()
654
+ sec_method.atom_parameters.append(atom)
655
+ atom.label = value[0]
656
+ atom.charge = float(value[1]) * ureg.elementary_charge
657
+
658
+ def resolve_basis(gbasis):
659
+ # basis_set_name = self._basis_set_map.get(gbasis)
660
+ igauss = sec_method.x_gamess_basis_options.get('IGAUSS', 'NONE')
661
+
662
+ if gbasis == 'STO':
663
+ return f'STO-{igauss}G'
664
+
665
+ symbol, igauss = ('G', f'{igauss}-') if gbasis.startswith('N') else ('', '')
666
+ gbasis = gbasis.lstrip('N')
667
+
668
+ plus = ''
669
+ for orb in ['SP', 'P']:
670
+ if sec_method.x_gamess_basis_options.get(
671
+ f'DIFF{orb}', 'NONE'
672
+ ).startswith('T'):
673
+ plus += '+'
674
+
675
+ orb_suffix = ''
676
+ for orb in ['d', 'f', 'p']:
677
+ nfunc = sec_method.x_gamess_basis_options.get(f'N{orb.upper()}FUNC', 0)
678
+ prefix = '' if nfunc == 0 else orb if nfunc == 1 else f'{nfunc}{orb}'
679
+ orb_suffix += (
680
+ f',{prefix}' if orb == 'p' and orb_suffix and prefix else prefix
681
+ )
682
+ orb_suffix = f'({orb_suffix})' if orb_suffix else orb_suffix
683
+
684
+ return f'{igauss}{gbasis}{plus}{symbol}{orb_suffix}'
685
+
686
+ # Basis set
687
+ gbasis = sec_method.x_gamess_basis_options.get('GBASIS', 'NONE')
688
+ sec_method.electrons_representation = [
689
+ BasisSetContainer(
690
+ type='atom-centered orbitals',
691
+ scope=['wavefunction'],
692
+ basis_set=[
693
+ BasisSet(
694
+ type='gaussians',
695
+ )
696
+ ],
697
+ )
698
+ ]
699
+ for basis_set in self._basis_set_map.get(gbasis, []):
700
+ sec_method.electrons_representation[0].basis_set[0].atom_centered.append(
701
+ BasisSetAtomCentered(
702
+ name=basis_set.get('name'),
703
+ formula=resolve_basis(gbasis),
704
+ )
705
+ )
706
+
707
+ # electronic structure method
708
+ sec_method.electronic = Electronic()
709
+ relativity = sec_method.x_gamess_control_options.get(
710
+ 'RELWFN', sec_method.x_gamess_control_options.get('PP', 'NONE')
711
+ )
712
+ if relativity != 'NONE':
713
+ for method in self._method_map.get(relativity, []):
714
+ sec_method.electronic.relativity_method = method.get('name', '').lower()
715
+
716
+ scf_type = sec_method.x_gamess_control_options.get('SCFTYP', 'NONE')
717
+ run_type = sec_method.x_gamess_control_options.get('RUNTYP', 'NONE')
718
+ mp_level = sec_method.x_gamess_control_options.get('MPLEVL', 'NONE')
719
+ methods = [
720
+ sec_method.x_gamess_control_options.get(key, 'NONE')
721
+ for key in ['CITYP', 'CCTYP', 'VBTYP', 'TDDFT']
722
+ ]
723
+ methods = [m for m in methods if m != 'NONE']
724
+ electronic_method = (
725
+ scf_type if scf_type != 'NONE' else methods[0] if methods else run_type
726
+ )
727
+ if scf_type in ['RHF', 'UHF', 'ROHF'] and mp_level == 2:
728
+ sec_method.electronic.method = 'MP2'
729
+ elif scf_type == 'MCSCF':
730
+ sec_method.electronic.method = 'MRPT2' if mp_level == 2 else 'MCSCF'
731
+ elif electronic_method != 'NONE':
732
+ for method in self._method_map.get(electronic_method, []):
733
+ sec_method.electronic.method = method.get('name')
734
+
735
+ # dft xc functional
736
+ dfttyp = sec_method.x_gamess_control_options.get('DFTTYP', 'NONE')
737
+ if dfttyp != 'NONE':
738
+ sec_method.dft = DFT(xc_functional=XCFunctional())
739
+ for functional in self._xc_map.get(dfttyp, []):
740
+ xc_functional = functional.get('name', '')
741
+ if '_X_' in xc_functional or xc_functional.endswith('_X'):
742
+ sec_method.dft.xc_functional.exchange.append(
743
+ Functional(name=xc_functional)
744
+ )
745
+ elif '_C_' in xc_functional or xc_functional.endswith('_C'):
746
+ sec_method.dft.xc_functional.correlation.append(
747
+ Functional(name=xc_functional)
748
+ )
749
+ elif 'HYB' in xc_functional:
750
+ sec_method.dft.xc_functional.hybrid.append(
751
+ Functional(name=xc_functional)
752
+ )
753
+ else:
754
+ sec_method.dft.xc_functional.contributions.append(
755
+ Functional(name=xc_functional)
756
+ )
757
+
758
+ def parse_calculation(self, source):
759
+ time_initial = (
760
+ self.archive.run[-1].calculation[-1].time_physical
761
+ if self.archive.run[-1].calculation
762
+ else 0 * ureg.s
763
+ )
764
+ sec_scc = Calculation()
765
+ self.archive.run[-1].calculation.append(sec_scc)
766
+
767
+ if source.time_physical is not None:
768
+ sec_scc.time_physical = source.time_physical[-1] * ureg.s
769
+ sec_scc.time_calculation = sec_scc.time_physical - time_initial
770
+
771
+ if source.scf is not None:
772
+ for iteration in source.scf.get('iteration', {}).get('iter', []):
773
+ sec_scf = ScfIteration()
774
+ sec_scc.scf_iteration.append(sec_scf)
775
+ sec_scf.energy = Energy(
776
+ total=EnergyEntry(value=iteration[0] * ureg.hartree),
777
+ change=iteration[1] * ureg.hartree,
778
+ )
779
+
780
+ sec_scc.energy = Energy(total=EnergyEntry(value=source.scf.energy_total))
781
+ sec_scc.calculation_converged = source.scf.converged
782
+
783
+ eigenvalues = source.scf.get('eigenvectors', {}).get('eigenvalues')
784
+ if eigenvalues is not None:
785
+ sec_eigenvalues = BandEnergies()
786
+ sec_scc.eigenvalues.append(sec_eigenvalues)
787
+ eigenvalues = np.array(np.hstack(eigenvalues), dtype=np.float64)
788
+ shape = (self.nspin, 1, np.size(eigenvalues) // self.nspin)
789
+ sec_eigenvalues.energies = np.reshape(eigenvalues, shape) * ureg.hartree
790
+ sec_eigenvalues.occupations = np.reshape(
791
+ np.array([2 if energy <= 0.0 else 0 for energy in eigenvalues])
792
+ / self.nspin,
793
+ shape,
794
+ )
795
+
796
+ properties = source.get('properties')
797
+ if properties is not None:
798
+ energies = {
799
+ key.strip().lower(): val
800
+ for key, val in properties.get('energy_components', [])
801
+ }
802
+ sec_energy = Energy()
803
+ sec_scc.energy = sec_energy
804
+ for key, val in energies.items():
805
+ # if key.endswith('potential energy') or key.endswith('kinetic energy'):
806
+ # continue
807
+ if key.endswith('energy'):
808
+ key = key.rstrip('energy').strip()
809
+ potential = energies.get(f'{key} potential energy')
810
+ # kinetic = energies.get(f'{key} kinetic energy')
811
+ key = self._metainfo_map.get(key, key).replace(' ', '_')
812
+ if hasattr(Energy, key) or key.startswith('x_gamess'):
813
+ setattr(
814
+ sec_energy,
815
+ key,
816
+ EnergyEntry(
817
+ value=val * ureg.hartree,
818
+ potential=potential * ureg.hartree
819
+ if potential
820
+ else potential,
821
+ # kinetic=kinetic * ureg.hartree if kinetic else kinetic
822
+ ),
823
+ )
824
+ else:
825
+ sec_energy.contributions.append(
826
+ EnergyEntry(kind=key, value=val * ureg.hartree)
827
+ )
828
+ else:
829
+ setattr(
830
+ sec_energy, self._metainfo_map.get(key, f'x_gamess_{key}'), val
831
+ )
832
+
833
+ population = properties.get('population_analysis')
834
+ if population is not None:
835
+ methods = ['Mulliken', 'Lowdin']
836
+ for n, method in enumerate(methods):
837
+ sec_charges = Charges()
838
+ sec_scc.charges.append(sec_charges)
839
+ sec_charges.analysis_method = method
840
+ if population.atomic is not None:
841
+ sec_charges.value = (
842
+ population.atomic[n * 2 + 1] * ureg.elementary_charge
843
+ )
844
+ if population.atomic_orbitals is not None:
845
+ for norbital, orbital in enumerate(
846
+ population.atomic_orbitals[1]
847
+ ):
848
+ sec_orbital_charges = ChargesValue()
849
+ sec_charges.orbital_projected.append(sec_orbital_charges)
850
+ sec_orbital_charges.atom_index = population.atomic_orbitals[
851
+ 0
852
+ ][norbital]
853
+ sec_orbital_charges.orbital = str(orbital)
854
+ sec_orbital_charges.value = (
855
+ float(population.atomic_orbitals[2 + n][norbital])
856
+ * ureg.elementary_charge
857
+ )
858
+ if population.spins is not None:
859
+ sec_charges.spins = population.spins[n]
860
+
861
+ orbitals = ['s', 'p', 'd', 'f', 'g', 'h', 'i']
862
+ for nspin, charges in enumerate(
863
+ population.get('spherical_harmonics', [])[:2]
864
+ ):
865
+ for norbital in range(len(charges[:-1])):
866
+ for natom in range(len(charges[norbital])):
867
+ sec_orbital_charges = ChargesValue()
868
+ sec_scc.charges[0].orbital_projected.append(
869
+ sec_orbital_charges
870
+ )
871
+ sec_orbital_charges.atom_index = natom
872
+ sec_orbital_charges.spin = nspin
873
+ sec_orbital_charges.orbital = orbitals[norbital]
874
+ sec_orbital_charges.value = (
875
+ charges[norbital][natom] * ureg.elementary_charge
876
+ )
877
+
878
+ moments = properties.get('electrostatic_moments')
879
+ if moments is not None:
880
+ for dipole in moments.get('dipole', []):
881
+ value = dipole.get('value')
882
+ if value is not None:
883
+ value = np.reshape(value, (len(value), 1))
884
+ sec_multipoles = Multipoles()
885
+ sec_scc.multipoles.append(sec_multipoles)
886
+ sec_multipoles.kind = 'electrostatic'
887
+ sec_multipoles.dipole = MultipolesEntry(
888
+ # origin=dipole.get('origin'),
889
+ value=value
890
+ )
891
+
892
+ if source.get('gradient') is not None:
893
+ sec_scc.forces = Forces(total=ForcesEntry(value=source.gradient))
894
+
895
+ def parse_system(self, source):
896
+ coordinates = source.get('coordinates', self.out_parser.coordinates)
897
+ if coordinates is not None:
898
+ sec_system = System()
899
+ self.archive.run[0].system.append(sec_system)
900
+ unit = self._units.get(coordinates.get('unit'), 1)
901
+ sec_system.atoms = Atoms(
902
+ labels=[
903
+ chemical_symbols[int(lc[1])]
904
+ for lc in coordinates.get('label_charge', [])
905
+ ],
906
+ positions=np.array(
907
+ [p for p in coordinates.get('position', [])], dtype=np.float64
908
+ )
909
+ * unit,
910
+ )
911
+
912
+ def parse(self, filepath, archive, logger):
913
+ self.filepath = filepath
914
+ self.archive = archive
915
+ self.logger = logging.getLogger(__name__) if logger is None else logger
916
+ self.init_parser()
917
+
918
+ run = Run()
919
+ archive.run.append(run)
920
+ run.program = Program(version=self.out_parser.get('program_version'))
921
+ for key, val in self.out_parser.items():
922
+ if key.startswith('x_gamess_'):
923
+ setattr(run, key, val)
924
+
925
+ self.parse_method()
926
+
927
+ if self.out_parser.get('geometry_opt') is not None:
928
+ for geometry_opt in self.out_parser.get('geometry_opt', []):
929
+ self.parse_system(geometry_opt)
930
+ self.parse_calculation(geometry_opt)
931
+ run.calculation[-1].system_ref = run.system[-1]
932
+ run.calculation[-1].method_ref = run.method[-1]
933
+ else:
934
+ self.parse_system(self.out_parser)
935
+ self.parse_calculation(self.out_parser)
936
+ run.calculation[-1].system_ref = run.system[-1]
937
+ run.calculation[-1].method_ref = run.method[-1]
938
+
939
+ # TODO
940
+ # thermochemistry
941
+ # parameters, output for diff methods e.g. mp2, cc, ci