Skip to content

Commit

Permalink
fixed preopt bug for setup hessian
Browse files Browse the repository at this point in the history
  • Loading branch information
MFSJMenger committed Oct 17, 2024
1 parent eff2ed8 commit 27190b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions qforce/qm/qm.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ def Calculation(self, filename, required_files, *, folder=None, software=None):
def setup_hessian_calculation(self, folder, coords, atnums, preopt=False):
"""Setup hessian calculation"""
if preopt is True:
software = self.softwares['software']
else:
software = self.softwares['preopt']
else:
software = self.softwares['software']

calculation = self.Calculation(self.hessian_name(software),
software.read.hessian_files,
Expand Down
15 changes: 10 additions & 5 deletions qforce/qm/xtb.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,14 +871,19 @@ def _read_xtb_charge_mult(out_file):
next(fh)
next(fh)
break
#
for line in fh:
if line.strip() == '':
break
if 'charge' in line:
charge = int(line.split()[-1])
if 'spin' in line:
spin = float(line.split()[-1])
mult = round(2.0*spin)+1
if 'program call' in line:
words = line.split()
for i, word in enumerate(words):
if word == '--chrg':
charge = int(words[i+1])
if word == '--uhf':
spin = int(words[i+1])
mult = round(2.0*spin)+1
break

if charge is None:
raise ValueError("Could not find charge in xtb file")
Expand Down

0 comments on commit 27190b5

Please sign in to comment.