Skip to content

Commit

Permalink
Parsing energies from gen_scfman module in Qchem 5 (materialsproject#818
Browse files Browse the repository at this point in the history
)

* .eggs/ added

* energy parser for gen_scfman module

* energy parsing added for the gen_scfman module in qchem 5
  • Loading branch information
wood-b authored and shyuep committed Aug 31, 2017
1 parent 0411f02 commit d00a30f
Show file tree
Hide file tree
Showing 4 changed files with 3,139 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ setuptools*
.ipynb_checkpoints
.cache
.tox

.eggs/
gulptmp_4_1
.coverage
12 changes: 10 additions & 2 deletions pymatgen/io/qchem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1612,6 +1612,7 @@ def _parse_job(cls, output):
homo_lumo = []
bsse = None
hiershfiled_pop = False
gen_scfman = False
for line in output.split("\n"):
for ep, message in error_defs:
if ep.search(line):
Expand Down Expand Up @@ -1653,6 +1654,11 @@ def _parse_job(cls, output):
if "SCF time: CPU" in line:
parse_scf_iter = False
continue
if 'Convergence criterion met' in line and gen_scfman:
scf_successful = True
name = "GEN_SCFMAN"
energy = Energy(float(line.split()[1]), "Ha").to("eV")
energies.append(tuple([name, energy]))
if 'Convergence criterion met' in line:
scf_successful = True
m = scf_iter_pattern.search(line)
Expand Down Expand Up @@ -1832,11 +1838,11 @@ def _parse_job(cls, output):
name = None
energy = None
m = scf_energy_pattern.search(line)
if m:
if m and not gen_scfman:
name = "SCF"
energy = Energy(m.group("energy"), "Ha").to("eV")
m = corr_energy_pattern.search(line)
if m and m.group("name") != "SCF":
if m and m.group("name") != "SCF" and not gen_scfman:
name = m.group("name")
energy = Energy(m.group("energy"), "Ha").to("eV")
m = detailed_charge_pattern.search(line)
Expand All @@ -1860,6 +1866,8 @@ def _parse_job(cls, output):
pop_method = "nbo"
parse_nbo_charge = True
charges[pop_method] = []
if "GEN_SCFMAN: A general SCF calculation manager " in line:
gen_scfman = True
if "N A T U R A L B O N D O R B I T A L A N A L Y S I S" in line:
nbo_available = True
if name and energy:
Expand Down
13 changes: 12 additions & 1 deletion pymatgen/io/tests/test_qchem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1744,7 +1744,18 @@ def test_energy(self):
"hf_xygjos.qcout": {
"SCF": -2724.0769973875713,
"XYGJ-OS": -2726.3447230967517
}
},
"hf_wb97xd_gen_scfman.qcout": {
"GEN_SCFMAN": -30051.134375112342,
"GEN_SCFMAN": -30051.296918174274,
"GEN_SCFMAN": -30051.395763612905,
"GEN_SCFMAN": -30051.458839496852,
"GEN_SCFMAN": -30051.487970700582,
"GEN_SCFMAN": -30051.490764186092,
"GEN_SCFMAN": -30051.491278372443,
"GEN_SCFMAN": -30051.491359704556,
"GEN_SCFMAN": -30051.491369799976
}
}'''
ref_energies = json.loads(ref_energies_text)
parsed_energies = dict()
Expand Down
Loading

0 comments on commit d00a30f

Please sign in to comment.