Skip to content

Commit

Permalink
cfour basis fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
loriab committed Jan 14, 2025
1 parent 3a01eb2 commit f4d7022
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Enhancements
++++++++++++
- (:pr:`463`) Maint - Pin to QCElemental <0.70 since we now know QCSchema v2 release schedule.
- (:pr:`463`) MACE - New v0.3.9 release yields a pytorch error, so recommend pymace=0.3.6 .
- (:pr:`464`, :issue:`447`) CFOUR - Allow CC-PVDZ alias basis specification. Also fix the PwCVXZ
basis keyword. @philipmnel

Bug Fixes
+++++++++
Expand Down
14 changes: 14 additions & 0 deletions qcengine/programs/cfour/keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ def format_keyword(keyword: str, val: Any) -> Tuple[str, str]:
]:
text = str(val.lower())

# Transform the basis sets that *must* be mixedcase

# * manual: (keyword is cc-pVXZ or PVXZ, where X = D, T, Q, 5, and 6, respectively)
elif keyword in ["CFOUR_BASIS", "BASIS"] and val.upper() in [
"CC-PVDZ", "CC-PVTZ", "CC-PVQZ", "CC-PV5Z", "CC-PV6Z",
]:
text = val[:4].lower() + val[4:].upper()

# manual: (keyword is PwCVXZ, where X = D, T, and Q, respectively)
elif keyword in ["CFOUR_BASIS", "BASIS"] and val.upper() in [
"PWCVDZ", "PWCVTZ", "PWCVQZ"
]:
text = "Pw" + val[3:].upper()

# Transform the methods that *must* be mixed case
elif keyword in ["CFOUR_CALC_LEVEL", "CALC_LEVEL"] and val.upper() == "CCSDT-1B":
text = "CCSDT-1b"
Expand Down
4 changes: 4 additions & 0 deletions qcengine/programs/tests/test_standard_suite_hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def nh2():
@pytest.mark.parametrize(
"program,basis,keywords",
[
pytest.param("cfour", "cC-pvdZ", {"scf_conv": 12}, marks=using("cfour")), # test basis handling, not results
pytest.param("cfour", "aug-pvdz", {"scf_conv": 12}, marks=using("cfour")),
pytest.param("cfour", "aug-pvdz", {}, marks=using("cfour")),
pytest.param(
Expand Down Expand Up @@ -66,6 +67,9 @@ def test_sp_hf_rhf(program, basis, keywords, h2o):
assert "provenance" in res
assert res["success"] is True

if basis == "cC-pvdZ":
return

# aug-cc-pvdz
scf_tot = -76.0413815332

Expand Down

0 comments on commit f4d7022

Please sign in to comment.