Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GAMESS and calculated nuclear repulsion energy differ #276

Open
eljost opened this issue Oct 12, 2020 · 0 comments
Open

GAMESS and calculated nuclear repulsion energy differ #276

eljost opened this issue Oct 12, 2020 · 0 comments

Comments

@eljost
Copy link
Contributor

eljost commented Oct 12, 2020

Describe the bug
The nuclear repulsion energy (NRE) obtained by GAMESS and QCElemental differ by a subtle amount in the present test case (H2O2). Updating the GAMESS NRE with the QCElemental NRE in the harvester fails, even though both energies differ only by ~ 5.0e-10 Hartree.

The failing line:

outqcvar["NUCLEAR REPULSION ENERGY"] = outMol.nuclear_repulsion_energy()

To Reproduce

from pprint import pprint

import qcelemental as qcel
import qcengine as qcng

molecule = qcel.models.Molecule.from_file("molecule.json")
inp = {
    "molecule": molecule,
    "driver": "gradient",
    "model": {
        "method": "hf",
        "basis": "accd",
    },
    "keywords": {
        "contrl__ispher": 1,
    },
}
result = qcng.compute(inp, program="gamess", return_dict=True)
pprint(result["error"])

The molecule.json file is given below:

{"schema_name": "qcschema_molecule", "schema_version": 2, "validated": true, "symbols": ["H", "H", "O", "O"], "geometry": [-0.67536264, -4.586972, 0.03533376, -1.05022487, 0.59869986, 2.40963753, -1.34934182, -2.68059739, 0.03533376, -0.37926563, -1.30873884, 2.41148478], "name": "H2O2", "molecular_charge": 0.0, "molecular_multiplicity": 1, "fix_com": false, "fix_orientation": false, "provenance": {"creator": "QCElemental", "version": "v0.15.1", "routine": "qcelemental.molparse.from_schema"}}

Expected behavior
Checking up to 11 decimal places is probably too harsh, at least in this case. A possible fix would be to replace the line shown above with

qcel_nre = outMol.nuclear_repulsion_energy()
outqcvar.__setitem__("NUCLEAR REPULSION ENERGY", qcel_nre, accept_places=6)

which would only check up to 6 decimal places I guess. But it looks somehow ugly and directly calls a dunder-method...

Additional context
Occurs with Python 3.8.5 and recent versions of QCElemental and -Engine (v.0.17 in both cases).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant