Permalink
Browse files

disp: patch up some dispersion docs

  • Loading branch information...
loriab committed Aug 27, 2018
1 parent 3e3d894 commit d158d13d223daa2fd943427e659f6572954d1af1
@@ -402,3 +402,20 @@ Bibliography
.. [Martinez-Araya:2015:451]
Jorge Ignacio Mart\ |i_acute|\ nez-Araya
*J. Math. Chem.* **53**, 451 (2015).
.. [Hujo:2011:3866]
W. Hujo and S. Grimme
*J. Chem. Theory Comput.* **7** 3866 (2011).
.. [Chai:2010:6615]
J. Chai and M. Head-Gordon
*Phys. Chem. Chem. Phys.* **10** 6615 (2008).
.. [Pernal:2009:263201]
K. Pernal, R. Podeszwa, K. Patkowski, K. Szalewicz
*Phys. Rev. Lett.* **103** 263201 (2009).
.. [Podeszwa:2010:550]
R. Podeszwa, K. Pernal, K. Patkowski, K. Szalewicz
*J. Phys. Chem. Lett.* **1** 550 (2010).
@@ -365,7 +365,7 @@ Note that if you are running an unrestricted computation, you should set the
set reference uks
energy('b3lyp')
The functional may also be manually specified by calling ``energy`` (or any other keyword)
The functional may also be manually specified by calling ``energy`` (or any driver function)
with a ``dft_functional`` argument::
energy('scf', dft_functional = 'b3lyp')
@@ -377,7 +377,7 @@ argument::
energy('scf', dft_functional = custom_functional)
For further details about this so called `dict_func` syntax, see
:ref: Advanced Functional Use and Manipulation.
:ref:`sec:dftdictbuilder`.
For hybrid functionals, the fraction of exact exchange is controlled by the
|scf__dft_alpha| option. For the LRC functionals, the fraction of long-range
@@ -724,28 +724,83 @@ The "best-practice" input file for KS-DFT is::
energy('b3lyp')
.. _`sec:dftdictbuilder`:
Advanced Functional Use and Manipulation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New DFT functionals can be created from scratch from within the input
file and accessed using the ``dft_functional`` keyword argument in the
energy call::
Using the ``dft_functional`` keyword argument in the energy procedure call, one is able to use the orbitals generated by DFT for correlated wavefunction methods::
# DFT Custom Functional
molecule h2o {
0 1
O
H 1 1.0
H 1 1.0 2 104.5
}
set {
basis sto-3g
dft_spherical_points 302
dft_radial_points 99
reference rks
}
pbe0 = {
"name": "my_PBE0",
"x_functionals": {"GGA_X_PBE": {"alpha": 0.75}},
"x_hf": {"alpha": 0.25},
"c_functionals": {"GGA_C_PBE": {}}
}
func_call = energy('SCF', dft_functional=pbe0)
# as PBE0 is a pre-defined functional, the call above is equivalent to both below:
func_call = energy('SCF', dft_functional="PBE0")
func_call = energy('PBE0')
Supported keywords include:
- `name`: string, name of the functional. for custom defined functionals used for printing only.
- `xc_functionals`: dict, definition of a complete (X + C) functional based in LibXC name
- `x_functionals`: dict, definition of exchange functionals using LibXC names
- `c_functionals`: dict, definition of correlation functionals using LibXC names
- `x_hf`: dict, parameters dealing with exact (HF) exchange settings for hybrid DFT
- `c_mp2`: dict, parameters dealing with MP2 correlation for double hybrid DFT
- `dispersion`: dict, definition of dispersion corrections
- `citation`: string, citation for the method, for printing purposes
- `description`: string, description of the method, for printing purposes
The full interface is defined in
:source:`psi4/driver/procrouting/dft_funcs/dict_builder.py`. All
standard functionals provided in |PSIfour| are implemented in the
``dict_*_funcs.py`` files in the same folder.
.. literalinclude:: @SFNX_INCLUDE@psi4/driver/procrouting/dft_funcs/dict_builder.py
:lines: 29-76
One can also use the ``dft_functional`` keyword argument to use the
orbitals generated by DFT for correlated wavefunction methods::
# MP2 with a PBE0 reference computation
molecule h2o {
0 1
O
H 1 1.0
H 1 1.0 2 104.5
}
set {
basis 6-31G
dft_spherical_points 302
dft_radial_points 99
reference rks
}
mp2_dft = energy("MP2", dft_functional="PBE0")
@@ -757,70 +812,23 @@ and |scf__dft_omega| keywords. For example, for LRC functionals, one can control
C
H 1 R
H 1 R 2 A
R = 1.075
A = 133.93
}
set reference uhf
set guess gwh
set basis cc-pvdz
set e_convergence 8
# Override the default value of omega
set dft_omega 2.0
E = energy('wb97x')
# Revoke the change for later computations if needed
revoke_global_option_changed('DFT_OMEGA')
This feature would be useful after finishing IP fitting procedure, for example.
Furthermore, new DFT functionals can be created from scratch from within the input file::
# DFT Custom Functional
molecule h2o {
0 1
O
H 1 1.0
H 1 1.0 2 104.5
}
set {
basis sto-3g
dft_spherical_points 302
dft_radial_points 99
reference rks
}
pbe0 = {
"name": "my_PBE0",
"x_functionals": {"GGA_X_PBE": {"alpha": 0.75}},
"x_hf": {"alpha": 0.25},
"c_functionals": {"GGA_C_PBE": {}}
}
func_call = energy('SCF', dft_functional=pbe0)
# as PBE0 is a pre-defined functional, the call above is equivalent to both below:
func_call = energy('SCF', dft_functional="PBE0")
func_call = energy('PBE0')
E = energy('wb97x')
Supported keywords include:
# Revoke the change for later computations if needed
revoke_global_option_changed('DFT_OMEGA')
- `name`: string, name of the functional, for custom defined functionals used for printing only.
- `xc_functionals`: dict, definition of a complete (X + C) functional based in LibXC name
- `x_functionals`: dict, definition of exchange functionals using LibXC names
- `c_functionals`: dict, definition of correlation functionals using LibXC names
- `x_hf`: dict, parameters dealing with exact (HF) exchange settings for hybrid DFT
- `c_mp2`: dict, parameters dealing with MP2 correlation for double hybrid DFT
- `dispersion`: dict, definition of dispersion corrections
- `citation`: string, citation for the method, for printing purposes
- `description`: string, description of the method, for printing purposes
This feature would be useful after finishing the IP fitting procedure, for example.
The full interface is defined in :ref:driver/procrouting/dft_funcs/dict_builder.py, all standard
functionals provided in Psi4 are implemented in the `dict_*_funcs.py` files in the same folder.
@@ -176,7 +176,7 @@ Running DFTD3
~~~~~~~~~~~~~
A number of *a posteriori* dispersion corrections are available in
|PSIfour|. While most are computed within |PSIfours| codebase (-D1, -D2,
|PSIfour|. While some are computed within |PSIfours| codebase (-D1, -D2,
-CHG, -DAS2009, -DAS2010), the -D3 correction and its variants are
available only through the ``DFTD3`` program. Once installed, the
``dftd3``/|PSIfour| interface is transparent, and all corrections are
@@ -210,44 +210,42 @@ program is suppressed; to see it in the output file, set print > 2.
.. _`table:dashd`:
.. table:: Variants of S. Grimme's -D correction
+-------------------------------------+---------------------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| Extension [#f0]_ | Variant and Computing Program | |scf__dft_dispersion_parameters| |
+=====================================+=========================================================================================================+===============================================================+
| -D | alias to -D2P4 | |
+-------------------------------------+---------------------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| -D1 | -D1 [#f1]_ within |PSIfour| | |
+-------------------------------------+---------------------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| -D2 | alias to -D2P4 | |
+-------------------------------------+---------------------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| -D2P4 | -D2 [#f2]_ within |PSIfour| | [:math:`s_6`] |
+-------------------------------------+---------------------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| -D2GR | -D2 [#f2]_ through ``dftd3`` | [:math:`s_6`, :math:`\alpha_6`] |
+-------------------------------------+---------------------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| -D3 | alias to -D3ZERO | |
+-------------------------------------+---------------------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| -D3ZERO | -D3 [#f3]_ w/ original zero-damping through ``dftd3`` | [:math:`s_6`, :math:`s_8`, :math:`s_{r,6}`, :math:`\alpha_6`] |
+-------------------------------------+---------------------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| -D3BJ | -D3 [#f4]_ w/ newer Becke-Johnson rational damping through ``dftd3`` | [:math:`s_6`, :math:`s_8`, :math:`a_1`, :math:`a_2`] |
+-------------------------------------+---------------------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| -D3M | alias to -D3MZERO | |
+-------------------------------------+---------------------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| -D3MZERO | -D3 [#f5]_ w/ reparameterized and more flexible original zero-damping through ``dftd3`` | [:math:`s_6`, :math:`s_8`, :math:`s_{r,6}`, :math:`\beta`] |
+-------------------------------------+---------------------------------------------------------------------------------------------------------+---------------------------------------------------------------+
| -D3MBJ | -D3 [#f5]_ w/ reparameterized newer Becke-Johnson rational damping through ``dftd3`` | [:math:`s_6`, :math:`s_8`, :math:`a_1`, :math:`a_2`] |
+-------------------------------------+---------------------------------------------------------------------------------------------------------+---------------------------------------------------------------+
.. table:: Variants of dispersion corrections
+-------------------------------------+-----------------------------------------------------------------------+---------------------------------+--------------------------------------------------------------------------------+
| Extension [#f0]_ | Variant | Computing Program (engine) | |scf__dft_dispersion_parameters| |
+=====================================+=======================================================================+=================================+================================================================================+
| -D | alias to -D2 | | |
| -D1 | -D1 [#f1]_ | |PSIfours| libdisp | [:math:`s_6`] |
| -D2 | -D2 [#f2]_ | |PSIfours| libdisp OR ``dftd3`` | [:math:`s_6`, :math:`\alpha_6`, :math:`s_{r,6}`] |
| -D3 | alias to -D3ZERO | | |
| -D3ZERO | -D3 [#f3]_ w/ original zero-damping | ``dftd3`` | [:math:`s_6`, :math:`s_8`, :math:`s_{r,6}`, :math:`\alpha_6`, :math:`s_{r,8}`] |
| -D3BJ | -D3 [#f4]_ w/ newer Becke-Johnson rational damping | ``dftd3`` | [:math:`s_6`, :math:`s_8`, :math:`a_1`, :math:`a_2`] |
| -D3(BJ) | alias to -D3BJ | | |
| -D3M | alias to -D3MZERO | | |
| -D3MZERO | -D3 [#f5]_ w/ reparameterized and more flexible original zero-damping | ``dftd3`` | [:math:`s_6`, :math:`s_8`, :math:`s_{r,6}`, :math:`\beta`] |
| -D3MBJ | -D3 [#f5]_ w/ reparameterized newer Becke-Johnson rational damping | ``dftd3`` | [:math:`s_6`, :math:`s_8`, :math:`a_1`, :math:`a_2`] |
| -D3M(BJ) | alias to -D3MBJ | | |
| -NL | Grimme's -NL (DFT plus VV10 correlation) [#f6]_ | ???? | [:math:`b`, :math:`c`] |
| -CHG | Chai & Head-Gordon dispersion formula [#f7]_ | |PSIfours| libdisp | [:math:`s_6`] |
| -DAS2009 | Podeszwa & Szalewicz dispersion formula [#f8]_ | |PSIfours| libdisp | [:math:`s_6`] |
| -DAS2010 | Podeszwa & Szalewicz dispersion formula [#f9]_ | |PSIfours| libdisp | [:math:`s_6`] |
+-------------------------------------+-----------------------------------------------------------------------+---------------------------------+--------------------------------------------------------------------------------+
.. rubric:: Footnotes
.. [#f0] Note that there are functionals with these extensions (*e.g.*, wB97X-D) that,
not being Grimme corrections, have nothing to do with this table.
not being Grimme corrections, won't follow this table exactly.
.. [#f1] [Grimme:2004:1463]_
.. [#f2] [Grimme:2006:1787]_
.. [#f3] [Grimme:2010:154104]_
.. [#f4] [Grimme:2011:1456]_
.. [#f5] [Smith:2016:2197]_
.. [#f6] [Hujo:2011:3866]_
.. [#f7] [Chai:2010:6615]_
.. [#f8] [Pernal:2009:263201]_
.. [#f9] [Podeszwa:2010:550]_
A few practical examples:
@@ -269,6 +267,10 @@ A few practical examples:
set dft_dispersion_parameters [1.0, 2.0, 1.261, 14.0]
energy('b3lyp-d3')
* DFT-D2 single point with ``dftd3`` instead of |PSIfours| libdisp ::
energy('pbe-d2', engine='dftd3')
If only dispersion corrections (rather than total energies) are of
interest, the ``dftd3`` program can be run independently of the scf
through the python function :py:func:`~qcdb.interface_dftd3.run_dftd3`. (This function
@@ -47,18 +47,17 @@
def run_gcp(self, func=None, dertype=None, verbose=False): # dashlvl=None, dashparam=None
"""Function to call Grimme's dftd3 program (http://toc.uni-muenster.de/DFTD3/)
to compute the -D correction of level *dashlvl* using parameters for
the functional *func*. The dictionary *dashparam* can be used to supply
a full set of dispersion parameters in the absense of *func* or to supply
individual overrides in the presence of *func*. Returns energy if *dertype* is 0,
gradient if *dertype* is 1, else tuple of energy and gradient if *dertype*
unspecified. The dftd3 executable must be independently compiled and found in
:envvar:`PATH` or :envvar:`PSIPATH`.
*self* may be either a qcdb.Molecule (sensibly) or a psi4.Molecule
(works b/c psi4.Molecule has been extended by this method py-side and
only public interface fns used) or a string that can be instantiated
into a qcdb.Molecule.
"""Function to call Grimme's GCP program
https://www.chemie.uni-bonn.de/pctc/mulliken-center/software/gcp/gcp
to compute an a posteriori geometrical BSSE correction to *self* for
several HF, generic DFT, and specific HF-3c and PBEh-3c method/basis
combinations, *func*. Returns energy if *dertype* is 0, gradient
if *dertype* is 1, else tuple of energy and gradient if *dertype*
unspecified. The gcp executable must be independently compiled and
found in :envvar:`PATH` or :envvar:`PSIPATH`. *self* may be either a
qcdb.Molecule (sensibly) or a psi4.Molecule (works b/c psi4.Molecule
has been extended by this method py-side and only public interface
fns used) or a string that can be instantiated into a qcdb.Molecule.
"""
# Create (if necessary) and update qcdb.Molecule
Oops, something went wrong.

0 comments on commit d158d13

Please sign in to comment.