Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into orca
Browse files Browse the repository at this point in the history
* upstream/master:
  Qchem: SCF-> Total energy in the final basis set for correctly catching -D, etc.
  Qchem: PR comments
  Testing: Finishes up using conversion on several straglers
  Testing: Applies new using strategy to all files
  Testing: New using strategy
  Psi4: Fixes issue with HF3c execution
  PR comments
  PR comments: parse logfile for fields not available in QCSCR also, fix dipole parsing
  nwc: add hessian file; minor testing updates (#177)
  PR comments: use qcel's NUMBER regex also, blacken and isort
  fix test until next qcel version
  PR comments: added ability to ingest logfile+QCSCR
  Blacken QCEngine
  PR comments: rename input, refactor NUMBER into regex snippet file
  Update QCENGINE_RECORDS_COMMIT
  Update QCENGINE_RECORDS_COMMIT
  Qchem: add tests for log parser for archival data
  Qchem: add log parser for archival data
  • Loading branch information
muammar committed Dec 9, 2019
2 parents e9ff4a6 + 9f5fba2 commit 1e96ea0
Show file tree
Hide file tree
Showing 39 changed files with 994 additions and 420 deletions.
13 changes: 7 additions & 6 deletions qcengine/compute.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
"""
Integrates the computes together
"""
from typing import Any, Dict, Optional, Union, TYPE_CHECKING
from typing import TYPE_CHECKING, Any, Dict, Optional, Union

if TYPE_CHECKING:
from pydantic.main import BaseModel
from qcelemental.models import AtomicResult

from qcelemental.models import AtomicInput, FailedOperation, AtomicResult
from qcelemental.models import AtomicInput, AtomicResult, FailedOperation

from .config import get_config
from .exceptions import InputError, RandomError
from .procedures import get_procedure
from .programs import get_program
from .util import compute_wrapper, environ_context, handle_output_metadata, model_wrapper

if TYPE_CHECKING:
from pydantic.main import BaseModel
from qcelemental.models import AtomicResult


__all__ = ["compute", "compute_procedure"]


Expand Down
1 change: 0 additions & 1 deletion qcengine/mdi_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from typing import Any, Dict, List, Optional

import numpy as np

import qcelemental as qcel
from qcelemental.util import which_import

Expand Down
2 changes: 1 addition & 1 deletion qcengine/programs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from .mopac import MopacHarness
from .mp2d import MP2DHarness
from .nwchem import NWChemHarness
from .openmm import OpenMMHarness
from .orca import OrcaHarness
from .openmm import OpenMMHarness
from .psi4 import Psi4Harness
from .qchem import QChemHarness
from .rdkit import RDKitHarness
Expand Down
4 changes: 2 additions & 2 deletions qcengine/programs/cfour/harvester.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from decimal import Decimal

import numpy as np

import qcelemental as qcel
from qcelemental.models import Molecule
from qcelemental.molparse import regex

from ..util import PreservingDict, load_hessian

Expand Down Expand Up @@ -63,7 +63,7 @@ def harvest_outfile_pass(outtext):
# vcc/ecc

# fmt: off
NUMBER = "((?:[-+]?\\d*\\.\\d+(?:[DdEe][-+]?\\d+)?)|(?:[-+]?\\d+\\.\\d*(?:[DdEe][-+]?\\d+)?))"
NUMBER = r'(?x:' + regex.NUMBER + ')'

# Process version
mobj = re.search(r'^\s*' + r'Version' + r'\s+' + r'(?P<version>[\w.]+)' + r'\s*$',
Expand Down
1 change: 0 additions & 1 deletion qcengine/programs/cfour/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from typing import Any, Dict, Optional, Tuple

import numpy as np

import qcelemental as qcel
from qcelemental.models import AtomicResult, Provenance
from qcelemental.util import safe_version, which
Expand Down
1 change: 0 additions & 1 deletion qcengine/programs/dftd3.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from typing import Any, Dict, Optional, Tuple

import numpy as np

import qcelemental as qcel
from qcelemental.models import AtomicResult, FailedOperation, Provenance
from qcelemental.util import safe_version, which
Expand Down
10 changes: 5 additions & 5 deletions qcengine/programs/entos.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@

import json
import string
from typing import Any, Dict, List, Optional, Set, Tuple, TYPE_CHECKING

if TYPE_CHECKING:
from ..config import TaskConfig
from qcelemental.models import AtomicInput
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Tuple

from qcelemental.models import AtomicResult
from qcelemental.util import parse_version, safe_version, which
Expand All @@ -17,6 +13,10 @@
from ..util import execute, popen
from .model import ProgramHarness

if TYPE_CHECKING:
from ..config import TaskConfig
from qcelemental.models import AtomicInput


class EntosHarness(ProgramHarness):
_defaults: Dict[str, Any] = {
Expand Down
4 changes: 2 additions & 2 deletions qcengine/programs/gamess/harvester.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from decimal import Decimal

import numpy as np

import qcelemental as qcel
from qcelemental.models import Molecule
from qcelemental.molparse import regex

from ..util import PreservingDict

Expand Down Expand Up @@ -71,7 +71,7 @@ def harvest_outfile_pass(outtext):
qcvar_coord = None
qcvar_grad = None

NUMBER = "((?:[-+]?\\d*\\.\\d+(?:[DdEe][-+]?\\d+)?)|(?:[-+]?\\d+\\.\\d*(?:[DdEe][-+]?\\d+)?))"
NUMBER = r"(?x:" + regex.NUMBER + ")"

# If calculation fail to converge
mobj = re.search(r"^\s+" + r"(?:GAMESS TERMINATED ABNORMALLY)" + r"\s*$", outtext, re.MULTILINE)
Expand Down
18 changes: 10 additions & 8 deletions qcengine/programs/gamess/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,20 +169,22 @@ def parse_output(self, outfiles: Dict[str, str], input_model: "AtomicInput") ->
"TWO-ELECTRON ENERGY": "scf_two_electron_energy",
"SCF TOTAL ENERGY": "scf_total_energy",
"MP2 CORRELATION ENERGY": "mp2_correlation_energy",
'MP2 TOTAL ENERGY': "mp2_total_energy",
"MP2 TOTAL ENERGY": "mp2_total_energy",
"CCSD CORRELATION ENERGY": "ccsd_correlation_energy",
"CCSD TOTAL ENERGY": "ccsd_total_energy",
"CCSD(T) CORRELATION ENERGY": "ccsd_prt_pr_correlation_energy",
"CCSD(T) TOTAL ENERGY": "ccsd_prt_pr_total_energy"
"CCSD(T) TOTAL ENERGY": "ccsd_prt_pr_total_energy",
}
for qcvar in qcvars:
if qcvar in qcvars_to_properties:
output_data['properties'][qcvars_to_properties[qcvar]] = qcvars[qcvar]
if {'SCF DIPOLE X', 'SCF DIPOLE Y', 'SCF DIPOLE Z'} & set(qcvars.keys()):
conv = Decimal(qcel.constants.conversion_factor('debye', 'e * bohr'))
output_data['properties']['scf_dipole_moment'] = [qcvars['SCF DIPOLE X'] * conv,
qcvars['SCF DIPOLE Y'] * conv,
qcvars['SCF DIPOLE Z'] * conv]
output_data["properties"][qcvars_to_properties[qcvar]] = qcvars[qcvar]
if {"SCF DIPOLE X", "SCF DIPOLE Y", "SCF DIPOLE Z"} & set(qcvars.keys()):
conv = Decimal(qcel.constants.conversion_factor("debye", "e * bohr"))
output_data["properties"]["scf_dipole_moment"] = [
qcvars["SCF DIPOLE X"] * conv,
qcvars["SCF DIPOLE Y"] * conv,
qcvars["SCF DIPOLE Z"] * conv,
]
output_data["success"] = True

return AtomicResult(**{**input_model.dict(), **output_data})
1 change: 0 additions & 1 deletion qcengine/programs/mp2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from typing import Any, Dict, Optional, Tuple

import numpy as np

import qcelemental as qcel
from qcelemental.models import AtomicResult, Provenance
from qcelemental.util import safe_version, which
Expand Down
105 changes: 92 additions & 13 deletions qcengine/programs/nwchem/germinate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,89 @@
from qcengine.exceptions import InputError

# List of XC functionals known to NWChem
_xc_functionals = ['acm', 'b3lyp', 'beckehandh', 'pbe0', 'becke97', 'becke97-1', 'becke97-2', 'becke97-3', 'becke97-d',
'becke98', 'hcth', 'hcth120', 'hcth147', 'hcth407', 'becke97gga1', 'hcth407p', 'mpw91', 'mpw1k',
'xft97', 'cft97', 'ft97', 'op', 'bop', 'pbeop', 'xpkzb99', 'cpkzb99', 'xtpss03', 'ctpss03',
'xctpssh', 'b1b95', 'bb1k', 'mpw1b95', 'mpwb1k', 'pw6b95', 'pwb6k', 'm05', 'm05-2x', 'vs98', 'm06',
'm06-hf', 'm06-L', 'm06-2x', 'HFexch', 'becke88', 'xperdew91', 'xpbe96', 'gill96', 'lyp', 'perdew81',
'perdew86', 'perdew91', 'cpbe96', 'pw91lda', 'slater', 'vwn_1', 'vwn_2', 'vwn_3', 'vwn_4', 'vwn_5',
'vwn_1_rpa', 'xtpss03', 'ctpss03', 'bc95', 'xpw6b95', 'xpwb6k', 'xm05', 'xm05-2x', 'cpw6b95',
'cpwb6k', 'cm05', 'cm05-2x', 'xvs98', 'cvs98', 'xm06-L', 'xm06-hf', 'xm06', 'xm06-2x', 'cm06-L',
'cm06-hf', 'cm06', 'cm06-2x']
_xc_functionals = [
"acm",
"b3lyp",
"beckehandh",
"pbe0",
"becke97",
"becke97-1",
"becke97-2",
"becke97-3",
"becke97-d",
"becke98",
"hcth",
"hcth120",
"hcth147",
"hcth407",
"becke97gga1",
"hcth407p",
"mpw91",
"mpw1k",
"xft97",
"cft97",
"ft97",
"op",
"bop",
"pbeop",
"xpkzb99",
"cpkzb99",
"xtpss03",
"ctpss03",
"xctpssh",
"b1b95",
"bb1k",
"mpw1b95",
"mpwb1k",
"pw6b95",
"pwb6k",
"m05",
"m05-2x",
"vs98",
"m06",
"m06-hf",
"m06-L",
"m06-2x",
"HFexch",
"becke88",
"xperdew91",
"xpbe96",
"gill96",
"lyp",
"perdew81",
"perdew86",
"perdew91",
"cpbe96",
"pw91lda",
"slater",
"vwn_1",
"vwn_2",
"vwn_3",
"vwn_4",
"vwn_5",
"vwn_1_rpa",
"xtpss03",
"ctpss03",
"bc95",
"xpw6b95",
"xpwb6k",
"xm05",
"xm05-2x",
"cpw6b95",
"cpwb6k",
"cm05",
"cm05-2x",
"xvs98",
"cvs98",
"xm06-L",
"xm06-hf",
"xm06",
"xm06-2x",
"cm06-L",
"cm06-hf",
"cm06",
"cm06-2x",
]


def muster_modelchem(method: str, derint: int, use_tce: bool) -> Tuple[str, Dict[str, Any]]:
Expand Down Expand Up @@ -88,12 +162,17 @@ def muster_modelchem(method: str, derint: int, use_tce: bool) -> Tuple[str, Dict
else:
mdccmd = f"task ccsd(t) {runtyp}\n\n"

elif method in ['sodft', 'direct_mp2', 'rimp2', 'mcscf', 'selci', 'md', 'pspw', 'band']:
raise InputError(f"Method \"{method}\" not yet supported by QCEngine")
elif method == "tddft":
mdccmd = f"task tddft {runtyp}\n\n"

elif method in ["sodft", "direct_mp2", "rimp2", "mcscf", "selci", "md", "pspw", "band"]:
raise InputError(f'Method "{method}" not yet supported by QCEngine')

elif method == "tce":
raise InputError(f"Do not specify TCE as a method. Instead specify the desired method "
f"and \"qc_module=True\" in the run configuration")
raise InputError(
f"Do not specify TCE as a method. Instead specify the desired method "
f'as a keyword and "qc_module=True".'
)

elif method in _xc_functionals:
opts["dft__xc"] = method
Expand Down
Loading

0 comments on commit 1e96ea0

Please sign in to comment.