Skip to content

Commit 2b276e3

Browse files
authored
Merge pull request #2816 from shihchengli/fix_f12_energy
Fix CCSD(T)-F12 energy parsing
2 parents 0de0159 + 928bbec commit 2b276e3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

arkane/ess/molpro.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ def load_energy(self, zpe_scale_factor=1.):
336336
f12b = True # MRCI could also have a v(4+)z basis, so don't break yet
337337
elif 'ccsd' in line.lower() and 'f12' in line.lower():
338338
f12 = True
339+
f12a_section, f12b_section = False, False
339340
elif 'mrci' in line.lower():
340341
mrci = True
341342
f12a, f12b = False, False
@@ -350,11 +351,15 @@ def load_energy(self, zpe_scale_factor=1.):
350351
# Search for e_elect
351352
for line in lines:
352353
if f12 and f12a:
353-
if ('CCSD(T)-F12a' in line or 'CCSD(T)-F12/' in line and '!' not in line) and 'energy' in line:
354+
if 'F12a energy' in line:
355+
f12a_section, f12b_section = True, False
356+
if 'CCSD(T)-F12' in line and 'energy' in line and f12a_section:
354357
e_elect = float(line.split()[-1])
355358
break
356359
elif f12 and f12b:
357-
if 'CCSD(T)-F12b' in line and 'energy' in line:
360+
if 'F12b energy' in line:
361+
f12a_section, f12b_section = False, True
362+
if 'CCSD(T)-F12' in line and 'energy' in line and f12b_section:
358363
e_elect = float(line.split()[-1])
359364
break
360365
elif mrci:

test/arkane/ess/molproTest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def test_load_rad_from_molpro_log_f12(self):
110110

111111
log = MolproLog(os.path.join(self.data_path, "C5OH5_CCSD(T)_F12.out"))
112112
e0 = log.load_energy()
113-
assert round(abs(e0 / constants.Na / constants.E_h - -268.317057640597), 5) == 0
113+
assert round(abs(e0 / constants.Na / constants.E_h - -268.336320614452), 5) == 0
114114

115115
def test_load_hosi_from_molpro_log(self):
116116
"""

0 commit comments

Comments
 (0)