Skip to content

Commit

Permalink
squash
Browse files Browse the repository at this point in the history
  • Loading branch information
donerancl committed Jan 31, 2024
1 parent b53f63b commit 481fcbd
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions arkane/ess/gaussian.py
Expand Up @@ -35,7 +35,7 @@
import logging
import math
import os.path

import re
import numpy as np

import rmgpy.constants as constants
Expand Down Expand Up @@ -309,9 +309,8 @@ def load_energy(self, zpe_scale_factor=1.):
with open(self.path, 'r') as f:
line = f.readline()
while line != '':

if 'SCF Done:' in line:
e_elect = float(line.split()[4]) * constants.E_h * constants.Na
e_elect = float(re.findall(r"SCF Done: E\(.+\) \=\s+[^\s]+",line)[0].split()[-1])* constants.E_h * constants.Na
elect_energy_source = 'SCF'
elif ' E2(' in line and ' E(' in line:
e_elect = float(line.split()[-1].replace('D', 'E')) * constants.E_h * constants.Na
Expand Down Expand Up @@ -351,7 +350,7 @@ def load_energy(self, zpe_scale_factor=1.):
# G4MP2 calculation without opt and freq calculation
# Keyword in Gaussian G4MP2(SP), No zero-point or thermal energies are included.
e_elect = float(line.split()[2]) * constants.E_h * constants.Na

# Read the ZPE from the "E(ZPE)=" line, as this is the scaled version.
# Gaussian defines the following as
# E (0 K) = Elec + E(ZPE),
Expand All @@ -376,6 +375,12 @@ def load_energy(self, zpe_scale_factor=1.):
elect_energy_source = 'HF'
except ValueError:
pass
elif 'Energy=' in line:
# for xtb
e_elect = float(line.split()[1]) * constants.E_h * constants.Na
elif 'Energy=' in line:
# for xtb
e_elect = float(line.split()[1]) * constants.E_h * constants.Na
# Read the next line in the file
line = f.readline()

Expand Down

0 comments on commit 481fcbd

Please sign in to comment.