From d7efb442d232dd647a461f91744b2b4820cdf6d6 Mon Sep 17 00:00:00 2001 From: jeanwsr Date: Mon, 30 Dec 2024 17:30:59 +0800 Subject: [PATCH 1/2] update disp doc --- source/user/dft.rst | 34 ++++++++++++++++++++-------------- source/user/scf.rst | 6 ++++-- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/source/user/dft.rst b/source/user/dft.rst index 8e7f26d58..5f36933ec 100644 --- a/source/user/dft.rst +++ b/source/user/dft.rst @@ -181,21 +181,27 @@ or - as an alternative - the same may be achieved in the following way: Dispersion corrections ====================== -Two main ways exist for adding dispersion (van der Waals) corrections to KS-DFT calculations. One is to augment mean-field results by Grimme's D3 corrections :cite:`DFTD3`, which can be added through an interface to the external library `libdftd3 `_, cf. `dftd3/00-hf_with_dftd3.py `_: - - >>> from pyscf import dftd3 - >>> mf_hf_d3 = dftd3.dftd3(dft.RKS(mol_hf)) - >>> mf_hf_d3.kernel() +Adding dispersion (van der Waals) corrections to KS-DFT calculations requires the pyscf-dispersion extension, +which implements a simplified interface to d3 (https://github.com/dftd3/simple-dftd3) +and d4 (https://github.com/dftd4/dftd4) libraries. +This interface can automatically configure the necessary settings including dispersion, xc, and nlc attributes of PySCF mean-field objects. + +It is recommended to enable D3 :cite:`DFTD3`, D4 dispersion corrections through the KS class instantiation. +The values of attributes nlc, disp, and xc of KS object are automatically configured in this way. +Both the `mol.KS`` method or `pyscf.dft.RKS` function can be used, +cf. `dft/16-dft_d3.py `_: + + >>> mf_d3 = mol_hf.KS(xc='wb97x-d4') + >>> #mf_d3 = mol_hf.KS(xc='b3lyp-d3bj') + >>> #mf_d3 = mol_hf.KS(xc='b3lyp-d3zero') + >>> mf_d3.kernel() -Alternatively, non-local correlation may be added through the VV10 functional :cite:`vydrov_voorhis_vv10_functional_jcp_2010`, cf. `dft/33-nlc_functionals.py `_: - - >>> mf_hf.xc = 'wb97m_v' - >>> mf_hf.nlc = 'vv10' - >>> mf_hf.grids.atom_grid = {'H': (99, 590), 'F': (99, 590)} - >>> mf_hf.grids.prune = None - >>> mf_hf.nlcgrids.atom_grid = {'H': (50, 194), 'F': (50, 194)} - >>> mf_hf.nlcgrids.prune = dft.gen_grid.sg1_prune - >>> mf_hf.kernel() +Alternatively, non-local correlation may be added through the VV10 functional :cite:`vydrov_voorhis_vv10_functional_jcp_2010`, +cf. `dft/33-nlc_functionals.py `_: + + >>> mf_nlc = dft.RKS(mol_hf) + >>> mf_nlc.xc = 'wb97m_v' + >>> mf_nlc.kernel() It's important to keep in mind that the evaluation of the VV10 functional involves a double grid integration, so differences in grid size can make an enormous difference in time. diff --git a/source/user/scf.rst b/source/user/scf.rst index 142ae0de8..ba2a58f32 100644 --- a/source/user/scf.rst +++ b/source/user/scf.rst @@ -318,8 +318,10 @@ Spin-restricted, spin-unrestricted, restricted open-shell, and generalized calcu The general spin-orbital used in the HF or KS-DFT wave function can be written as - .. math:: - \psi_i(1) = \phi_{i\alpha}(r)\alpha + \phi_{i\beta}(r)\beta \;, + +.. math:: + + \psi_i(1) = \phi_{i\alpha}(r)\alpha + \phi_{i\beta}(r)\beta \;, Four variants of the ansatz :math:`\psi(1)` are commonly used in quantum chemistry; they are also all available in PySCF. From 25345c8b01093e57acda998be1b443eedd087fcf Mon Sep 17 00:00:00 2001 From: jeanwsr Date: Mon, 30 Dec 2024 17:45:54 +0800 Subject: [PATCH 2/2] update format --- source/user/dft.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/user/dft.rst b/source/user/dft.rst index 5f36933ec..2d4c09579 100644 --- a/source/user/dft.rst +++ b/source/user/dft.rst @@ -181,14 +181,13 @@ or - as an alternative - the same may be achieved in the following way: Dispersion corrections ====================== -Adding dispersion (van der Waals) corrections to KS-DFT calculations requires the pyscf-dispersion extension, -which implements a simplified interface to d3 (https://github.com/dftd3/simple-dftd3) -and d4 (https://github.com/dftd4/dftd4) libraries. -This interface can automatically configure the necessary settings including dispersion, xc, and nlc attributes of PySCF mean-field objects. +Adding dispersion (van der Waals) corrections to KS-DFT calculations requires the `pyscf-dispersion `_ extension, +which implements a simplified interface to `simple-dftd3 `_ +and `dftd4 `_ libraries. It is recommended to enable D3 :cite:`DFTD3`, D4 dispersion corrections through the KS class instantiation. The values of attributes nlc, disp, and xc of KS object are automatically configured in this way. -Both the `mol.KS`` method or `pyscf.dft.RKS` function can be used, +Both the ``mol.KS`` method or ``dft.RKS`` function can be used, cf. `dft/16-dft_d3.py `_: >>> mf_d3 = mol_hf.KS(xc='wb97x-d4') @@ -203,6 +202,8 @@ cf. `dft/33-nlc_functionals.py >> mf_nlc.xc = 'wb97m_v' >>> mf_nlc.kernel() +See `dft/33-nlc_functionals.py `_ +for more examples of setting the ``nlc`` and ``nlcgrids`` attribute. It's important to keep in mind that the evaluation of the VV10 functional involves a double grid integration, so differences in grid size can make an enormous difference in time. .. _user_dft_collinear: