When I submit an optimization procedure through QCFractal using geomeTRIC and TeraChem, I encounter the following KeyError.
File "/home/heepark/github/geomeTRIC/geometric/engine.py", line 1863, in calc_new
energy = ret["properties"]["return_energy"]
KeyError: 'return_energy'
import numpy as np
from geometric.molecule import Molecule as geoM
from qcelemental.models import Molecule as qcel
from qcfractal.snowflake import FractalSnowflake
from geometric.nifty import bohr2ang
M = geoM('HCN.xyz')
s = FractalSnowflake()
client = s.client()
sp_spec = {
'program':"terachem",
'driver':"gradient",
'method':"hf",
'basis':"3-21g",
}
opt_spec = {
'program':'geometric',
'qc_specification':sp_spec,
}
elmol = qcel(symbols=M.elem, geometry=np.array(M.xyzs) / bohr2ang, molecular_charge = 0, molecular_multiplicity = 1)
_, ids = client.add_optimizations(elmol, **opt_spec)
s.await_results()
rec = client.get_optimizations(ids)[0]
print(rec.stdout)
print(rec.error)
Expected behavior
Adding a line in terachem.py fixes the problem for me, but tests are failing because the output.json from QCEngineRecords does not have return_energy in its properties.
Additional context
If what I did here is not a good idea, I can modify geomeTRIC's engine.py to make it work instead. Thank you!
Describe the bug
When I submit an optimization procedure through QCFractal using geomeTRIC and TeraChem, I encounter the following KeyError.
Line 1863 of
engine.py
To Reproduce
Expected behavior
Adding a line in
terachem.py
fixes the problem for me, but tests are failing because the output.json fromQCEngineRecords
does not havereturn_energy
in its properties.Additional context
If what I did here is not a good idea, I can modify geomeTRIC's
engine.py
to make it work instead. Thank you!