Skip to content

Commit ad73779

Browse files
authored
fix reading SQM minimization output (#288)
Before, only single-point calculation output is supported.
1 parent 26e4bcc commit ad73779

File tree

3 files changed

+794
-1
lines changed

3 files changed

+794
-1
lines changed

dpdata/amber/sqm.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,18 @@ def parse_sqm_out(fname):
2525
for line in f:
2626
if line.startswith(" Total SCF energy"):
2727
energy = float(line.strip().split()[-2])
28-
energies.append(energy)
28+
energies = [energy]
2929
elif line.startswith(" Atom Element Mulliken Charge"):
3030
flag = READ_CHARGE
31+
charges = []
3132
elif line.startswith(" Total Mulliken Charge"):
3233
flag = START
3334
elif line.startswith(" Final Structure"):
3435
flag = READ_COORDS_START
36+
coords = []
3537
elif line.startswith("QMMM: Forces on QM atoms"):
3638
flag = READ_FORCES
39+
forces = []
3740
elif flag == READ_CHARGE:
3841
ls = line.strip().split()
3942
atom_symbols.append(ls[-2])
@@ -46,6 +49,9 @@ def parse_sqm_out(fname):
4649
flag = START
4750
elif flag == READ_FORCES:
4851
ll = line.strip()
52+
if not ll.startswith("QMMM: Atm "):
53+
flag = START
54+
continue
4955
forces.append([float(ll[-60:-40]), float(ll[-40:-20]), float(ll[-20:])])
5056
if len(forces) == len(charges):
5157
flag = START

0 commit comments

Comments
 (0)