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,1556 @@
|
|
|
1
|
+
import re
|
|
2
|
+
import numpy as np
|
|
3
|
+
import logging
|
|
4
|
+
import ase
|
|
5
|
+
|
|
6
|
+
from nomad.units import ureg
|
|
7
|
+
from nomad.parsing.file_parser.text_parser import TextParser, Quantity
|
|
8
|
+
from runschema.run import Run, Program
|
|
9
|
+
from runschema.method import (
|
|
10
|
+
Electronic,
|
|
11
|
+
Method,
|
|
12
|
+
XCFunctional,
|
|
13
|
+
Functional,
|
|
14
|
+
DFT,
|
|
15
|
+
BasisSet,
|
|
16
|
+
BasisSetAtomCentered,
|
|
17
|
+
BasisSetContainer,
|
|
18
|
+
)
|
|
19
|
+
from runschema.system import System, Atoms
|
|
20
|
+
from runschema.calculation import (
|
|
21
|
+
Calculation,
|
|
22
|
+
Energy,
|
|
23
|
+
EnergyEntry,
|
|
24
|
+
BandEnergies,
|
|
25
|
+
Forces,
|
|
26
|
+
ForcesEntry,
|
|
27
|
+
Thermodynamics,
|
|
28
|
+
ScfIteration,
|
|
29
|
+
)
|
|
30
|
+
from .metainfo.gaussian import (
|
|
31
|
+
x_gaussian_section_elstruc_method,
|
|
32
|
+
x_gaussian_section_moller_plesset,
|
|
33
|
+
x_gaussian_section_hybrid_coeffs,
|
|
34
|
+
x_gaussian_section_coupled_cluster,
|
|
35
|
+
x_gaussian_section_quadratic_ci,
|
|
36
|
+
x_gaussian_section_ci,
|
|
37
|
+
x_gaussian_section_semiempirical,
|
|
38
|
+
x_gaussian_section_molmech,
|
|
39
|
+
x_gaussian_section_excited,
|
|
40
|
+
x_gaussian_section_casscf,
|
|
41
|
+
x_gaussian_section_orbital_symmetries,
|
|
42
|
+
x_gaussian_section_geometry_optimization_info,
|
|
43
|
+
x_gaussian_section_molecular_multipoles,
|
|
44
|
+
x_gaussian_section_frequencies,
|
|
45
|
+
x_gaussian_section_thermochem,
|
|
46
|
+
x_gaussian_section_force_constant_matrix,
|
|
47
|
+
x_gaussian_section_times,
|
|
48
|
+
x_gaussian_section_symmetry,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class GaussianOutParser(TextParser):
|
|
53
|
+
def __init__(self):
|
|
54
|
+
super().__init__()
|
|
55
|
+
|
|
56
|
+
def init_quantities(self):
|
|
57
|
+
re_float = r'[\d\.\-\+Ee]+'
|
|
58
|
+
re_float_dexp = r'[\d\.\-\+EeDd]+'
|
|
59
|
+
re_eigs = re.compile(r'(\-?\d*\.\d+\s*)')
|
|
60
|
+
re_force = re.compile(r'(\d+\s*\-?\d*\..*)')
|
|
61
|
+
|
|
62
|
+
def str_to_exp(val_in):
|
|
63
|
+
val = np.array(
|
|
64
|
+
val_in.rstrip('.').upper().replace('D', 'E').split(), dtype=float
|
|
65
|
+
)
|
|
66
|
+
return val[0] if len(val) == 1 else val
|
|
67
|
+
|
|
68
|
+
def str_to_orbital_symmetries(val_in):
|
|
69
|
+
val = re.findall(r'(?:Occupied|Virtual)\s*((?:\(.+\)\s*)*)', val_in)
|
|
70
|
+
return [v.replace('(', '').replace(')', '').split() for v in val]
|
|
71
|
+
|
|
72
|
+
def str_to_eigenvalues(val_in):
|
|
73
|
+
val = val_in.split()
|
|
74
|
+
spin_index = 0 if val[0] == 'Alpha' else 1
|
|
75
|
+
occ = 0.0 if val[1] == 'virt' else 1.0
|
|
76
|
+
eigs, occs = [[], []], [[], []]
|
|
77
|
+
# gaussian sometimes prints values without spaces so we need a re matching
|
|
78
|
+
eigs[spin_index] = re_eigs.findall(val_in)
|
|
79
|
+
occs[spin_index] = [occ] * len(eigs[spin_index])
|
|
80
|
+
return eigs, occs
|
|
81
|
+
|
|
82
|
+
def str_to_normal_modes(val_in):
|
|
83
|
+
val = [v.split() for v in val_in.split('\n')]
|
|
84
|
+
return np.array([v[2:] for v in val if len(v) >= 5], dtype=float)
|
|
85
|
+
|
|
86
|
+
def str_to_force_constants(val_in):
|
|
87
|
+
val = re_force.findall(val_in)
|
|
88
|
+
fc = []
|
|
89
|
+
for v in val:
|
|
90
|
+
v = np.array(v.upper().replace('D', 'E').split(), dtype=float)
|
|
91
|
+
index = int(v[0])
|
|
92
|
+
if len(fc) < index:
|
|
93
|
+
fc.append([])
|
|
94
|
+
fc[index - 1].extend(v[1:])
|
|
95
|
+
for n in range(len(fc)):
|
|
96
|
+
fc[n].extend(np.zeros(index - n - 1))
|
|
97
|
+
fc = np.array(fc)
|
|
98
|
+
fc = fc + fc.T - np.diag(fc.diagonal())
|
|
99
|
+
return fc
|
|
100
|
+
|
|
101
|
+
def str_to_units(unit: str) -> ureg.Unit:
|
|
102
|
+
"""Map native Gaussian units to pint units.
|
|
103
|
+
Assumes lower case string input."""
|
|
104
|
+
conv = (
|
|
105
|
+
(r'AMU', 'amu'),
|
|
106
|
+
(r'Dyne', 'dyne'),
|
|
107
|
+
(r'KM', 'km'),
|
|
108
|
+
(r'Mole', 'mole'),
|
|
109
|
+
)
|
|
110
|
+
for u_gauss, u_pint in conv:
|
|
111
|
+
unit = re.sub(u_gauss, u_pint, unit)
|
|
112
|
+
return ureg(unit)
|
|
113
|
+
|
|
114
|
+
orientation_quantities = [
|
|
115
|
+
Quantity(
|
|
116
|
+
'standard_orientation',
|
|
117
|
+
r'd orientation[\s\S]+?X\s*Y\s*Z\s*\-+\s*([\d\.\s\-]+?)\-{2}',
|
|
118
|
+
convert=False,
|
|
119
|
+
str_operation=lambda x: np.array(
|
|
120
|
+
[v.split() for v in x.strip().split('\n')], dtype=float
|
|
121
|
+
),
|
|
122
|
+
),
|
|
123
|
+
Quantity(
|
|
124
|
+
'input_orientation',
|
|
125
|
+
r't orientation[\s\S]+?X\s*Y\s*Z\s*\-+\s*([\d\.\s\-]+?)\-{2}',
|
|
126
|
+
convert=False,
|
|
127
|
+
str_operation=lambda x: np.array(
|
|
128
|
+
[v.split() for v in x.strip().split('\n')], dtype=float
|
|
129
|
+
),
|
|
130
|
+
),
|
|
131
|
+
Quantity(
|
|
132
|
+
'z_matrix_orientation',
|
|
133
|
+
r'x orientation[\s\S]+?X\s*Y\s*Z\s*\-+\s*([\d\.\s\-]+?)\-{2}',
|
|
134
|
+
convert=False,
|
|
135
|
+
str_operation=lambda x: np.array(
|
|
136
|
+
[v.split() for v in x.strip().split('\n')], dtype=float
|
|
137
|
+
),
|
|
138
|
+
),
|
|
139
|
+
]
|
|
140
|
+
|
|
141
|
+
calculation_quantities = [
|
|
142
|
+
Quantity(
|
|
143
|
+
'energy_total',
|
|
144
|
+
rf'\n *(?:Energy=|Electronic Energy)\s*({re_float_dexp})',
|
|
145
|
+
str_operation=str_to_exp,
|
|
146
|
+
convert=False,
|
|
147
|
+
unit='hartree',
|
|
148
|
+
repeats=True,
|
|
149
|
+
),
|
|
150
|
+
Quantity('hybrid_xc_coeff1', rf'ScaHFX=\s*({re_float})', dtype=float),
|
|
151
|
+
Quantity(
|
|
152
|
+
'hybrid_xc_coeff2',
|
|
153
|
+
rf'ScaDFX=\s*({re_float}\s*{re_float}\s*{re_float}\s*{re_float})',
|
|
154
|
+
flatten=False,
|
|
155
|
+
),
|
|
156
|
+
Quantity('mp', r'(E2) ='),
|
|
157
|
+
Quantity(
|
|
158
|
+
'energy_total_mp',
|
|
159
|
+
rf'(?:EUMP2|EUMP3|UMP4\(DQ\)|UMP4\(SDQ\)|UMP4\(SDTQ\)|MP5)\s*=\s*({re_float_dexp})',
|
|
160
|
+
str_operation=str_to_exp,
|
|
161
|
+
convert=False,
|
|
162
|
+
unit='hartree',
|
|
163
|
+
repeats=True,
|
|
164
|
+
),
|
|
165
|
+
Quantity(
|
|
166
|
+
'mp2_correction_energy',
|
|
167
|
+
rf'E2 =\s*({re_float_dexp})',
|
|
168
|
+
str_operation=str_to_exp,
|
|
169
|
+
convert=False,
|
|
170
|
+
unit='hartree',
|
|
171
|
+
repeats=True,
|
|
172
|
+
),
|
|
173
|
+
Quantity(
|
|
174
|
+
'mp3_correction_energy',
|
|
175
|
+
rf'E3\s*=\s*({re_float_dexp})',
|
|
176
|
+
str_operation=str_to_exp,
|
|
177
|
+
convert=False,
|
|
178
|
+
unit='hartree',
|
|
179
|
+
repeats=True,
|
|
180
|
+
),
|
|
181
|
+
Quantity(
|
|
182
|
+
'mp4dq_correction_energy',
|
|
183
|
+
rf'E4\(DQ\)=\s*({re_float_dexp})',
|
|
184
|
+
str_operation=str_to_exp,
|
|
185
|
+
convert=False,
|
|
186
|
+
unit='hartree',
|
|
187
|
+
repeats=True,
|
|
188
|
+
),
|
|
189
|
+
Quantity(
|
|
190
|
+
'mp4sdq_correction_energy',
|
|
191
|
+
rf'E4\(SDQ\)=\s*({re_float_dexp})',
|
|
192
|
+
str_operation=str_to_exp,
|
|
193
|
+
convert=False,
|
|
194
|
+
unit='hartree',
|
|
195
|
+
repeats=True,
|
|
196
|
+
),
|
|
197
|
+
Quantity(
|
|
198
|
+
'mp4sdtq_correction_energy',
|
|
199
|
+
rf'E4\(SDTQ\)=\s*({re_float_dexp})',
|
|
200
|
+
str_operation=str_to_exp,
|
|
201
|
+
convert=False,
|
|
202
|
+
unit='hartree',
|
|
203
|
+
repeats=True,
|
|
204
|
+
),
|
|
205
|
+
Quantity(
|
|
206
|
+
'mp5_correction_energy',
|
|
207
|
+
rf'DEMP5 =\s*({re_float_dexp})',
|
|
208
|
+
str_operation=str_to_exp,
|
|
209
|
+
convert=False,
|
|
210
|
+
unit='hartree',
|
|
211
|
+
repeats=True,
|
|
212
|
+
),
|
|
213
|
+
Quantity('cc', r'((?:CCSD\(T\)|E\(CORR\)))'),
|
|
214
|
+
Quantity(
|
|
215
|
+
'energy_total_cc',
|
|
216
|
+
rf'(?:\n *CCSD\(T\)|E\(CORR\))\s*=\s*({re_float_dexp})',
|
|
217
|
+
str_operation=str_to_exp,
|
|
218
|
+
convert=False,
|
|
219
|
+
unit='hartree',
|
|
220
|
+
repeats=True,
|
|
221
|
+
),
|
|
222
|
+
Quantity(
|
|
223
|
+
'ccsd_correction_energy',
|
|
224
|
+
rf'DE\(Corr\)=\s*({re_float_dexp})',
|
|
225
|
+
str_operation=str_to_exp,
|
|
226
|
+
convert=False,
|
|
227
|
+
unit='hartree',
|
|
228
|
+
repeats=True,
|
|
229
|
+
),
|
|
230
|
+
Quantity('qci', r'(Quadratic Configuration Interaction)'),
|
|
231
|
+
Quantity(
|
|
232
|
+
'energy_total_qci',
|
|
233
|
+
rf'(?:QCISD\(T\)|E\(Z\)|QCISD\(TQ\))=\s*({re_float_dexp})',
|
|
234
|
+
str_operation=str_to_exp,
|
|
235
|
+
convert=False,
|
|
236
|
+
unit='hartree',
|
|
237
|
+
repeats=True,
|
|
238
|
+
),
|
|
239
|
+
Quantity(
|
|
240
|
+
'qcisd_correction_energy',
|
|
241
|
+
rf'DE\(Z\)=\s*({re_float_dexp})',
|
|
242
|
+
str_operation=str_to_exp,
|
|
243
|
+
convert=False,
|
|
244
|
+
unit='hartree',
|
|
245
|
+
repeats=True,
|
|
246
|
+
),
|
|
247
|
+
Quantity(
|
|
248
|
+
'qcisdtq_correction_energy',
|
|
249
|
+
rf'DE5\s*=\s*({re_float_dexp})',
|
|
250
|
+
str_operation=str_to_exp,
|
|
251
|
+
convert=False,
|
|
252
|
+
unit='hartree',
|
|
253
|
+
repeats=True,
|
|
254
|
+
),
|
|
255
|
+
Quantity('ci', r'(\s{2}Configuration Interaction)'),
|
|
256
|
+
Quantity(
|
|
257
|
+
'energy_total_ci',
|
|
258
|
+
rf'E\(CI\)=\s*({re_float_dexp})',
|
|
259
|
+
str_operation=str_to_exp,
|
|
260
|
+
convert=False,
|
|
261
|
+
unit='hartree',
|
|
262
|
+
repeats=True,
|
|
263
|
+
),
|
|
264
|
+
Quantity(
|
|
265
|
+
'ci_correction_energy',
|
|
266
|
+
rf'DE\(CI\)=\s*({re_float_dexp})',
|
|
267
|
+
str_operation=str_to_exp,
|
|
268
|
+
convert=False,
|
|
269
|
+
unit='hartree',
|
|
270
|
+
repeats=True,
|
|
271
|
+
),
|
|
272
|
+
Quantity(
|
|
273
|
+
'semiempirical_method',
|
|
274
|
+
r'([-A-Z0-9]+\s*calculation of energy[a-zA-Z,. ]+)',
|
|
275
|
+
),
|
|
276
|
+
Quantity(
|
|
277
|
+
'semiempirical_energy',
|
|
278
|
+
rf'It=\s*\d+\s*PL=\s*[-+0-9EeDd.]+\s*DiagD=[A-Z]\s*ESCF=\s*({re_float})',
|
|
279
|
+
repeats=True,
|
|
280
|
+
unit='hartree',
|
|
281
|
+
dtype=float,
|
|
282
|
+
),
|
|
283
|
+
Quantity(
|
|
284
|
+
'molmech_method', r'([a-zA-Z0-9]+\s*calculation of energy[a-z,. ]+)'
|
|
285
|
+
),
|
|
286
|
+
Quantity(
|
|
287
|
+
'excited_state',
|
|
288
|
+
rf'Excited State\s*(\d+):\s*\S+\s*({re_float})\s*eV\s*{re_float}\s*nm\s*'
|
|
289
|
+
rf'f=({re_float})\s*<[\w*]+>=({re_float})\s*(.*)',
|
|
290
|
+
repeats=True,
|
|
291
|
+
convert=False,
|
|
292
|
+
),
|
|
293
|
+
Quantity(
|
|
294
|
+
'casscf_energy',
|
|
295
|
+
rf'\(\s*[0-9]+\)\s*EIGENVALUE\s*({re_float})',
|
|
296
|
+
repeats=True,
|
|
297
|
+
dtype=float,
|
|
298
|
+
unit='hartree',
|
|
299
|
+
),
|
|
300
|
+
Quantity(
|
|
301
|
+
'optimization_completed',
|
|
302
|
+
r'(Optimization (?:completed|stopped))',
|
|
303
|
+
flatten=False,
|
|
304
|
+
convert=False,
|
|
305
|
+
),
|
|
306
|
+
Quantity(
|
|
307
|
+
'population_analysis',
|
|
308
|
+
r'(Population analysis using the SCF density[\s\S]+?Condensed)',
|
|
309
|
+
sub_parser=TextParser(
|
|
310
|
+
quantities=[
|
|
311
|
+
Quantity(
|
|
312
|
+
'orbital_symmetries',
|
|
313
|
+
r'Orbital symmetries:([\s\S]*?)electro',
|
|
314
|
+
repeats=False,
|
|
315
|
+
str_operation=str_to_orbital_symmetries,
|
|
316
|
+
),
|
|
317
|
+
Quantity(
|
|
318
|
+
'x_gaussian_elstate_symmetry',
|
|
319
|
+
r'nic state is\s*(.+)\.',
|
|
320
|
+
flatten=False,
|
|
321
|
+
),
|
|
322
|
+
Quantity(
|
|
323
|
+
'eigenvalues',
|
|
324
|
+
r'(Alpha|Beta)\s*(occ|virt)\. eigenvalues \-\-\s*(.+)',
|
|
325
|
+
repeats=True,
|
|
326
|
+
str_operation=str_to_eigenvalues,
|
|
327
|
+
convert=False,
|
|
328
|
+
),
|
|
329
|
+
]
|
|
330
|
+
),
|
|
331
|
+
),
|
|
332
|
+
Quantity(
|
|
333
|
+
'charge',
|
|
334
|
+
rf'\n *Charge=\s*({re_float})\s*electrons',
|
|
335
|
+
dtype=float,
|
|
336
|
+
unit='elementary_charge',
|
|
337
|
+
),
|
|
338
|
+
Quantity(
|
|
339
|
+
'dipole',
|
|
340
|
+
r''.join([r'%s=\s*([\-\d\.]+)\s*' % c for c in ['X', 'Y', 'Z']]),
|
|
341
|
+
dtype=float,
|
|
342
|
+
unit='debye',
|
|
343
|
+
),
|
|
344
|
+
Quantity(
|
|
345
|
+
'quadrupole',
|
|
346
|
+
r''.join(
|
|
347
|
+
[
|
|
348
|
+
r'%s=\s*([\-\d\.]+)\s*' % c
|
|
349
|
+
for c in ['XX', 'YY', 'ZZ', 'XY', 'XZ', 'YZ']
|
|
350
|
+
]
|
|
351
|
+
),
|
|
352
|
+
dtype=float,
|
|
353
|
+
unit='debye * angstrom',
|
|
354
|
+
),
|
|
355
|
+
Quantity(
|
|
356
|
+
'octapole',
|
|
357
|
+
r''.join(
|
|
358
|
+
[
|
|
359
|
+
r'%s=\s*([\-\d\.]+)\s*' % c
|
|
360
|
+
for c in [
|
|
361
|
+
'XXX',
|
|
362
|
+
'YYY',
|
|
363
|
+
'ZZZ',
|
|
364
|
+
'XYY',
|
|
365
|
+
'XXY',
|
|
366
|
+
'XXZ',
|
|
367
|
+
'XZZ',
|
|
368
|
+
'YZZ',
|
|
369
|
+
'YYZ',
|
|
370
|
+
'XYZ',
|
|
371
|
+
]
|
|
372
|
+
]
|
|
373
|
+
),
|
|
374
|
+
dtype=float,
|
|
375
|
+
unit='debye * angstrom**2',
|
|
376
|
+
),
|
|
377
|
+
Quantity(
|
|
378
|
+
'hexadecapole',
|
|
379
|
+
r''.join(
|
|
380
|
+
[
|
|
381
|
+
r'%s=\s*([\-\d\.]+)\s*' % c
|
|
382
|
+
for c in [
|
|
383
|
+
'XXXX',
|
|
384
|
+
'YYYY',
|
|
385
|
+
'ZZZZ',
|
|
386
|
+
'XXXY',
|
|
387
|
+
'XXXZ',
|
|
388
|
+
'YYYX',
|
|
389
|
+
'YYYZ',
|
|
390
|
+
'ZZZX',
|
|
391
|
+
'ZZZY',
|
|
392
|
+
'XXYY',
|
|
393
|
+
'XXZZ',
|
|
394
|
+
'YYZZ',
|
|
395
|
+
'XXYZ',
|
|
396
|
+
'YYXZ',
|
|
397
|
+
'ZZXY',
|
|
398
|
+
]
|
|
399
|
+
]
|
|
400
|
+
),
|
|
401
|
+
dtype=float,
|
|
402
|
+
unit='debye * angstrom**3',
|
|
403
|
+
),
|
|
404
|
+
Quantity(
|
|
405
|
+
'frequency_unit',
|
|
406
|
+
r'[Hh]armonic frequencies \((\S+)\)',
|
|
407
|
+
str_operation=str_to_units,
|
|
408
|
+
),
|
|
409
|
+
Quantity(
|
|
410
|
+
'reduced_mass_unit',
|
|
411
|
+
r'reduced masses \((\S+)\)',
|
|
412
|
+
str_operation=str_to_units,
|
|
413
|
+
),
|
|
414
|
+
Quantity(
|
|
415
|
+
'harmonic_force_constant_unit',
|
|
416
|
+
r'force constants \((\S+)\)',
|
|
417
|
+
str_operation=str_to_units,
|
|
418
|
+
),
|
|
419
|
+
Quantity(
|
|
420
|
+
'ir_intensity_unit',
|
|
421
|
+
r'IR intensities \((\S+)\)',
|
|
422
|
+
str_operation=str_to_units,
|
|
423
|
+
),
|
|
424
|
+
Quantity(
|
|
425
|
+
'frequencies',
|
|
426
|
+
r'Frequencies\s[\-]{2}([\s\d\.]+)\n',
|
|
427
|
+
dtype=np.float64,
|
|
428
|
+
repeats=True,
|
|
429
|
+
), # note the mandatory space after the '--'. Use nested strategy if space is optional
|
|
430
|
+
Quantity(
|
|
431
|
+
'reduced_masses',
|
|
432
|
+
r'Red\. masses\s[\-]{2}([\s\d\.]+)\n',
|
|
433
|
+
dtype=np.float64,
|
|
434
|
+
repeats=True,
|
|
435
|
+
), # note the mandatory space after the '--'. Use nested strategy if space is optional
|
|
436
|
+
Quantity(
|
|
437
|
+
'harmonic_force_constants',
|
|
438
|
+
r'Frc consts[\s]{2}[\-]{2}([\s\d\.]+)\n',
|
|
439
|
+
dtype=np.float64,
|
|
440
|
+
repeats=True,
|
|
441
|
+
), # note the mandatory space after the '--'. Use nested strategy if space is optional
|
|
442
|
+
Quantity(
|
|
443
|
+
'ir_intensities',
|
|
444
|
+
r'IR Inten[\s]{4}[\-]{2}([\s\d\.]+)\n',
|
|
445
|
+
dtype=np.float64,
|
|
446
|
+
repeats=True,
|
|
447
|
+
), # note the mandatory space after the '--'. Use nested strategy if space is optional
|
|
448
|
+
Quantity(
|
|
449
|
+
'normal_modes',
|
|
450
|
+
r'Atom\s*AN.*\s*([\-\d\s\.]+)',
|
|
451
|
+
str_operation=str_to_normal_modes,
|
|
452
|
+
convert=False,
|
|
453
|
+
repeats=True,
|
|
454
|
+
),
|
|
455
|
+
Quantity(
|
|
456
|
+
'temperature_pressure',
|
|
457
|
+
rf'Temperature\s*({re_float})\s*Kelvin\.\s*Pressure\s*({re_float})\s*Atm\.',
|
|
458
|
+
),
|
|
459
|
+
Quantity(
|
|
460
|
+
'moments',
|
|
461
|
+
r'(?:Eigenvalues|EIGENVALUES) \-\-\s*(\d+\.\d{5})\s*(\d+\.\d{5})\s*(\d+\.\d{5})',
|
|
462
|
+
dtype=float,
|
|
463
|
+
unit='amu*angstrom**2',
|
|
464
|
+
),
|
|
465
|
+
Quantity(
|
|
466
|
+
'zero_point_energy',
|
|
467
|
+
rf'Zero\-point correction=\s*({re_float})',
|
|
468
|
+
dtype=float,
|
|
469
|
+
unit='hartree',
|
|
470
|
+
),
|
|
471
|
+
Quantity(
|
|
472
|
+
'thermal_correction_energy',
|
|
473
|
+
rf'Thermal correction to Energy=\s*({re_float})',
|
|
474
|
+
dtype=float,
|
|
475
|
+
unit='hartree',
|
|
476
|
+
),
|
|
477
|
+
Quantity(
|
|
478
|
+
'thermal_correction_enthalpy',
|
|
479
|
+
rf'Thermal correction to Enthalpy=\s*({re_float})',
|
|
480
|
+
dtype=float,
|
|
481
|
+
unit='hartree',
|
|
482
|
+
),
|
|
483
|
+
Quantity(
|
|
484
|
+
'thermal_correction_free_energy',
|
|
485
|
+
rf'Thermal correction to Gibbs Free Energy=\s*({re_float})',
|
|
486
|
+
dtype=float,
|
|
487
|
+
unit='hartree',
|
|
488
|
+
),
|
|
489
|
+
Quantity(
|
|
490
|
+
'forces',
|
|
491
|
+
r'Forces \(Hartrees/Bohr\)\s*Number\s*Number\s*X\s*Y\s*Z\s*\-+\s*([\d\s\-\.]+?)\s*\-\-',
|
|
492
|
+
str_operation=lambda x: np.array(
|
|
493
|
+
[xi.split()[2:5] for xi in x.split('\n')], dtype=float
|
|
494
|
+
),
|
|
495
|
+
convert=False,
|
|
496
|
+
unit='hartree/bohr',
|
|
497
|
+
),
|
|
498
|
+
Quantity(
|
|
499
|
+
'force_constants',
|
|
500
|
+
r'Force constants in Cartesian coordinates:\s*([\s\S]+?)Force',
|
|
501
|
+
str_operation=str_to_force_constants,
|
|
502
|
+
convert=False,
|
|
503
|
+
),
|
|
504
|
+
Quantity(
|
|
505
|
+
'scf_iteration',
|
|
506
|
+
r'(cle\s*\d+[\s\S]+?(?:Cy|\n\n|Leave))',
|
|
507
|
+
sub_parser=TextParser(
|
|
508
|
+
quantities=[
|
|
509
|
+
Quantity('number', r'cle\s*(\d+)', dtype=int),
|
|
510
|
+
Quantity(
|
|
511
|
+
'energy_total_scf_iteration',
|
|
512
|
+
rf' E=\s*({re_float})',
|
|
513
|
+
dtype=float,
|
|
514
|
+
unit='hartree',
|
|
515
|
+
),
|
|
516
|
+
Quantity(
|
|
517
|
+
'x_gaussian_delta_energy_total_scf_iteration',
|
|
518
|
+
rf'Delta\-E=\s*({re_float})',
|
|
519
|
+
dtype=float,
|
|
520
|
+
unit='hartree',
|
|
521
|
+
),
|
|
522
|
+
]
|
|
523
|
+
),
|
|
524
|
+
repeats=True,
|
|
525
|
+
),
|
|
526
|
+
Quantity(
|
|
527
|
+
'scf_iteration_final',
|
|
528
|
+
r'(SCF Done:[\s\S]+?(?:Leave|\n\n|End))',
|
|
529
|
+
sub_parser=TextParser(
|
|
530
|
+
quantities=[
|
|
531
|
+
Quantity(
|
|
532
|
+
'x_gaussian_single_configuration_calculation_converged',
|
|
533
|
+
r'(SCF Done)',
|
|
534
|
+
convert=False,
|
|
535
|
+
flatten=False,
|
|
536
|
+
),
|
|
537
|
+
Quantity('x_gaussian_hf_detect', r'E\((.+?)\)'),
|
|
538
|
+
Quantity(
|
|
539
|
+
'energy_total',
|
|
540
|
+
rf'({re_float})\s*A\.U\.',
|
|
541
|
+
dtype=float,
|
|
542
|
+
unit='hartree',
|
|
543
|
+
),
|
|
544
|
+
Quantity(
|
|
545
|
+
'x_gaussian_energy_error',
|
|
546
|
+
rf'Conv\s*=\s*({re_float_dexp})',
|
|
547
|
+
unit='hartree',
|
|
548
|
+
convert=False,
|
|
549
|
+
str_operation=str_to_exp,
|
|
550
|
+
),
|
|
551
|
+
Quantity(
|
|
552
|
+
' energy_kinetic_electronic',
|
|
553
|
+
rf'KE\s*=\s*({re_float_dexp})',
|
|
554
|
+
unit='hartree',
|
|
555
|
+
convert=False,
|
|
556
|
+
str_operation=str_to_exp,
|
|
557
|
+
),
|
|
558
|
+
Quantity(
|
|
559
|
+
'spin_S2',
|
|
560
|
+
rf'before annihilation\s*({re_float})',
|
|
561
|
+
dtype=float,
|
|
562
|
+
),
|
|
563
|
+
Quantity(
|
|
564
|
+
'x_gaussian_after_annihilation_spin_S2',
|
|
565
|
+
rf',\s*after\s*({re_float})',
|
|
566
|
+
dtype=float,
|
|
567
|
+
),
|
|
568
|
+
Quantity(
|
|
569
|
+
'x_gaussian_perturbation_energy',
|
|
570
|
+
r'[()A-Z0-9]+\s*=\s*[-+0-9D.]+\s*[()A-Z0-9]+\s*=\s*([-+0-9D.]+)',
|
|
571
|
+
convert=False,
|
|
572
|
+
str_operation=str_to_exp,
|
|
573
|
+
unit='hartree',
|
|
574
|
+
),
|
|
575
|
+
]
|
|
576
|
+
),
|
|
577
|
+
repeats=False,
|
|
578
|
+
),
|
|
579
|
+
]
|
|
580
|
+
|
|
581
|
+
run_quantities = [
|
|
582
|
+
Quantity(
|
|
583
|
+
'x_gaussian_settings_corrected',
|
|
584
|
+
r'\-{10}\s*(#[\s\S]+?)\-{10}',
|
|
585
|
+
convert=False,
|
|
586
|
+
str_operation=lambda x: re.sub(r'\s*\n\s*', '', x).strip(),
|
|
587
|
+
), # when x_gaussian_settings_corrected is no longer stored, `strip()` can be removed
|
|
588
|
+
Quantity('charge', r'Charge =\s*([\-\+\d]+)', dtype=int),
|
|
589
|
+
Quantity('spin_target', r'Multiplicity =\s*([\-\+\d]+)', dtype=int),
|
|
590
|
+
Quantity(
|
|
591
|
+
'lattice_vector',
|
|
592
|
+
r'(?:TV|Tv)\s*0?\s*([\d\. ]+)',
|
|
593
|
+
dtype=float,
|
|
594
|
+
repeats=True,
|
|
595
|
+
),
|
|
596
|
+
Quantity(
|
|
597
|
+
'x_gaussian_atomic_masses',
|
|
598
|
+
r'IAtWgt=([ \d\.]+)',
|
|
599
|
+
dtype=float,
|
|
600
|
+
repeats=True,
|
|
601
|
+
),
|
|
602
|
+
Quantity(
|
|
603
|
+
'system',
|
|
604
|
+
r'((?:Standard|Z-Matrix|Input) orientation:[\s\S]+?)'
|
|
605
|
+
r'(?:Predicted change in Energy|PREDICTED CHANGE IN ENERGY|Z-Matrix orientation|Normal termination)',
|
|
606
|
+
repeats=True,
|
|
607
|
+
sub_parser=TextParser(
|
|
608
|
+
quantities=[
|
|
609
|
+
Quantity(
|
|
610
|
+
'calculation',
|
|
611
|
+
r'(<S\*\*2> of initial guess=[\s\S]+?(?:Initial guess read from the read\-write|\Z))',
|
|
612
|
+
sub_parser=TextParser(quantities=calculation_quantities),
|
|
613
|
+
repeats=True,
|
|
614
|
+
)
|
|
615
|
+
]
|
|
616
|
+
+ calculation_quantities
|
|
617
|
+
+ orientation_quantities
|
|
618
|
+
),
|
|
619
|
+
),
|
|
620
|
+
Quantity(
|
|
621
|
+
'iteration',
|
|
622
|
+
r'ation Nr\.([\s\S]+?)(?:Iter|\n\n)',
|
|
623
|
+
repeats=True,
|
|
624
|
+
sub_parser=TextParser(quantities=calculation_quantities),
|
|
625
|
+
),
|
|
626
|
+
Quantity('program_cpu_time', r'Job cpu time:(.*)\.\n', flatten=False),
|
|
627
|
+
Quantity(
|
|
628
|
+
'program_termination_date',
|
|
629
|
+
r'Normal termination of Gaussian\s*\d+\s*at\s*(.*)\.\n',
|
|
630
|
+
flatten=False,
|
|
631
|
+
),
|
|
632
|
+
]
|
|
633
|
+
|
|
634
|
+
self._quantities = [
|
|
635
|
+
Quantity(
|
|
636
|
+
'program',
|
|
637
|
+
r'\s*Gaussian\s*([0-9]+):\s*(\S+)\s*(\S+)\s*(\d+\-\w+\-\d+)',
|
|
638
|
+
convert=False,
|
|
639
|
+
),
|
|
640
|
+
Quantity('x_gaussian_chk_file', r'%[Cc]hk=([A-Za-z0-9.]*)', dtype=str),
|
|
641
|
+
Quantity('x_gaussian_memory', r'%[Mm]em=([A-Za-z0-9.]*)', dtype=str),
|
|
642
|
+
Quantity(
|
|
643
|
+
'x_gaussian_number_of_processors',
|
|
644
|
+
r'%[Nn][Pp]roc=([A-Za-z0-9.]*)',
|
|
645
|
+
dtype=str,
|
|
646
|
+
),
|
|
647
|
+
Quantity(
|
|
648
|
+
'run',
|
|
649
|
+
r'(-{10}\s*#[\s\S]+?Normal termination.*\n)',
|
|
650
|
+
repeats=True,
|
|
651
|
+
sub_parser=TextParser(quantities=run_quantities),
|
|
652
|
+
),
|
|
653
|
+
]
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
class GaussianParser:
|
|
657
|
+
def __init__(self):
|
|
658
|
+
self.out_parser = GaussianOutParser()
|
|
659
|
+
|
|
660
|
+
self._xc_functional_map = {
|
|
661
|
+
'S': [{'name': 'LDA_X'}],
|
|
662
|
+
'XA': [{'name': 'LDA_X_EMPIRICAL'}],
|
|
663
|
+
'VWN': [{'name': 'LDA_C_VWN'}],
|
|
664
|
+
'VWN3': [{'name': 'LDA_C_VWN_3'}],
|
|
665
|
+
'SVWN': [{'name': 'LDA_X'}, {'name': 'LDA_C_VWN'}],
|
|
666
|
+
'LSDA': [{'name': 'LDA_X'}, {'name': 'LDA_C_VWN'}],
|
|
667
|
+
'B': [{'name': 'GGA_X_B88'}],
|
|
668
|
+
'BLYP': [{'name': 'GGA_C_LYP'}, {'name': 'GGA_X_B88'}],
|
|
669
|
+
'PBEPBE': [{'name': 'GGA_C_PBE'}, {'name': 'GGA_X_PBE'}],
|
|
670
|
+
'PBEH': [{'name': 'GGA_X_WPBEH'}],
|
|
671
|
+
'WPBEH': [{'name': 'GGA_X_WPBEH'}],
|
|
672
|
+
'PW91PW91': [{'name': 'GGA_C_PW91'}, {'name': 'GGA_X_PW91'}],
|
|
673
|
+
'M06L': [{'name': 'MGGA_C_M06_L'}, {'name': 'MGGA_X_M06_L'}],
|
|
674
|
+
'M11L': [{'name': 'MGGA_C_M11_L'}, {'name': 'MGGA_X_M11_L'}],
|
|
675
|
+
'SOGGA11': [{'name': 'GGA_X_SOGGA11'}, {'name': 'GGA_C_SOGGA11'}],
|
|
676
|
+
'MN12L': [{'name': 'MGGA_X_MN12_L'}, {'name': 'MGGA_C_MN12_L'}],
|
|
677
|
+
'N12': [{'name': 'GGA_C_N12'}, {'name': 'GGA_X_N12'}],
|
|
678
|
+
'VSXC': [{'name': 'MGGA_X_GVT4'}, {'name': 'MGGA_C_VSXC'}],
|
|
679
|
+
'HCTH93': [{'name': 'GGA_XC_HCTH_93'}],
|
|
680
|
+
'HCTH147': [{'name': 'GGA_XC_HCTH_147'}],
|
|
681
|
+
'HCTH407': [{'name': 'GGA_XC_HCTH_407'}],
|
|
682
|
+
'HCTH': [{'name': 'GGA_XC_HCTH_407'}],
|
|
683
|
+
'B97D': [{'name': 'GGA_XC_B97_D'}],
|
|
684
|
+
'B97D3': [{'name': 'GGA_XC_B97_D3'}],
|
|
685
|
+
'MPW': [{'name': 'GGA_X_MPW91'}],
|
|
686
|
+
'G96': [{'name': 'GGA_X_G96'}],
|
|
687
|
+
'O': [{'name': 'GGA_X_OPTX'}],
|
|
688
|
+
'BRX': [{'name': 'MGGA_X_BR89'}],
|
|
689
|
+
'PKZB': [{'name': 'MGGA_C_PKZB'}, {'name': 'MGGA_X_PKZB'}],
|
|
690
|
+
'PL': [{'name': 'LDA_C_PZ'}],
|
|
691
|
+
'P86': [{'name': 'GGA_C_P86'}],
|
|
692
|
+
'B95': [{'name': 'MGGA_C_BC95'}],
|
|
693
|
+
'KCIS': [{'name': 'MGGA_C_KCIS'}],
|
|
694
|
+
'BRC': [{'name': 'MGGA_X_BR89'}],
|
|
695
|
+
'VP86': [{'name': 'LDA_C_VWN_RPA'}, {'name': 'GGA_C_P86'}],
|
|
696
|
+
'V5LYP': [{'name': 'LDA_C_VWN_RPA'}, {'name': 'GGA_C_LYP'}],
|
|
697
|
+
'THCTH': [{'name': 'MGGA_X_TAU_HCTH'}, {'name': 'GGA_C_TAU_HCTH'}],
|
|
698
|
+
'TPSSTPSS': [{'name': 'MGGA_C_TPSS'}, {'name': 'MGGA_X_TPSS'}],
|
|
699
|
+
'B3LYP': [{'name': 'HYB_GGA_XC_B3LYP'}],
|
|
700
|
+
'B3PW91': [{'name': 'HYB_GGA_XC_B3PW91'}],
|
|
701
|
+
'B3P86': [{'name': 'HYB_GGA_XC_B3P86'}],
|
|
702
|
+
'B1B95': [{'name': 'HYB_MGGA_XC_B88B95'}],
|
|
703
|
+
'MPW1PW91': [{'name': 'HYB_GGA_XC_MPW1PW'}],
|
|
704
|
+
'MPW1LYP': [{'name': 'HYB_GGA_XC_MPW1LYP'}],
|
|
705
|
+
'MPW1PBE': [{'name': 'HYB_GGA_XC_MPW1PBE'}],
|
|
706
|
+
'MPW3PBE': [{'name': 'HYB_GGA_XC_MPW3PBE'}],
|
|
707
|
+
'B98': [{'name': 'HYB_GGA_XC_SB98_2C'}],
|
|
708
|
+
'B971': [{'name': 'HYB_GGA_XC_B97_1'}],
|
|
709
|
+
'B972': [{'name': 'HYB_GGA_XC_B97_2'}],
|
|
710
|
+
'O3LYP': [{'name': 'HYB_GGA_XC_O3LYP'}],
|
|
711
|
+
'TPSSH': [{'name': 'HYB_MGGA_XC_TPSSH'}],
|
|
712
|
+
'BMK': [{'name': 'HYB_GGA_XC_B97_K'}],
|
|
713
|
+
'X3LYP': [{'name': 'HYB_GGA_XC_X3LYP'}],
|
|
714
|
+
'THCTHHYB': [
|
|
715
|
+
{'name': 'HYB_MGGA_X_TAU_HCTH'},
|
|
716
|
+
{'name': 'GGA_C_HYB_TAU_HCTH'},
|
|
717
|
+
],
|
|
718
|
+
'BHANDH': [{'name': 'HYB_GGA_XC_BHANDH'}],
|
|
719
|
+
'BHANDHLYP': [{'name': 'HYB_GGA_XC_BHANDHLYP'}],
|
|
720
|
+
'APF': [{'name': 'HYB_GGA_XC_APF'}],
|
|
721
|
+
'APFD': [{'name': 'HYB_GGA_XC_APFD'}],
|
|
722
|
+
'HF': [{'name': 'HF_HF_X'}],
|
|
723
|
+
'RHF': [{'name': 'HF_RHF_X'}],
|
|
724
|
+
'UHF': [{'name': 'HF_UHF_X'}],
|
|
725
|
+
'ROHF': [{'name': 'HF_ROHF_X'}],
|
|
726
|
+
'CC': [{'name': 'HF_CCD'}],
|
|
727
|
+
'QCID': [{'name': 'HF_CCD'}],
|
|
728
|
+
'CCD': [{'name': 'HF_CCD'}],
|
|
729
|
+
'CCSD': [{'name': 'HF_CCSD'}],
|
|
730
|
+
'CCSD(T)': [{'name': 'HF_CCSD(T)'}],
|
|
731
|
+
'CCSD-T': [{'name': 'HF_CCSD(T)'}],
|
|
732
|
+
'CI': [{'name': 'HF_CI'}],
|
|
733
|
+
'CID': [{'name': 'HF_CID'}],
|
|
734
|
+
'CISD': [{'name': 'HF_CISD'}],
|
|
735
|
+
'QCISD': [{'name': 'HF_QCISD'}],
|
|
736
|
+
'QCISD(T)': [{'name': 'HF_QCISD(T)'}],
|
|
737
|
+
'QCISD(TQ)': [{'name': 'HF_QCISD(TQ)'}],
|
|
738
|
+
'OHSE2PBE': [{'name': 'HYB_GGA_XC_HSE03'}],
|
|
739
|
+
'HSEH1PBE': [{'name': 'HYB_GGA_XC_HSE06'}],
|
|
740
|
+
'OHSE1PBE': [{'name': 'HYB_GGA_XC_HSEOLD'}],
|
|
741
|
+
'PBEH1PBE': [{'name': 'HYB_GGA_XC_PBEH1PBE'}],
|
|
742
|
+
'PBE1PBE': [{'name': 'HYB_GGA_XC_PBEH'}],
|
|
743
|
+
'M05': [{'name': 'MGGA_X_M05'}, {'name': 'MGGA_C_M05'}],
|
|
744
|
+
'M052X': [{'name': 'HYB_MGGA_X_M05_2X'}, {'name': 'MGGA_C_M05_2X'}],
|
|
745
|
+
'M06': [{'name': 'HYB_MGGA_X_M06'}, {'name': 'MGGA_C_M06'}],
|
|
746
|
+
'M062X': [{'name': 'HYB_MGGA_X_M06_2X'}, {'name': 'MGGA_C_M06_2X'}],
|
|
747
|
+
'M06HF': [{'name': 'HYB_MGGA_X_M06_HF'}, {'name': 'MGGA_C_M06_HF'}],
|
|
748
|
+
'M11': [{'name': 'HYB_MGGA_X_M11'}, {'name': 'MGGA_C_M11'}],
|
|
749
|
+
'MP2': [{'name': 'HF_MP2'}],
|
|
750
|
+
'MP3': [{'name': 'HF_MP3'}],
|
|
751
|
+
'MP4': [{'name': 'HF_MP4'}],
|
|
752
|
+
'MP4(DQ)': [{'name': 'HF_MP4(DQ)'}],
|
|
753
|
+
'MP4(SDQ)': [{'name': 'HF_MP4(SDQ)'}],
|
|
754
|
+
'MP4(SDTQ)': [{'name': 'HF_MP4SDTQ'}],
|
|
755
|
+
'MP5': [{'name': 'HF_MP5'}],
|
|
756
|
+
'AM1': [{'name': 'HYB_AM1'}],
|
|
757
|
+
'PM3': [{'name': 'HYB_PM3'}],
|
|
758
|
+
'PM3MM': [{'name': 'HYB_PM3MM'}],
|
|
759
|
+
'PM3D3': [{'name': 'HYB_PM3D3'}],
|
|
760
|
+
'PM6': [{'name': 'HYB_PM6'}],
|
|
761
|
+
'PM7': [{'name': 'HYB_PM7'}],
|
|
762
|
+
'PM7R6': [{'name': 'HYB_PM7R6'}],
|
|
763
|
+
'PM7MOPAC': [{'name': 'HYB_PM7MOPAC'}],
|
|
764
|
+
'CBS-4': [{'name': 'HYB_CBS-4'}],
|
|
765
|
+
'CBS-4M': [{'name': 'HYB_CBS-4M'}],
|
|
766
|
+
'CBS-4O': [{'name': 'HYB_CBS-4O'}],
|
|
767
|
+
'CBS-APNO': [{'name': 'HYB_CBS-APNO'}],
|
|
768
|
+
'CBS-Q': [{'name': 'HYB_CBS-Q'}],
|
|
769
|
+
'CBS-QB3': [{'name': 'HYB_CBS-QB3'}],
|
|
770
|
+
'CBS-QB3O': [{'name': 'HYB_CBS-QB3O'}],
|
|
771
|
+
'ROCBS-QB3': [{'name': 'HYB_ROCBS-QB3'}],
|
|
772
|
+
'SOGGA11X': [
|
|
773
|
+
{'name': 'HYB_GGA_X_SOGGA11_X'},
|
|
774
|
+
{'name': 'HYB_GGA_X_SOGGA11_X'},
|
|
775
|
+
],
|
|
776
|
+
'MN12SX': [{'name': 'HYB_MGGA_X_MN12_SX'}, {'name': 'MGGA_C_MN12_SX'}],
|
|
777
|
+
'N12SX': [{'name': 'HYB_GGA_X_N12_SX'}, {'name': 'GGA_C_N12_SX'}],
|
|
778
|
+
'LC-WPBE': [{'name': 'HYB_GGA_XC_LC_WPBE'}],
|
|
779
|
+
'CAM-B3LYP': [{'name': 'HYB_GGA_XC_CAM_B3LYP'}],
|
|
780
|
+
'WB97': [{'name': 'HYB_GGA_XC_WB97'}],
|
|
781
|
+
'WB97X': [{'name': 'HYB_GGA_XC_WB97X'}],
|
|
782
|
+
'WB97XD': [{'name': 'HYB_GGA_XC_WB97X_D'}],
|
|
783
|
+
'HISSBPBE': [{'name': 'HYB_HISSBPBE'}],
|
|
784
|
+
'B2PLYP': [{'name': 'HYB_B2PLYP'}],
|
|
785
|
+
'MPW2PLYP': [{'name': 'HYB_MPW2PLYP'}],
|
|
786
|
+
'B2PLYPD': [{'name': 'HYB_B2PLYPD'}],
|
|
787
|
+
'MPW2PLYPD': [{'name': 'HYB_MPW2PLYPD'}],
|
|
788
|
+
'B2PLYPD3': [{'name': 'HYB_B2PLYPD3'}],
|
|
789
|
+
'MPW2PLYPD3': [{'name': 'HYB_MPW2PLYPD3'}],
|
|
790
|
+
'G1': [{'name': 'HYB_G1'}],
|
|
791
|
+
'G2': [{'name': 'HYB_G2'}],
|
|
792
|
+
'G2MP2': [{'name': 'HYB_G2MP2'}],
|
|
793
|
+
'G3': [{'name': 'HYB_G3'}],
|
|
794
|
+
'G3B3': [{'name': 'HYB_G3B3'}],
|
|
795
|
+
'G3MP2': [{'name': 'HYB_G3MP2'}],
|
|
796
|
+
'G3MP2B3': [{'name': 'HYB_G3MP2B3'}],
|
|
797
|
+
'G4': [{'name': 'HYB_G4'}],
|
|
798
|
+
'G4MP2': [{'name': 'HYB_G4MP2'}],
|
|
799
|
+
'LC-': [{'name': 'GGA_X_ITYH_LONG_RANGE'}],
|
|
800
|
+
'BP': [{'name': 'GGA_X_B88'}, {'name': 'GGA_C_P86'}],
|
|
801
|
+
'BP86': [{'name': 'GGA_X_B88'}, {'name': 'GGA_C_P86'}],
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
self._method_map = {
|
|
805
|
+
'AMBER': [{'name': 'Amber'}],
|
|
806
|
+
'DREIDING': [{'name': 'Dreiding'}],
|
|
807
|
+
'UFF': [{'name': 'UFF'}],
|
|
808
|
+
'AM1': [{'name': 'AM1'}],
|
|
809
|
+
'PM3': [{'name': 'PM3'}],
|
|
810
|
+
'PM3MM': [{'name': 'PM3MM'}],
|
|
811
|
+
'PM3D3': [{'name': 'PM3D3'}],
|
|
812
|
+
'PM6': [{'name': 'PM6'}],
|
|
813
|
+
'PM7': [{'name': 'PM7'}],
|
|
814
|
+
'PM7R6': [{'name': 'PM7R6'}],
|
|
815
|
+
'PM7MOPAC': [{'name': 'PM7MOPAC'}],
|
|
816
|
+
'PDDG': [{'name': 'PDDG'}],
|
|
817
|
+
'CNDO': [{'name': 'CNDO'}],
|
|
818
|
+
'INDO': [{'name': 'INDO'}],
|
|
819
|
+
'MINDO': [{'name': 'MINDO'}],
|
|
820
|
+
'MINDO3': [{'name': 'MINDO3'}],
|
|
821
|
+
'ZINDO': [{'name': 'ZINDO'}],
|
|
822
|
+
'HUCKEL': [{'name': 'HUCKEL'}],
|
|
823
|
+
'EXTENDEDHUCKEL': [{'name': 'HUCKEL'}],
|
|
824
|
+
'ONIOM': [{'name': 'ONIOM'}],
|
|
825
|
+
'HF': [{'name': 'HF'}],
|
|
826
|
+
'RHF': [{'name': 'RHF'}],
|
|
827
|
+
'UHF': [{'name': 'UHF'}],
|
|
828
|
+
'ROHF': [{'name': 'ROHF'}],
|
|
829
|
+
'GVB': [{'name': 'GVB'}],
|
|
830
|
+
'DFT': [{'name': 'DFT'}],
|
|
831
|
+
'CI': [{'name': 'CI'}],
|
|
832
|
+
'CID': [{'name': 'CID'}],
|
|
833
|
+
'CISD': [{'name': 'CISD'}],
|
|
834
|
+
'CIS': [{'name': 'CIS'}],
|
|
835
|
+
'BD': [{'name': 'BD'}],
|
|
836
|
+
'BD(T)': [{'name': 'BD(T)'}],
|
|
837
|
+
'CC': [{'name': 'CCD'}],
|
|
838
|
+
'QCID': [{'name': 'CCD'}],
|
|
839
|
+
'CCD': [{'name': 'CCD'}],
|
|
840
|
+
'CCSD': [{'name': 'CCSD'}],
|
|
841
|
+
'EOMCCSD': [{'name': 'EOMCCSD'}],
|
|
842
|
+
'QCISD': [{'name': 'QCISD'}],
|
|
843
|
+
'CCSD(T)': [{'name': 'CCSD(T)'}],
|
|
844
|
+
'CCSD-T': [{'name': 'CCSD(T)'}],
|
|
845
|
+
'QCISD(T)': [{'name': 'QCISD(T)'}],
|
|
846
|
+
'QCISD(TQ)': [{'name': 'QCISD(TQ)'}],
|
|
847
|
+
'MP2': [{'name': 'MP2'}],
|
|
848
|
+
'MP3': [{'name': 'MP3'}],
|
|
849
|
+
'MP4': [{'name': 'MP4'}],
|
|
850
|
+
'MP4DQ': [{'name': 'MP4DQ'}],
|
|
851
|
+
'MP4(DQ)': [{'name': 'MP4DQ'}],
|
|
852
|
+
'MP4SDQ': [{'name': 'MP4SDQ'}],
|
|
853
|
+
'MP4(SDQ)': [{'name': 'MP4SDQ'}],
|
|
854
|
+
'MP4SDTQ': [{'name': 'MP4SDTQ'}],
|
|
855
|
+
'MP4(SDTQ)': [{'name': 'MP4SDTQ'}],
|
|
856
|
+
'MP5': [{'name': 'MP5'}],
|
|
857
|
+
'CAS': [{'name': 'CASSCF'}],
|
|
858
|
+
'CASSCF': [{'name': 'CASSCF'}],
|
|
859
|
+
'G1': [{'name': 'G1'}],
|
|
860
|
+
'G2': [{'name': 'G2'}],
|
|
861
|
+
'G2MP2': [{'name': 'G2MP2'}],
|
|
862
|
+
'G3': [{'name': 'G3'}],
|
|
863
|
+
'G3MP2': [{'name': 'G3MP2'}],
|
|
864
|
+
'G3B3': [{'name': 'G3B3'}],
|
|
865
|
+
'G3MP2B3': [{'name': 'G3MP2B3'}],
|
|
866
|
+
'G4': [{'name': 'G4'}],
|
|
867
|
+
'G4MP2': [{'name': 'G4MP2'}],
|
|
868
|
+
'CBS-4': [{'name': 'CBS-4'}],
|
|
869
|
+
'CBS-4M': [{'name': 'CBS-4M'}],
|
|
870
|
+
'CBS-4O': [{'name': 'CBS-4O'}],
|
|
871
|
+
'CBS-APNO': [{'name': 'CBS-APNO'}],
|
|
872
|
+
'CBS-Q': [{'name': 'CBS-Q'}],
|
|
873
|
+
'CBS-QB3': [{'name': 'CBS-QB3'}],
|
|
874
|
+
'CBS-QB3O': [{'name': 'CBS-QB3O'}],
|
|
875
|
+
'CBSEXTRAP': [{'name': 'CBSExtrapolate'}],
|
|
876
|
+
'CBSEXTRAPOLATE': [{'name': 'CBSExtrapolate'}],
|
|
877
|
+
'ROCBS-QB3': [{'name': 'ROCBS-QB3'}],
|
|
878
|
+
'W1U': [{'name': 'W1U'}],
|
|
879
|
+
'W1BD': [{'name': 'W1BD'}],
|
|
880
|
+
'W1RO': [{'name': 'W1RO'}],
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
user = 'User-defined'
|
|
884
|
+
checkpoint = 'See previous calculation'
|
|
885
|
+
self._basis_set_map = {
|
|
886
|
+
'STO-3G': [{'name': 'STO-3G'}],
|
|
887
|
+
'3-21G': [{'name': '3-21G'}],
|
|
888
|
+
'6-21G': [{'name': '6-21G'}],
|
|
889
|
+
'4-31G': [{'name': '4-31G'}],
|
|
890
|
+
'6-31G': [{'name': '6-31G'}],
|
|
891
|
+
'6-311G': [{'name': '6-311G'}],
|
|
892
|
+
'D95V': [{'name': 'D95V'}],
|
|
893
|
+
'D95': [{'name': 'D95'}],
|
|
894
|
+
'CC-PVDZ': [{'name': 'cc-pVDZ'}],
|
|
895
|
+
'CC-PVTZ': [{'name': 'cc-pVTZ'}],
|
|
896
|
+
'CC-PVQZ': [{'name': 'cc-pVQZ'}],
|
|
897
|
+
'CC-PV5Z': [{'name': 'cc-pV5Z'}],
|
|
898
|
+
'CC-PV6Z': [{'name': 'cc-pV6Z'}],
|
|
899
|
+
'SV': [{'name': 'SV'}],
|
|
900
|
+
'SVP': [{'name': 'SVP'}],
|
|
901
|
+
'TZV': [{'name': 'TZV'}],
|
|
902
|
+
'TZVP': [{'name': 'TZVP'}],
|
|
903
|
+
'DEF2SV': [{'name': 'Def2SV'}],
|
|
904
|
+
'DEF2SVP': [{'name': 'Def2SVP'}],
|
|
905
|
+
'DEF2SVPP': [{'name': 'Def2SVPP'}],
|
|
906
|
+
'DEF2TZV': [{'name': 'Def2TZV'}],
|
|
907
|
+
'DEF2TZVP': [{'name': 'Def2TZVP'}],
|
|
908
|
+
'DEF2TZVPP': [{'name': 'Def2TZVPP'}],
|
|
909
|
+
'DEF2QZV': [{'name': 'Def2QZV'}],
|
|
910
|
+
'DEF2QZVP': [{'name': 'Def2QZVP'}],
|
|
911
|
+
'DEF2QZVPP': [{'name': 'Def2QZVPP'}],
|
|
912
|
+
'QZVP': [{'name': 'QZVP'}],
|
|
913
|
+
'MIDIX': [{'name': 'MidiX'}],
|
|
914
|
+
'EPR-II': [{'name': 'EPR-II'}],
|
|
915
|
+
'EPR-III': [{'name': 'EPR-III'}],
|
|
916
|
+
'UGBS': [{'name': 'UGBS'}],
|
|
917
|
+
'MTSMALL': [{'name': 'MTSmall'}],
|
|
918
|
+
'DGDZVP': [{'name': 'DGDZVP'}],
|
|
919
|
+
'DGDZVP2': [{'name': 'DGDZVP2'}],
|
|
920
|
+
'DGTZVP': [{'name': 'DGTZVP'}],
|
|
921
|
+
'CBSB3': [{'name': 'CBSB3'}],
|
|
922
|
+
'CBSB7': [{'name': 'CBSB7'}],
|
|
923
|
+
'SHC': [{'name': 'SHC'}],
|
|
924
|
+
'SEC': [{'name': 'SHC'}],
|
|
925
|
+
'CEP-4G': [{'name': 'CEP-4G'}],
|
|
926
|
+
'CEP-31G': [{'name': 'CEP-31G'}],
|
|
927
|
+
'CEP-121G': [{'name': 'CEP-121G'}],
|
|
928
|
+
'LANL1': [{'name': 'LANL1'}],
|
|
929
|
+
'LANL2': [{'name': 'LANL2'}],
|
|
930
|
+
'SDD': [{'name': 'SDD'}],
|
|
931
|
+
'OLDSDD': [{'name': 'OldSDD'}],
|
|
932
|
+
'SDDALL': [{'name': 'SDDAll'}],
|
|
933
|
+
'GEN': [{'name': user}],
|
|
934
|
+
'GENECP': [{'name': user + ' ' + 'ECP'}],
|
|
935
|
+
'CHKBAS': [{'name': 'CHKBAS'}],
|
|
936
|
+
'EXTRABASIS': [{'name': 'ExtraBasis'}],
|
|
937
|
+
'DGA1': [{'name': 'DGA1'}],
|
|
938
|
+
'DGA2': [{'name': 'DGA2'}],
|
|
939
|
+
'SVPFIT': [{'name': 'SVPFit'}],
|
|
940
|
+
'TZVPFIT': [{'name': 'TZVPFit'}],
|
|
941
|
+
'W06': [{'name': 'W06'}],
|
|
942
|
+
'CHF': [{'name': 'CHF'}],
|
|
943
|
+
'FIT': [{'name': 'FIT'}],
|
|
944
|
+
'AUTO': [{'name': 'AUTO'}],
|
|
945
|
+
'READ': [{'name': checkpoint}],
|
|
946
|
+
'READBASIS': [{'name': checkpoint}],
|
|
947
|
+
'RDBASIS': [{'name': checkpoint}],
|
|
948
|
+
'CHCKBASIS': [{'name': checkpoint}],
|
|
949
|
+
'CHECKBASIS': [{'name': checkpoint}],
|
|
950
|
+
'CHECKPOINTBASIS': [{'name': checkpoint}],
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
self._xc_functional_pattern = re.compile(
|
|
954
|
+
r'(?:#?[Pp]?)(?:(WPBEH)(.*)|(LC\-)(.*)|(G96)(.*)|(BRX)(.*)|(SV)(.*)|(B)([^2^3]*)|(O)([^2^3]))'
|
|
955
|
+
)
|
|
956
|
+
|
|
957
|
+
self._basis_set_pattern = re.compile(
|
|
958
|
+
r'(6\-311G)|(6\-31G)|(LANL2)|(LANL1)|(CBSB7)|(UGBS)|AUG\-(.*)|(D95)'
|
|
959
|
+
) # match additional specifications
|
|
960
|
+
|
|
961
|
+
self._energy_methods = {
|
|
962
|
+
'mp': (
|
|
963
|
+
x_gaussian_section_moller_plesset,
|
|
964
|
+
['mp2', 'mp3', 'mp4dq', 'mp4sdq', 'mp4sdtq', 'mp5'],
|
|
965
|
+
),
|
|
966
|
+
'cc': (x_gaussian_section_coupled_cluster, ['ccsd']),
|
|
967
|
+
'qci': (x_gaussian_section_quadratic_ci, ['qcisd', 'qcisdtq']),
|
|
968
|
+
'ci': (x_gaussian_section_ci, ['ci']),
|
|
969
|
+
'semiempirical': (x_gaussian_section_semiempirical, ['']),
|
|
970
|
+
'molmech': (x_gaussian_section_molmech, []),
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
def parse_scc(self, section):
|
|
974
|
+
sec_run = self.archive.run[-1]
|
|
975
|
+
sec_scc = Calculation()
|
|
976
|
+
sec_run.calculation.append(sec_scc)
|
|
977
|
+
|
|
978
|
+
# total energy
|
|
979
|
+
sec_energy = Energy()
|
|
980
|
+
sec_scc.energy = sec_energy
|
|
981
|
+
energy_total = section.get('energy_total')
|
|
982
|
+
if energy_total is not None:
|
|
983
|
+
sec_energy.total = EnergyEntry(value=energy_total[-1])
|
|
984
|
+
|
|
985
|
+
# hybrid coefficients
|
|
986
|
+
sec_hybrid_coeffs = None
|
|
987
|
+
for key in ['coeff1', 'coeff2']:
|
|
988
|
+
val = section.get('hybrid_xc_%s' % key)
|
|
989
|
+
if val is None:
|
|
990
|
+
continue
|
|
991
|
+
if sec_hybrid_coeffs is None:
|
|
992
|
+
sec_hybrid_coeffs = x_gaussian_section_hybrid_coeffs()
|
|
993
|
+
sec_scc.x_gaussian_section_hybrid_coeffs.append(sec_hybrid_coeffs)
|
|
994
|
+
setattr(sec_hybrid_coeffs, 'hybrid_xc_%s' % key, val)
|
|
995
|
+
|
|
996
|
+
def parse_energy_corrections(method, iteration=False):
|
|
997
|
+
if not iteration and section.get(method) is None:
|
|
998
|
+
return
|
|
999
|
+
|
|
1000
|
+
sec_class, energy_keys = self._energy_methods.get(method, (None, []))
|
|
1001
|
+
if sec_class is None:
|
|
1002
|
+
return
|
|
1003
|
+
|
|
1004
|
+
sec_method = sec_class()
|
|
1005
|
+
sec_def = sec_scc.m_def.all_sub_sections_by_section.get(sec_class.m_def)[0]
|
|
1006
|
+
sec_scc.m_add_sub_section(sec_def, sec_method)
|
|
1007
|
+
|
|
1008
|
+
for key in energy_keys:
|
|
1009
|
+
key = '%s_correction_energy' % key
|
|
1010
|
+
val = section.get(key)
|
|
1011
|
+
if val is not None:
|
|
1012
|
+
setattr(sec_method, 'x_gaussian_%s' % key, val[-1])
|
|
1013
|
+
|
|
1014
|
+
energy_method = section.get('%s_method' % method)
|
|
1015
|
+
if energy_method is not None:
|
|
1016
|
+
setattr(sec_method, 'x_gaussian_%s_method' % method, energy_method)
|
|
1017
|
+
|
|
1018
|
+
energy = section.get('%s_energy' % method)
|
|
1019
|
+
if energy is not None:
|
|
1020
|
+
setattr(sec_method, 'x_gaussian_%s_energy' % method, energy)
|
|
1021
|
+
|
|
1022
|
+
energy_total = section.get('energy_total_%s' % method)
|
|
1023
|
+
if energy_total is not None:
|
|
1024
|
+
sec_energy.total = EnergyEntry(value=energy_total[-1])
|
|
1025
|
+
|
|
1026
|
+
return sec_method
|
|
1027
|
+
|
|
1028
|
+
# energy corrections calculated from different methods
|
|
1029
|
+
sec_energy_method = None
|
|
1030
|
+
for method in ['mp', 'cc', 'qci', 'ci', 'semiempirical', 'molmech']:
|
|
1031
|
+
sec_energy_method = parse_energy_corrections(method)
|
|
1032
|
+
if sec_energy_method is not None:
|
|
1033
|
+
break
|
|
1034
|
+
|
|
1035
|
+
# TODO make metainfo accept array not separate sections
|
|
1036
|
+
# excited state
|
|
1037
|
+
excited_state = section.get('excited_state', [])
|
|
1038
|
+
for state in excited_state:
|
|
1039
|
+
sec_excited_state = x_gaussian_section_excited()
|
|
1040
|
+
sec_scc.x_gaussian_section_excited.append(sec_excited_state)
|
|
1041
|
+
sec_excited_state.x_gaussian_excited_state_number = int(state[0])
|
|
1042
|
+
sec_excited_state.x_gaussian_excited_energy = float(state[1]) * ureg.eV
|
|
1043
|
+
sec_excited_state.x_gaussian_excited_oscstrength = float(state[2])
|
|
1044
|
+
sec_excited_state.x_gaussian_excited_spin_squared = float(state[3])
|
|
1045
|
+
sec_excited_state.x_gaussian_excited_transition = ' '.join(state[4:])
|
|
1046
|
+
|
|
1047
|
+
# casscf
|
|
1048
|
+
casscf_energy = section.get('casscf_energy', [])
|
|
1049
|
+
for energy in casscf_energy:
|
|
1050
|
+
sec_casscf = x_gaussian_section_casscf()
|
|
1051
|
+
sec_scc.x_gaussian_section_casscf.append(sec_casscf)
|
|
1052
|
+
sec_casscf.x_gaussian_casscf_energy = energy
|
|
1053
|
+
|
|
1054
|
+
# orbital symmetries
|
|
1055
|
+
orbital_symmetries = section.get('population_analysis', {}).get(
|
|
1056
|
+
'orbital_symmetries'
|
|
1057
|
+
)
|
|
1058
|
+
if orbital_symmetries is not None:
|
|
1059
|
+
sec_orbital_symmetries = x_gaussian_section_orbital_symmetries()
|
|
1060
|
+
sec_run.x_gaussian_section_orbital_symmetries.append(sec_orbital_symmetries)
|
|
1061
|
+
if orbital_symmetries[:2]:
|
|
1062
|
+
sec_orbital_symmetries.x_gaussian_alpha_symmetries = np.concatenate(
|
|
1063
|
+
orbital_symmetries[:2]
|
|
1064
|
+
)
|
|
1065
|
+
if orbital_symmetries[2:]:
|
|
1066
|
+
sec_orbital_symmetries.x_gaussian_beta_symmetries = np.concatenate(
|
|
1067
|
+
orbital_symmetries[2:]
|
|
1068
|
+
)
|
|
1069
|
+
|
|
1070
|
+
# electronic symmetries
|
|
1071
|
+
elstate_symmetry = section.get('population_analysis', {}).get(
|
|
1072
|
+
'x_gaussian_elstate_symmetry'
|
|
1073
|
+
)
|
|
1074
|
+
if elstate_symmetry is not None:
|
|
1075
|
+
sec_symmetry = x_gaussian_section_symmetry()
|
|
1076
|
+
sec_run.x_gaussian_section_symmetry.append(sec_symmetry)
|
|
1077
|
+
sec_symmetry.x_gaussian_elstate_symmetry = elstate_symmetry
|
|
1078
|
+
|
|
1079
|
+
# eigenvalues
|
|
1080
|
+
values, occupation = [[], []], [[], []]
|
|
1081
|
+
eigenvalues = section.get('population_analysis', {}).get('eigenvalues')
|
|
1082
|
+
if eigenvalues is not None:
|
|
1083
|
+
for eigs_occs in eigenvalues:
|
|
1084
|
+
for spin in range(2):
|
|
1085
|
+
values[spin].extend(eigs_occs[0][spin])
|
|
1086
|
+
occupation[spin].extend(eigs_occs[1][spin])
|
|
1087
|
+
if not values[1]:
|
|
1088
|
+
values = values[0:1]
|
|
1089
|
+
occupation = np.array(occupation[0:1]) * 2
|
|
1090
|
+
try:
|
|
1091
|
+
values = np.array(values, dtype=np.dtype(np.float64))
|
|
1092
|
+
values = np.reshape(values, (len(values), 1, len(values[0])))
|
|
1093
|
+
occupation = np.reshape(
|
|
1094
|
+
occupation, (len(occupation), 1, len(occupation[0]))
|
|
1095
|
+
)
|
|
1096
|
+
sec_eigenvalues = BandEnergies()
|
|
1097
|
+
sec_scc.eigenvalues.append(sec_eigenvalues)
|
|
1098
|
+
sec_eigenvalues.energies = values * ureg.hartree
|
|
1099
|
+
sec_eigenvalues.occupations = occupation
|
|
1100
|
+
except Exception:
|
|
1101
|
+
self.logger.error('Error setting eigenvalues.')
|
|
1102
|
+
|
|
1103
|
+
# optimization
|
|
1104
|
+
optimization_completed = section.get('optimization_completed')
|
|
1105
|
+
if optimization_completed is not None:
|
|
1106
|
+
sec_optimization_info = x_gaussian_section_geometry_optimization_info()
|
|
1107
|
+
sec_run.x_gaussian_section_geometry_optimization_info.append(
|
|
1108
|
+
sec_optimization_info
|
|
1109
|
+
)
|
|
1110
|
+
sec_optimization_info.x_gaussian_geometry_optimization_converged = (
|
|
1111
|
+
optimization_completed
|
|
1112
|
+
)
|
|
1113
|
+
|
|
1114
|
+
# multipoles
|
|
1115
|
+
multipoles = []
|
|
1116
|
+
keys = ['charge', 'dipole', 'quadrupole', 'octapole', 'hexadecapole']
|
|
1117
|
+
for n, key in enumerate(keys):
|
|
1118
|
+
val = section.get(key)
|
|
1119
|
+
if val is not None:
|
|
1120
|
+
val = val.to('coulomb * meter**%d' % n).magnitude
|
|
1121
|
+
val = [val] if isinstance(val, float) else val
|
|
1122
|
+
# TODO why quadrupole moments are not sorted, adapted from old parser
|
|
1123
|
+
if key == 'quadrupole':
|
|
1124
|
+
val = [val[0], val[3], val[1], val[4], val[5], val[2]]
|
|
1125
|
+
multipoles.extend(val)
|
|
1126
|
+
if multipoles:
|
|
1127
|
+
sec_molecular_multipoles = x_gaussian_section_molecular_multipoles()
|
|
1128
|
+
sec_scc.x_gaussian_section_molecular_multipoles.append(
|
|
1129
|
+
sec_molecular_multipoles
|
|
1130
|
+
)
|
|
1131
|
+
sec_molecular_multipoles.x_gaussian_molecular_multipole_values = multipoles
|
|
1132
|
+
sec_molecular_multipoles.x_gaussian_molecular_multipole_m_kind = (
|
|
1133
|
+
'polynomial'
|
|
1134
|
+
)
|
|
1135
|
+
|
|
1136
|
+
# forces
|
|
1137
|
+
forces = section.get('forces')
|
|
1138
|
+
if forces is not None:
|
|
1139
|
+
sec_scc.forces = Forces(total=ForcesEntry(value_raw=forces))
|
|
1140
|
+
|
|
1141
|
+
# force constants
|
|
1142
|
+
force_constants = section.get('force_constants')
|
|
1143
|
+
if force_constants is not None:
|
|
1144
|
+
sec_force_constant = x_gaussian_section_force_constant_matrix()
|
|
1145
|
+
sec_run.x_gaussian_section_force_constant_matrix.append(sec_force_constant)
|
|
1146
|
+
force_constants = force_constants * ureg.hartree / ureg.bohr**2
|
|
1147
|
+
sec_force_constant.x_gaussian_force_constant_values = force_constants.to(
|
|
1148
|
+
'J/(m**2)'
|
|
1149
|
+
).magnitude
|
|
1150
|
+
|
|
1151
|
+
# vibrational frequencies
|
|
1152
|
+
frequencies = section.get('frequencies')
|
|
1153
|
+
if frequencies is not None:
|
|
1154
|
+
sec_frequencies = x_gaussian_section_frequencies()
|
|
1155
|
+
sec_run.x_gaussian_section_frequencies.append(sec_frequencies)
|
|
1156
|
+
|
|
1157
|
+
sec_frequencies.x_gaussian_frequencies = np.hstack(
|
|
1158
|
+
frequencies
|
|
1159
|
+
) * section.get('frequency_unit', ureg.cm_1)
|
|
1160
|
+
|
|
1161
|
+
reduced_masses = section.get('reduced_masses')
|
|
1162
|
+
if reduced_masses is not None:
|
|
1163
|
+
sec_frequencies.x_gaussian_red_masses = np.hstack(
|
|
1164
|
+
reduced_masses
|
|
1165
|
+
) * section.get('reduced_mass_unit', ureg.amu)
|
|
1166
|
+
|
|
1167
|
+
intensities = section.get('ir_intensities')
|
|
1168
|
+
if intensities is not None:
|
|
1169
|
+
sec_frequencies.x_gaussian_ir_intensities = np.hstack(
|
|
1170
|
+
intensities
|
|
1171
|
+
) * section.get('intensity_unit', ureg.kilometer / ureg.mole)
|
|
1172
|
+
|
|
1173
|
+
force_constants = section.get('harmonic_force_constants')
|
|
1174
|
+
if force_constants is not None:
|
|
1175
|
+
sec_frequencies.x_gaussian_harmonic_force_constants = np.hstack(
|
|
1176
|
+
force_constants
|
|
1177
|
+
) * section.get('force_constant_unit', ureg.mdyne / ureg.angstrom)
|
|
1178
|
+
|
|
1179
|
+
normal_modes = section.get('normal_modes')
|
|
1180
|
+
if normal_modes is not None:
|
|
1181
|
+
normal_modes = np.hstack(normal_modes)
|
|
1182
|
+
normal_modes = np.reshape(
|
|
1183
|
+
normal_modes, (len(normal_modes), len(normal_modes[0]) // 3, 3)
|
|
1184
|
+
)
|
|
1185
|
+
sec_frequencies.x_gaussian_normal_mode_values = np.transpose(
|
|
1186
|
+
normal_modes, axes=(1, 0, 2)
|
|
1187
|
+
)
|
|
1188
|
+
|
|
1189
|
+
# thermochemistry
|
|
1190
|
+
temperature_pressure = section.get('temperature_pressure')
|
|
1191
|
+
if temperature_pressure is not None:
|
|
1192
|
+
sec_thermo = Thermodynamics()
|
|
1193
|
+
sec_scc.thermodynamics.append(sec_thermo)
|
|
1194
|
+
# TODO extend Thermodynamics instead
|
|
1195
|
+
sec_thermochem = x_gaussian_section_thermochem()
|
|
1196
|
+
sec_run.x_gaussian_section_thermochem.append(sec_thermochem)
|
|
1197
|
+
sec_thermo.temperature = temperature_pressure[0]
|
|
1198
|
+
sec_thermo.pressure = (temperature_pressure[1] * ureg.atm).to('N/m**2')
|
|
1199
|
+
sec_scc.temperature = temperature_pressure[0]
|
|
1200
|
+
sec_scc.pressure = (temperature_pressure[1] * ureg.atm).to('N/m**2')
|
|
1201
|
+
moments = section.get('moments')
|
|
1202
|
+
if moments is not None:
|
|
1203
|
+
sec_thermochem.x_gaussian_moments = moments.to('kg*m**2').magnitude
|
|
1204
|
+
if section.get('zero_point_energy') is not None:
|
|
1205
|
+
sec_scc.energy.zero_point = EnergyEntry(
|
|
1206
|
+
value=section.get('zero_point_energy')
|
|
1207
|
+
)
|
|
1208
|
+
if section.get('thermal_correction_enthalpy') is not None:
|
|
1209
|
+
sec_thermo.enthalpy = section.get('thermal_correction_enthalpy')
|
|
1210
|
+
keys = [
|
|
1211
|
+
'zero_point_energy',
|
|
1212
|
+
'thermal_correction_energy',
|
|
1213
|
+
'thermal_correction_enthalpy',
|
|
1214
|
+
'thermal_correction_free_energy',
|
|
1215
|
+
]
|
|
1216
|
+
for key in keys:
|
|
1217
|
+
val = section.get(key)
|
|
1218
|
+
if val is not None:
|
|
1219
|
+
setattr(
|
|
1220
|
+
sec_thermochem, 'x_gaussian_%s' % key, val.to('joule').magnitude
|
|
1221
|
+
)
|
|
1222
|
+
|
|
1223
|
+
# scf_iteration
|
|
1224
|
+
for iteration in section.get('scf_iteration', []):
|
|
1225
|
+
sec_scf_iteration = ScfIteration()
|
|
1226
|
+
sec_scc.scf_iteration.append(sec_scf_iteration)
|
|
1227
|
+
energy = iteration.get('energy_total_scf_iteration')
|
|
1228
|
+
sec_scf_energy = Energy()
|
|
1229
|
+
sec_scf_iteration.energy = sec_scf_energy
|
|
1230
|
+
if energy is not None:
|
|
1231
|
+
sec_scf_energy.total = EnergyEntry(value=energy)
|
|
1232
|
+
energy = iteration.get('x_gaussian_delta_energy_total_scf_iteration')
|
|
1233
|
+
if energy is not None:
|
|
1234
|
+
sec_scf_energy.change = energy
|
|
1235
|
+
|
|
1236
|
+
iteration = section.get('scf_iteration_final')
|
|
1237
|
+
if iteration is not None:
|
|
1238
|
+
if sec_scc.scf_iteration:
|
|
1239
|
+
sec_scf_iteration = sec_scc.scf_iteration[-1]
|
|
1240
|
+
else:
|
|
1241
|
+
sec_scf_iteration = ScfIteration()
|
|
1242
|
+
sec_scc.scf_iteration.append(sec_scf_iteration)
|
|
1243
|
+
sec_scf_energy = Energy()
|
|
1244
|
+
sec_scf_iteration.energy = sec_scf_energy
|
|
1245
|
+
keys = [
|
|
1246
|
+
'x_gaussian_single_configuration_calculation_converged',
|
|
1247
|
+
'x_gaussian_hf_detect',
|
|
1248
|
+
'energy_total',
|
|
1249
|
+
'x_gaussian_energy_error',
|
|
1250
|
+
'energy_kinetic_electronic',
|
|
1251
|
+
'spin_S2',
|
|
1252
|
+
'x_gaussian_after_annihilation_spin_S2',
|
|
1253
|
+
'x_gaussian_perturbation_energy',
|
|
1254
|
+
]
|
|
1255
|
+
for key in keys:
|
|
1256
|
+
val = iteration.get(key)
|
|
1257
|
+
if val is not None:
|
|
1258
|
+
if key.startswith('energy_'):
|
|
1259
|
+
sec_scf_energy.m_add_sub_section(
|
|
1260
|
+
getattr(Energy, key.replace('energy_', '')),
|
|
1261
|
+
EnergyEntry(value=val),
|
|
1262
|
+
)
|
|
1263
|
+
else:
|
|
1264
|
+
setattr(sec_scf_iteration, key, val)
|
|
1265
|
+
if (
|
|
1266
|
+
iteration.get('x_gaussian_single_configuration_calculation_converged')
|
|
1267
|
+
is not None
|
|
1268
|
+
):
|
|
1269
|
+
energy_scf = iteration.get('energy_total')
|
|
1270
|
+
electronic_ke = iteration.get(' energy_kinetic_electronic')
|
|
1271
|
+
if energy_scf is not None and electronic_ke is not None:
|
|
1272
|
+
sec_scf_energy.electrostatic = EnergyEntry(
|
|
1273
|
+
value=energy_scf - electronic_ke
|
|
1274
|
+
)
|
|
1275
|
+
if energy_scf is not None:
|
|
1276
|
+
sec_energy.total = EnergyEntry(value=energy_scf)
|
|
1277
|
+
sec_scc.calculation_converged = True
|
|
1278
|
+
|
|
1279
|
+
return sec_scc
|
|
1280
|
+
|
|
1281
|
+
def parse_system(self, n_run, section):
|
|
1282
|
+
sec_run = self.archive.run[-1]
|
|
1283
|
+
sec_system = System()
|
|
1284
|
+
sec_run.system.append(sec_system)
|
|
1285
|
+
sec_atoms = Atoms()
|
|
1286
|
+
sec_system.atoms = sec_atoms
|
|
1287
|
+
lattice_vector = self.out_parser.get('run')[n_run].get('lattice_vector')
|
|
1288
|
+
if lattice_vector is not None:
|
|
1289
|
+
sec_atoms.lattice_vectors = lattice_vector * ureg.angstrom
|
|
1290
|
+
pbc = [len(lattice_vector) >= n for n in [1, 2, 3]]
|
|
1291
|
+
sec_atoms.periodic = [pbc]
|
|
1292
|
+
else:
|
|
1293
|
+
sec_atoms.lattice_vectors = np.zeros((3, 3))
|
|
1294
|
+
sec_atoms.periodic = [False] * 3
|
|
1295
|
+
|
|
1296
|
+
orientation = section.get('standard_orientation')
|
|
1297
|
+
if orientation is None:
|
|
1298
|
+
orientation = section.get('input_orientation')
|
|
1299
|
+
if orientation is None:
|
|
1300
|
+
orientation = section.get('z_matrix_orientation')
|
|
1301
|
+
if orientation is not None:
|
|
1302
|
+
sec_atoms.labels = [
|
|
1303
|
+
ase.data.chemical_symbols[int(n)] for n in [o[1] for o in orientation]
|
|
1304
|
+
]
|
|
1305
|
+
sec_atoms.positions = [o[-3:] for o in orientation] * ureg.angstrom
|
|
1306
|
+
sec_system.x_gaussian_number_of_atoms = len(sec_system.atoms.labels)
|
|
1307
|
+
|
|
1308
|
+
return sec_system
|
|
1309
|
+
|
|
1310
|
+
def parse_configurations(self, n_run):
|
|
1311
|
+
systems = self.out_parser.get('run')[n_run].get('system', [])
|
|
1312
|
+
for system in systems:
|
|
1313
|
+
sec_system = self.parse_system(n_run, system)
|
|
1314
|
+
for calculation in system.get('calculation', [system]):
|
|
1315
|
+
sec_scc = self.parse_scc(calculation)
|
|
1316
|
+
if sec_scc is not None:
|
|
1317
|
+
if sec_system is not None:
|
|
1318
|
+
sec_scc.system_ref = sec_system
|
|
1319
|
+
sec_method = self.archive.run[-1].method
|
|
1320
|
+
if sec_method:
|
|
1321
|
+
sec_scc.method_ref = sec_method[-1]
|
|
1322
|
+
|
|
1323
|
+
iterations = self.out_parser.get('run')[n_run].get('iteration', [])
|
|
1324
|
+
sec_system = self.archive.run[0].system
|
|
1325
|
+
sec_method = self.archive.run[0].method
|
|
1326
|
+
for iteration in iterations:
|
|
1327
|
+
sec_scc = self.parse_scc(iteration)
|
|
1328
|
+
if sec_scc is not None:
|
|
1329
|
+
if sec_system:
|
|
1330
|
+
sec_scc.system_ref = sec_system[-1]
|
|
1331
|
+
if sec_method:
|
|
1332
|
+
sec_scc.method_ref = sec_method[-1]
|
|
1333
|
+
|
|
1334
|
+
def parse_method(self, n_run):
|
|
1335
|
+
sec_run = self.archive.run[-1]
|
|
1336
|
+
sec_method = Method()
|
|
1337
|
+
sec_run.method.append(sec_method)
|
|
1338
|
+
run = self.out_parser.get('run')[n_run]
|
|
1339
|
+
|
|
1340
|
+
for key in ['x_gaussian_settings_corrected']:
|
|
1341
|
+
val = run.get(key)
|
|
1342
|
+
if val is None:
|
|
1343
|
+
continue
|
|
1344
|
+
setattr(sec_method, key, val)
|
|
1345
|
+
|
|
1346
|
+
def resolve_method(parameter):
|
|
1347
|
+
def get_method(name):
|
|
1348
|
+
method = self._method_map.get(parameter, None)
|
|
1349
|
+
if method is not None:
|
|
1350
|
+
return parameter
|
|
1351
|
+
|
|
1352
|
+
xc = resolve_xc_functional(parameter)
|
|
1353
|
+
return 'DFT' if xc is not None else None
|
|
1354
|
+
|
|
1355
|
+
method = get_method(parameter)
|
|
1356
|
+
if method is None:
|
|
1357
|
+
# TODO This is inefficient. Adapted from old parser
|
|
1358
|
+
for n in range(9, 1, -1):
|
|
1359
|
+
method = get_method(parameter[0:n])
|
|
1360
|
+
if method is not None:
|
|
1361
|
+
break
|
|
1362
|
+
|
|
1363
|
+
return method
|
|
1364
|
+
|
|
1365
|
+
def resolve_prefix(name):
|
|
1366
|
+
name = name.split('=')[0].strip()
|
|
1367
|
+
prefix = ''
|
|
1368
|
+
if name not in ['RHF', 'ROHF', 'UHF', 'UFF']:
|
|
1369
|
+
res = re.match(r'([RU]{1}O?)(.*)', name)
|
|
1370
|
+
if res is not None:
|
|
1371
|
+
prefix = res[1] if res[1] else ''
|
|
1372
|
+
name = res[2]
|
|
1373
|
+
return prefix, name
|
|
1374
|
+
|
|
1375
|
+
def resolve_basis_set(parameter: str) -> tuple[str, str]:
|
|
1376
|
+
"""This function has 2 responsibilities:
|
|
1377
|
+
1. discern `parameter` from other input settings.
|
|
1378
|
+
2. verify that `parameter` is a valid basis set name."""
|
|
1379
|
+
basis_set = self._basis_set_map.get(parameter.upper(), None)
|
|
1380
|
+
if basis_set is not None:
|
|
1381
|
+
return (parameter, basis_set[0]['name'])
|
|
1382
|
+
|
|
1383
|
+
# handle modular extensions
|
|
1384
|
+
res = self._basis_set_pattern.match(parameter)
|
|
1385
|
+
if res is not None:
|
|
1386
|
+
basis_keys = [key for key in res.groups() if key is not None]
|
|
1387
|
+
if len(basis_keys) != 1:
|
|
1388
|
+
self.logger.warning(
|
|
1389
|
+
'Cannot resolve basis set', data=dict(key=parameter)
|
|
1390
|
+
)
|
|
1391
|
+
return (basis_keys[0], parameter)
|
|
1392
|
+
# TODO: make this piggy-bank off basis_set_map
|
|
1393
|
+
|
|
1394
|
+
# in case the setting was not recognized
|
|
1395
|
+
return ('', '')
|
|
1396
|
+
|
|
1397
|
+
def resolve_xc_functional(parameter):
|
|
1398
|
+
xc_functional = self._xc_functional_map.get(parameter, None)
|
|
1399
|
+
if xc_functional is not None:
|
|
1400
|
+
return parameter
|
|
1401
|
+
|
|
1402
|
+
part = parameter.split('-')[0]
|
|
1403
|
+
xc_functional = self._xc_functional_map.get(part)
|
|
1404
|
+
if xc_functional is not None:
|
|
1405
|
+
return part
|
|
1406
|
+
|
|
1407
|
+
res = self._xc_functional_pattern.match(parameter)
|
|
1408
|
+
if res is not None:
|
|
1409
|
+
xc_keys = [key for key in res.groups() if key is not None]
|
|
1410
|
+
if len(xc_keys) != 2:
|
|
1411
|
+
self.logger.warning(
|
|
1412
|
+
'Cannot resolve xc functional', data=dict(key=name)
|
|
1413
|
+
)
|
|
1414
|
+
return
|
|
1415
|
+
|
|
1416
|
+
x_name = (
|
|
1417
|
+
'LC-'
|
|
1418
|
+
if xc_keys[0] == 'LC-'
|
|
1419
|
+
else self._xc_functional_map.get(xc_keys[0], [{}])[0].get(
|
|
1420
|
+
'name', ''
|
|
1421
|
+
)
|
|
1422
|
+
)
|
|
1423
|
+
c_index = -1 if xc_keys[0] == 'LC-' else 0
|
|
1424
|
+
c_name = self._xc_functional_map.get(xc_keys[1], [{}])[c_index].get(
|
|
1425
|
+
'name', ''
|
|
1426
|
+
)
|
|
1427
|
+
|
|
1428
|
+
if x_name and c_name:
|
|
1429
|
+
return '%s%s' % (x_name, c_name)
|
|
1430
|
+
|
|
1431
|
+
settings = run.get('x_gaussian_settings_corrected', '').upper()
|
|
1432
|
+
settings = re.sub(r'(?:#[Pp]? |# *)', '', settings)
|
|
1433
|
+
xc_functionals = set()
|
|
1434
|
+
basis_sets = set()
|
|
1435
|
+
methods = set()
|
|
1436
|
+
prefix = ''
|
|
1437
|
+
for setting in settings.split():
|
|
1438
|
+
parameter = setting.split('/')
|
|
1439
|
+
prefix, name = resolve_prefix(parameter[0])
|
|
1440
|
+
|
|
1441
|
+
method = resolve_method(name)
|
|
1442
|
+
if method is not None:
|
|
1443
|
+
methods.add(method)
|
|
1444
|
+
|
|
1445
|
+
xc_functional = resolve_xc_functional(name)
|
|
1446
|
+
if xc_functional is not None:
|
|
1447
|
+
xc_functionals.add(xc_functional)
|
|
1448
|
+
|
|
1449
|
+
basis_set_parameter = parameter[0] if not parameter[1:] else parameter[1]
|
|
1450
|
+
# ! invert logic
|
|
1451
|
+
basis_set = resolve_basis_set(basis_set_parameter.strip())
|
|
1452
|
+
if basis_set[1]: # only index 1 is later on used
|
|
1453
|
+
basis_sets.add(basis_set)
|
|
1454
|
+
if len(basis_sets) == 0:
|
|
1455
|
+
basis_sets.add(resolve_basis_set('STO-3G'))
|
|
1456
|
+
|
|
1457
|
+
sec_dft = DFT()
|
|
1458
|
+
sec_method.dft = sec_dft
|
|
1459
|
+
sec_electronic = Electronic()
|
|
1460
|
+
sec_method.electronic = sec_electronic
|
|
1461
|
+
if len(methods) != 1:
|
|
1462
|
+
self.logger.error(
|
|
1463
|
+
'Found mutiple or no method', data=dict(n_parsed=len(methods))
|
|
1464
|
+
)
|
|
1465
|
+
for method in methods:
|
|
1466
|
+
sec_method.x_gaussian_method = method
|
|
1467
|
+
sec_electronic.method = method
|
|
1468
|
+
for entry in self._method_map.get(method, []):
|
|
1469
|
+
sec_elstruc_method = x_gaussian_section_elstruc_method()
|
|
1470
|
+
sec_method.x_gaussian_section_elstruc_method.append(sec_elstruc_method)
|
|
1471
|
+
sec_elstruc_method.x_gaussian_electronic_structure_method = '%s%s' % (
|
|
1472
|
+
prefix,
|
|
1473
|
+
entry['name'],
|
|
1474
|
+
)
|
|
1475
|
+
|
|
1476
|
+
# Basis set
|
|
1477
|
+
for basis_set in basis_sets:
|
|
1478
|
+
bs = BasisSet(
|
|
1479
|
+
type='gaussians',
|
|
1480
|
+
scope=['full-electron'],
|
|
1481
|
+
)
|
|
1482
|
+
bs.atom_centered.append(BasisSetAtomCentered(name=basis_set[1]))
|
|
1483
|
+
# ? what does it mean to have multiple basis sets
|
|
1484
|
+
sec_method.electrons_representation = [
|
|
1485
|
+
BasisSetContainer(
|
|
1486
|
+
type='atom-centered orbitals',
|
|
1487
|
+
scope=['wavefunction'],
|
|
1488
|
+
basis_set=[bs],
|
|
1489
|
+
)
|
|
1490
|
+
]
|
|
1491
|
+
|
|
1492
|
+
if len(xc_functionals) != 1:
|
|
1493
|
+
self.logger.error(
|
|
1494
|
+
'Found multiple or no xc functional',
|
|
1495
|
+
data=dict(n_parsed=len(xc_functionals)),
|
|
1496
|
+
)
|
|
1497
|
+
sec_xc_functional = XCFunctional()
|
|
1498
|
+
sec_dft.xc_functional = sec_xc_functional
|
|
1499
|
+
for xc_functional in xc_functionals:
|
|
1500
|
+
sec_method.x_gaussian_xc = xc_functional
|
|
1501
|
+
for entry in self._xc_functional_map.get(xc_functional, []):
|
|
1502
|
+
if '_X_' in entry['name'] or entry['name'].endswith('_X'):
|
|
1503
|
+
sec_xc_functional.exchange.append(Functional(name=entry['name']))
|
|
1504
|
+
elif '_C_' in entry['name'] or entry['name'].endswith('_C'):
|
|
1505
|
+
sec_xc_functional.correlation.append(Functional(name=entry['name']))
|
|
1506
|
+
elif 'HYB' in entry['name'] or entry['name'].endswith('_C'):
|
|
1507
|
+
sec_xc_functional.hybrid.append(Functional(name=entry['name']))
|
|
1508
|
+
else:
|
|
1509
|
+
sec_xc_functional.contributions.append(
|
|
1510
|
+
Functional(name=entry['name'])
|
|
1511
|
+
)
|
|
1512
|
+
|
|
1513
|
+
for key in ['charge', 'spin_target']:
|
|
1514
|
+
val = self.out_parser.get('run')[n_run].get(key)
|
|
1515
|
+
if val is not None:
|
|
1516
|
+
setattr(sec_electronic, key, val)
|
|
1517
|
+
|
|
1518
|
+
def init_parser(self, filepath, logger):
|
|
1519
|
+
self.out_parser.mainfile = filepath
|
|
1520
|
+
self.out_parser.logger = logger
|
|
1521
|
+
|
|
1522
|
+
def parse(self, filepath, archive, logger):
|
|
1523
|
+
self.filepath = filepath
|
|
1524
|
+
self.archive = archive
|
|
1525
|
+
self.logger = logging.getLogger(__name__) if logger is None else logger
|
|
1526
|
+
self.init_parser(filepath, logger)
|
|
1527
|
+
|
|
1528
|
+
runs = self.out_parser.get('run', [])
|
|
1529
|
+
for n in range(len(runs)):
|
|
1530
|
+
program = self.out_parser.get('program')
|
|
1531
|
+
sec_run = Run()
|
|
1532
|
+
self.archive.run.append(sec_run)
|
|
1533
|
+
sec_run.program = Program(name='Gaussian', version=program[0])
|
|
1534
|
+
sec_run.x_gaussian_program_implementation = program[1]
|
|
1535
|
+
sec_run.x_gaussian_program_release_date = program[2]
|
|
1536
|
+
sec_run.x_gaussian_program_execution_date = program[3]
|
|
1537
|
+
|
|
1538
|
+
for key in [
|
|
1539
|
+
'x_gaussian_chk_file',
|
|
1540
|
+
'x_gaussian_memory',
|
|
1541
|
+
'x_gaussian_number_of_processors',
|
|
1542
|
+
]:
|
|
1543
|
+
val = self.out_parser.get(key)
|
|
1544
|
+
if val is not None:
|
|
1545
|
+
setattr(sec_run, key, val)
|
|
1546
|
+
|
|
1547
|
+
self.parse_method(n)
|
|
1548
|
+
|
|
1549
|
+
self.parse_configurations(n)
|
|
1550
|
+
|
|
1551
|
+
sec_times = x_gaussian_section_times()
|
|
1552
|
+
sec_run.x_gaussian_section_times.append(sec_times)
|
|
1553
|
+
for key in ['program_cpu_time', 'program_termination_date']:
|
|
1554
|
+
val = runs[n].get(key)
|
|
1555
|
+
if val is not None:
|
|
1556
|
+
setattr(sec_times, 'x_gaussian_%s' % key, val.strip())
|