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

Orca Harness. #178

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6b26a41
Small advances to Orca Harness.
muammar Nov 22, 2019
2657c79
Merge branch 'master' into orca
muammar Dec 3, 2019
97c63cc
Cleaned up print statements and output file is parsed by cclib.
muammar Dec 4, 2019
e6c00c2
General improvements.
muammar Dec 5, 2019
ca4f623
Cleaning up print statement and addition of more properties.
muammar Dec 5, 2019
bd28893
Removed commented files.
muammar Dec 5, 2019
d257a35
Gradient is returned as result.
muammar Dec 9, 2019
e9ff4a6
Current energy added to gradient extras.
muammar Dec 9, 2019
1e96ea0
Merge remote-tracking branch 'upstream/master' into orca
muammar Dec 9, 2019
006afb8
General improvements
muammar Dec 10, 2019
5620a66
Fixed gradient dimensionality.
muammar Dec 10, 2019
4a125bc
Merge branch 'master' into orca
muammar Dec 11, 2019
9dfc4e6
Merge branch 'master' into orca
muammar Dec 18, 2019
ec3702e
Remove unneeded code.
muammar Jan 9, 2020
d668346
Merge branch 'master' into orca
muammar Jan 9, 2020
426c36a
General improvements:
muammar Jan 9, 2020
2624581
Pyflakes clean.
muammar Jan 9, 2020
0e3d699
Bohr by default.
muammar Jan 9, 2020
21ae056
General improvements following reviews.
muammar Jan 10, 2020
c74b32d
More changes based on review.
muammar Jan 16, 2020
adba913
Merge remote-tracking branch 'origin/master' into orca
muammar Jan 16, 2020
d160f3d
First steps to post-HF methods.
muammar Jan 17, 2020
e192143
Remove print.
muammar Jan 17, 2020
d505c4b
Merge branch 'master' into orca
muammar Feb 7, 2020
892b502
Added Orca canonical example.
muammar Feb 7, 2020
2b69b56
Registered orca in testing module.
muammar Feb 7, 2020
2958358
Merge branch 'master' into orca
muammar Mar 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More changes based on review.
  • Loading branch information
muammar committed Jan 16, 2020
commit c74b32d9c6dcb3b3e9d137bb1801289839face7c
46 changes: 20 additions & 26 deletions qcengine/programs/orca.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
from typing import Any, Dict, List, Optional, Set, Tuple

from qcelemental.constants import conversion_factor
import qcelemental
from qcelemental.util import parse_version, which
from qcelemental.models import AtomicResult

Expand Down Expand Up @@ -64,26 +64,24 @@ def found(self, raise_error: bool = False) -> bool:
# TODO Consider changing this to use molpro --version instead of performing a full execute
def get_version(self) -> str:
self.found(raise_error=True)
which_prog = which("orca")
if which_prog not in self.version_cache:
success, output = execute(
[which_prog, "version.inp", "-d", ".", "-W", "."],
infiles={"version.inp": ""},
outfiles=["version.out"]
)

_output = output["stdout"].split()

for index, line in enumerate(_output):
if "Version" in line:
found = True
if found:
version = _output[index + 1]
break
Comment on lines +73 to +80
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this block be indented so that it only runs after success, output = execute(?


# name_space = {"molpro_uri": "http:https://www.molpro.net/schema/molpro-output"}
# which_prog = which("molpro")
# if which_prog not in self.version_cache:
# success, output = execute(
# [which_prog, "version.inp", "-d", ".", "-W", "."],
# infiles={"version.inp": ""},
# outfiles=["version.out", "version.xml"],
# )

# if success:
# tree = ET.ElementTree(ET.fromstring(output["outfiles"]["version.xml"]))
# root = tree.getroot()
# version_tree = root.find("molpro_uri:job/molpro_uri:platform/molpro_uri:version", name_space)
# year = version_tree.attrib["major"]
# minor = version_tree.attrib["minor"]
# molpro_version = year + "." + minor
# self.version_cache[which_prog] = safe_version(molpro_version)

return "4.2.1"
return version

def compute(self, input_data: "AtomicInput", config: "JobConfig") -> "AtomicResult":
"""
Expand Down Expand Up @@ -182,11 +180,7 @@ def build_input(
energy_call.append(f"{{{input_model.model.method}}}")
muammar marked this conversation as resolved.
Show resolved Hide resolved


elif input_model.model.method.upper() in self._dft_functionals: # DFT case
input_file.append("! SP {} {}".format(input_model.model.method, input_model.model.basis))
input_file.append(xyz_block)

elif input_model.model.method.upper() in self._hf_methods: # HF case
elif input_model.model.method.upper() in self._dft_functionals or self._hf_methods: # DFT case
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is going to catch self._hf_methods

>>> aa = [1, 2, 3, 4]
>>> bb = [5, 6, 7, 8]
>>> 2 in aa or bb
True
>>> 7 in aa or bb
[5, 6, 7, 8]

input_file.append("! SP {} {}".format(input_model.model.method, input_model.model.basis))
muammar marked this conversation as resolved.
Show resolved Hide resolved
input_file.append(xyz_block)

Expand Down Expand Up @@ -239,7 +233,7 @@ def parse_output(self, outfiles: Dict[str, str], input_model: "AtomicInput") ->

properties = {}
extras = {}
extras["ev_to_hartrees"] = conversion_factor("ev", "hartree")
extras["ev_to_hartrees"] = qcelemental.constants.conversion_factor("eV", "hartree")

# Process basis set data
properties["calcinfo_nbasis"] = data.nbasis
Expand Down