Skip to content

Commit

Permalink
add PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jthorton committed Apr 15, 2024
1 parent f8ccf65 commit c2d4489
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
19 changes: 7 additions & 12 deletions qcengine/programs/aimnet2.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,26 +94,21 @@ def compute(self, input_data: "AtomicInput", config: "TaskConfig"):
"return_energy": out["energy"].item() * ureg.conversion_factor("eV", "hartree"),
"return_gradient": (
-1.0 * out["forces"][0].detach().numpy() * ureg.conversion_factor("eV / angstrom", "hartree / bohr")
)
.ravel()
.tolist(),
),
"calcinfo_natom": len(input_data.molecule.atomic_numbers),
},
"extras": input_data.extras.copy(),
}
# update with calculated extras
ret_data["extras"].update(
{
"charges": out["charges"].detach()[0].cpu().numpy(),
"charges_std": out["charges_std"].detach()[0].cpu().numpy(),
"energy_std": out["energy_std"].item(),
"forces_std": out["forces_std"].detach()[0].cpu().numpy(),
}
)
ret_data["extras"]["aimnet2"] = {
"charges": out["charges"].detach()[0].cpu().numpy(),
"ensemble_charges_std": out["charges_std"].detach()[0].cpu().numpy(),
"ensemble_energy_std": out["energy_std"].item(),
"ensemble_forces_std": out["forces_std"].detach()[0].cpu().numpy(),
}
if input_data.driver == "energy":
ret_data["return_result"] = ret_data["properties"]["return_energy"]
elif input_data.driver == "gradient":
# assume the output is eV/bohr
ret_data["return_result"] = ret_data["properties"]["return_gradient"]
else:
raise InputError(
Expand Down
2 changes: 1 addition & 1 deletion qcengine/tests/test_harness_canonical.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
("gamess", {"method": "hf", "basis": "n31"}, {"basis__NGAUSS": 6}),
("mctc-gcp", {"method": "dft/sv"}, {}),
("mace", {"method": "small"}, {}),
("aimnet2", {"method": "b973c"}, {})
("aimnet2", {"method": "b973c"}, {}),
# add as programs available
# ("terachem", {"method": "bad"}),
]
Expand Down

0 comments on commit c2d4489

Please sign in to comment.