Skip to content

Commit

Permalink
use findif for ccsd(t) conv gradients most of time (#2943)
Browse files Browse the repository at this point in the history
* use findif for ccsd(t) conv gradients most of time

* try alt docs env

* so far

* new stdsuite

* finalize gen instructuions
  • Loading branch information
loriab committed May 8, 2023
1 parent 78ba1c2 commit 5b0daac
Show file tree
Hide file tree
Showing 20 changed files with 145 additions and 116 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/docs-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ jobs:
conda list
which conda python cmake $CXX
- name: Patch Sphinx for Pybind11
if: ${{ github.repository == 'psi4/psi4' }}
run: sed -i "s/app\.add_autodoc_attrgetter/# app.add_autodoc_attrgetter/g" ${CONDA_PREFIX}/lib/python3.10/site-packages/sphinx_automodapi/autodoc_enhancements.py
# This patch and the jinja2<3 restriction were needed as recently as March 2023, but when I try a py311 env with newest everything, both can be released.
#- name: Patch Sphinx for Pybind11
# if: ${{ github.repository == 'psi4/psi4' }}
# run: sed -i "s/app\.add_autodoc_attrgetter/# app.add_autodoc_attrgetter/g" ${CONDA_PREFIX}/lib/python3.10/site-packages/sphinx_automodapi/autodoc_enhancements.py

# docs are not Ninja ready
- name: Configure with CMake (Conda Gnu + MKL)
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ jobs:
conda list
which conda python cmake $CXX
- name: Patch Sphinx for Pybind11
if: ${{ github.repository == 'psi4/psi4' }}
run: sed -i "s/app\.add_autodoc_attrgetter/# app.add_autodoc_attrgetter/g" ${CONDA_PREFIX}/lib/python3.10/site-packages/sphinx_automodapi/autodoc_enhancements.py
# This patch and the jinja2<3 restriction were needed as recently as March 2023, but when I try a py311 env with newest everything, both can be released.
#- name: Patch Sphinx for Pybind11
# if: ${{ github.repository == 'psi4/psi4' }}
# run: sed -i "s/app\.add_autodoc_attrgetter/# app.add_autodoc_attrgetter/g" ${CONDA_PREFIX}/lib/python3.10/site-packages/sphinx_automodapi/autodoc_enhancements.py

# docs are not Ninja ready
- name: Configure with CMake (Conda Gnu + MKL)
Expand Down
13 changes: 7 additions & 6 deletions devtools/conda-envs/docs-cf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@ name: test
channels:
- conda-forge
dependencies:
- blas=*=mkl
- libblas=*=*mkl
- mkl-devel
- intel-openmp!=2019.5
# build
- cmake
- doxygen
- gxx_linux-64
- cxx-compiler
# core
- eigen
- networkx
- pybind11
- python=3.10.*
- python=3.11.*
# qc
- psi4/label/dev::gau2grid
- gau2grid
- psi4/label/dev::libint2
- psi4/label/dev::libxc
- libxc-c
- psi4/label/dev::libecpint
- optking
- qcengine
Expand All @@ -30,6 +31,6 @@ dependencies:
- sphinx-autodoc-typehints
- sphinx-automodapi
- psi4/label/dev::sphinx-psi-theme
- jinja2<3.0
- jinja2
- autodoc-pydantic

1 change: 1 addition & 0 deletions doc/sphinxman/document_capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ def extract_modules(winnowed):
("cisd", None): (", ci\ *n*", "Arbitrary-order *n* through DETCI is inefficient byproduct of CI", ["fnocc"]),
("zapt2", None): (", zapt\ *n*", "Arbitrary-order *n* through DETCI is inefficient byproduct of CI", None),
("mp4", None): (", mp\ *n*", "Arbitrary-order *n* through DETCI is inefficient byproduct of CI", ["fnocc"]),
("ccsd(t)", "CCENERGY"): ("FN", "Analytic gradients for conventional all-electron RHF/UHF computations can be requested through |globals__qc_module|\ ``=ccenergy``, but their scaling is best suited to small molecules.", None),
}


Expand Down
6 changes: 3 additions & 3 deletions doc/sphinxman/source/cc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ be seen at :ref:`other modules <table:managedmethods>`.
+ +------------+-----------+-----------+---------------+-----------+
| | ROHF | Y | Y | Y | --- |
+------------------+------------+-----------+-----------+---------------+-----------+
| CCSD(T) | RHF | Y | Y | n/a | n/a |
| CCSD(T) | RHF | Y | Y [#e10]_ | n/a | n/a |
+ +------------+-----------+-----------+---------------+-----------+
| | UHF | Y | Y | n/a | n/a |
| | UHF | Y | Y [#e10]_ | n/a | n/a |
+ +------------+-----------+-----------+---------------+-----------+
| | ROHF | Y | --- | n/a | n/a |
+------------------+------------+-----------+-----------+---------------+-----------+
| A-CCSD(T) [#e10]_| RHF | Y | --- | n/a | n/a |
| A-CCSD(T) [#e11]_| RHF | Y | --- | n/a | n/a |
+------------------+------------+-----------+-----------+---------------+-----------+
| CC3 | RHF | Y | --- | Y | --- |
+ +------------+-----------+-----------+---------------+-----------+
Expand Down
7 changes: 4 additions & 3 deletions doc/sphinxman/source/preview_capabilities_ccenergy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
+--------------------------+-------------------------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| ccsd | |globals__cc_type| | ✓̳ ✓̳ | ✓̳ | ✓̳ ✓̳ | ✓̳ | ✓̳ ✓̳ | ✓̳ |
+--------------------------+-------------------------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| ccsd(t) | |globals__cc_type| | ✓̳ ✓̳ | ✓̳ | ✓̳ ✓̳ | ✓̳ | ✓̳ ✓̳ | |
| ccsd(t)\ [#e10]_ | |globals__cc_type| | ✓̳ ✓̳ | | ✓̳ ✓̳ | | ✓̳ ✓̳ | |
+--------------------------+-------------------------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| a-ccsd(t)\ [#e10]_ | |globals__cc_type| | ✓̳ ✓̳ | | | | | |
| a-ccsd(t)\ [#e11]_ | |globals__cc_type| | ✓̳ ✓̳ | | | | | |
+--------------------------+-------------------------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| bccd(t) | |globals__cc_type| | ✓̳ ✓̳ | | ✓̳ ✓̳ | | ✓̳ ✓̳ | |
+--------------------------+-------------------------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
Expand All @@ -34,4 +34,5 @@
.. [#e1] Algorithm type selection keyword below. Values to the right: conventional ``CV``, density-fitted ``DF``, and Cholesky-decomposed ``CD``.
.. [#e2] Active orbital values to the right: all-electron ``A`` and frozen-core ``F``.
.. [#e3] Finite difference gradients are not marked explicitly by "∷", but the capability can be gleaned from the energy availability.
.. [#e10] a-CCSD(T) also known as CCSD(aT), Lambda-CCSD(T), and CCSD(T)_L
.. [#e10] Analytic gradients for conventional all-electron RHF/UHF computations can be requested through |globals__qc_module|\ ``=ccenergy``, but their scaling is best suited to small molecules.
.. [#e11] a-CCSD(T) also known as CCSD(aT), Lambda-CCSD(T), and CCSD(T)_L
13 changes: 7 additions & 6 deletions doc/sphinxman/source/preview_capabilities_details.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@
| | MRCC | ✓ ✓ | | ✓ ✓ | | ✓ ✓ | |
| | OCC | ✓ ✓ ✓ ✓ | ✓̲ ✓̲ | ✓̲ ✓̲ ✓̲ ✓̲ | ✓̲ ✓̲ | | |
+--------------------------+--------------------------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| ccsd(t) | .. _dd_ccsd_prt_pr: | ✓̳ ✓̳ ✓ ✓ ✓ ✓ | ̳ ∷̳ ✓ ✓ ∷ ∷ | ✓̳ ✓̳ | ̳ ∷̳ | ✓̳ ✓̳ | ∷̳ ∷̳ |
| |globals__cc_type| | CCENERGY | ✓̳ ✓̳ | ✓̳ | ✓̳ ✓̳ | ✓̳ | ✓̳ ✓̳ | |
| ccsd(t) | .. _dd_ccsd_prt_pr: | ✓̳ ✓̳ ✓ ✓ ✓ ✓ | ̳ ∷̳ ✓ ✓ ∷ ∷ | ✓̳ ✓̳ | ̳ ∷̳ | ✓̳ ✓̳ | ∷̳ ∷̳ |
| |globals__cc_type| | CCENERGY\ [#d12]_ | ✓̳ ✓̳ | | ✓̳ ✓̳ | | ✓̳ ✓̳ | |
| | FNOCC | ✓ ✓ ✓̲ ✓̲ ✓̲ ✓̲ | | | | | |
| | MRCC | ✓ ✓ | | ✓ ✓ | | ✓ ✓ | |
| | OCC | ✓ ✓ ✓ ✓ | ✓̲ ✓̲ | | | | |
+--------------------------+--------------------------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| a-ccsd(t)\ [#d12]_ | .. _dd_accsd_prt_pr: | ✓̳ ✓̳ ✓ ✓ ✓ ✓ | | | | | |
| a-ccsd(t)\ [#d13]_ | .. _dd_accsd_prt_pr: | ✓̳ ✓̳ ✓ ✓ ✓ ✓ | | | | | |
| |globals__cc_type| | CCENERGY | ✓̳ ✓̳ | | | | | |
| | MRCC | ✓ ✓ | | ✓ ✓ | | ✓ ✓ | |
| | OCC | ✓̲ ✓̲ ✓̲ ✓̲ | | | | | |
Expand Down Expand Up @@ -138,7 +138,7 @@
| wb97x, LRC DFT | .. _dd_wb97x: | ✓ ✓̳ | ✓ ✓̳ | ✓ ✓̳ | ✓ ✓̳ | | |
| |globals__scf_type| | SCF | ✓̲ ✓̳ | ✓̲ ✓̳ | ✓̲ ✓̳ | ✓̲ ✓̳ | | |
+--------------------------+--------------------------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| b2plyp, DH DFT\ [#d13]_ | .. _dd_b2plyp: | ✓ ✓ ✓̳ ✓̳ ✓ ✓ | | ✓ ✓ ✓̳ ✓̳ ✓ ✓ | | | |
| b2plyp, DH DFT\ [#d14]_ | .. _dd_b2plyp: | ✓ ✓ ✓̳ ✓̳ ✓ ✓ | | ✓ ✓ ✓̳ ✓̳ ✓ ✓ | | | |
| |globals__scf_type| | SCF | ✓̲ ✓̲ ✓̳ ✓̳ ✓̲ ✓̲ | | ✓̲ ✓̲ ✓̳ ✓̳ ✓̲ ✓̲ | | | |
+--------------------------+--------------------------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

Expand All @@ -147,5 +147,6 @@
.. [#d3] Finite difference gradients are only marked explicitly by "∷" for overall (not per-method) lines and when at least one case has analytic gradients implemented, but the capability can be gleaned from the energy availability.
.. [#d10] Also available for DFT references RKS/UKS
.. [#d11] Arbitrary-order *n* through DETCI is inefficient byproduct of CI
.. [#d12] a-CCSD(T) also known as CCSD(aT), Lambda-CCSD(T), and CCSD(T)_L
.. [#d13] DH-DFT only available with DF-MP2
.. [#d12] Analytic gradients for conventional all-electron RHF/UHF computations can be requested through |globals__qc_module|\ ``=ccenergy``, but their scaling is best suited to small molecules.
.. [#d13] a-CCSD(T) also known as CCSD(aT), Lambda-CCSD(T), and CCSD(T)_L
.. [#d14] DH-DFT only available with DF-MP2
2 changes: 1 addition & 1 deletion doc/sphinxman/source/preview_capabilities_summary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
+--------------------------+----------------------+--------------------------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| ccsd | .. _ss_ccsd: | |globals__cc_type| | ✓̳ ✓̳ ✓ ✓ ✓ ✓ | ✓̳ ∷̳ ✓ ✓ ∷ ∷ | ✓̳ ✓̳ ✓ ✓ ✓ ✓ | ✓̳ ∷̳ ✓ ✓ ∷ ∷ | ✓̳ ✓̳ | ✓̳ ∷̳ |
+--------------------------+----------------------+--------------------------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| ccsd(t) | .. _ss_ccsd_prt_pr: | |globals__cc_type| | ✓̳ ✓̳ ✓ ✓ ✓ ✓ | ̳ ∷̳ ✓ ✓ ∷ ∷ | ✓̳ ✓̳ | ̳ ∷̳ | ✓̳ ✓̳ | ∷̳ ∷̳ |
| ccsd(t) | .. _ss_ccsd_prt_pr: | |globals__cc_type| | ✓̳ ✓̳ ✓ ✓ ✓ ✓ | ̳ ∷̳ ✓ ✓ ∷ ∷ | ✓̳ ✓̳ | ̳ ∷̳ | ✓̳ ✓̳ | ∷̳ ∷̳ |
+--------------------------+----------------------+--------------------------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| a-ccsd(t)\ [#s11]_ | .. _ss_accsd_prt_pr: | |globals__cc_type| | ✓̳ ✓̳ ✓ ✓ ✓ ✓ | | | | | |
+--------------------------+----------------------+--------------------------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
Expand Down
11 changes: 8 additions & 3 deletions psi4/driver/aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,23 @@ def sherrill_gold_standard(**kwargs) -> CBSMetadata:
scf = {
'wfn': 'hf',
'basis': kwargs.pop('scf_basis', 'aug-cc-pVQZ'),
'scheme': kwargs.pop('scf_scheme', 'xtpl_highest_1')
'scheme': kwargs.pop('scf_scheme', 'xtpl_highest_1'),
'options': kwargs.pop('scf_options', {}),
}
corl = {
'wfn': kwargs.pop('corl_wfn', 'mp2'),
'basis': kwargs.pop('corl_basis', 'aug-cc-pV[TQ]Z'),
'scheme': kwargs.pop('corl_scheme', 'corl_xtpl_helgaker_2')
'scheme': kwargs.pop('corl_scheme', 'corl_xtpl_helgaker_2'),
'options': kwargs.pop('corl_options', {}),
'options_lo': kwargs.pop('corl_options_lo', {}),
}
delta = {
'wfn': kwargs.pop('delta_wfn', 'ccsd(t)'),
'wfn_lesser': kwargs.pop('delta_wfn_lesser', 'mp2'),
'basis': kwargs.pop('delta_basis', 'aug-cc-pVTZ'),
'scheme': kwargs.pop('delta_scheme', 'xtpl_highest_1')
'scheme': kwargs.pop('delta_scheme', 'xtpl_highest_1'),
'options': kwargs.pop('delta_options', {}),
'options_lo': kwargs.pop('delta_options_lo', {}),
}

return [scf, corl, delta]
Expand Down
2 changes: 2 additions & 0 deletions psi4/driver/driver_cbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,8 @@ def _validate_cbs_inputs(cbs_metadata: CBSMetadata, molecule: Union["qcdb.Molecu
stage. All validation takes place here.
"""

# TODO: split options into mixable (qc_module=ccenergy/"") or non-mixable (freeze_core=true/false)

metadata = []
for iitem, item in enumerate(cbs_metadata):
# 1a) all items must have wfn
Expand Down
4 changes: 2 additions & 2 deletions psi4/driver/procrouting/proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1001,14 +1001,14 @@ def select_ccsd_t__gradient(name, **kwargs):
func = None
if reference in ['RHF']:
if mtd_type == 'CONV':
if module in ['', 'CCENERGY']:
if module in ['CCENERGY']: # FORMERLY ""
func = run_ccenergy_gradient
elif mtd_type == 'DF':
if module in ['', 'OCC']:
func = run_dfocc_gradient
elif reference == 'UHF':
if mtd_type == 'CONV':
if module in ['', 'CCENERGY']:
if module in ['CCENERGY']: # FORMERLY ""
func = run_ccenergy_gradient
elif mtd_type == 'DF':
if module in ['OCC']: # SOON "",
Expand Down
7 changes: 5 additions & 2 deletions psi4/share/psi4/scripts/merge_stdsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@
# * Thus, this script is largely unnecessary and piecemeal.
# * if you're working locally, run pytest, merge the record files with `cat`, and run `document_capabilities` on the result.
# * but if you're running the full standard suite to update the repo, this script is a handy intermediary or has the pieces to run separately.
# * don't have mrcc available
# * comment out the lines in test_standard_suite.py with "# SEMI-DISABLE". These are temp disabled (mostly for
# non-scaling) and conflict with the test_<mtd>_<driver>_default entries in the resulting tables.
# * (objdir) pytest -v ../tests/pytests/test_standard_suite.py -n auto -m "not noci"
# * (objdir) python ../psi4/share/psi4/scripts/merge_stdsuite.py
# * (objdir) mv stdsuite_psi4.txt ../samples/
# * # restore the 8 "fci" lines to the file
# * # restore the 8 "fci" and 22 "mrcc" lines to the file
# * (objdir) cmake --build . -j<N> --target sphinxman
# * (objdir) diff ../doc/sphinxman/source/preview_* # check if any unanticipated changes to the preview tables
# * rationalization for redundancy of test_standard_suite, stdsuite_psi4.txt, and preview_capabilities_*rst tables all in repository
Expand All @@ -45,7 +48,7 @@
contents = fp.readlines()
stuffs = [ast.literal_eval(ln) for ln in contents]
stuffs = [dict(t) for t in {tuple(d.items()) for d in stuffs}] # thanks, https://stackoverflow.com/a/9427216
stuffs.sort(key=operator.itemgetter("method", "driver", "reference", "fcae", "scf_type", "corl_type", "module", "status", "note", "sdsc"))
stuffs.sort(key=operator.itemgetter("method", "driver", "reference", "fcae", "scf_type", "corl_type", "module", "status", "sdsc", "note"))

# write out single file with sorted lines of dicts
with open("stdsuite_psi4.txt", "w") as fp:
Expand Down

0 comments on commit 5b0daac

Please sign in to comment.