|
| 1 | +.. _developer_scf: |
1 | 2 |
|
2 |
| -Include here I think the main mods of DFT vs HF, the numint module, the |
3 |
| -key path in numint, and important functions e.g. eval_ao, etc. |
| 3 | +******************************* |
| 4 | +Density functional theory (DFT) |
| 5 | +******************************* |
| 6 | + |
| 7 | +*Modules*: :mod:`dft`, :mod:`pbc.dft` |
| 8 | + |
| 9 | +Overview |
| 10 | +======== |
| 11 | +The DFT methods in modules :mod:`pyscf.dft` and :mod:`pyscf.pbc.dft` |
| 12 | +are implemented as derived classes of the base SCF class :class:`pyscf.scf.hf.SCF`. |
| 13 | +The major modifications of DFT against HF include re-implementation of the |
| 14 | +:meth:`get_veff` and :meth:`energy_elec` methods. |
| 15 | +In addition to :meth:`get_jk`, :meth:`get_veff` also calls |
| 16 | +:func:`numint.nr_rks` (for spin-restricted cases) or |
| 17 | +:func:`numint.nr_uks` (for spin-unrestricted cases) |
| 18 | +to compute the exchange-correlation (XC) energy and potential. |
| 19 | +The XC energy is added to the total electronic energy in :meth:`energy_elec`. |
| 20 | + |
| 21 | +Numerical integration |
| 22 | +===================== |
| 23 | +The XC functionals are evaluated on numerical quadrature grids. |
| 24 | +These grids are defined in modules :mod:`pyscf.dft.gen_grid` and |
| 25 | +:mod:`pyscf.pbc.dft.gen_grid` for molecules and solids, respectively. |
| 26 | +The actual methods to evaluate those XC functionals and their related integrals |
| 27 | +are implemented in modules :mod:`pyscf.dft.numint` and :mod:`pyscf.pbc.dft.numint`. |
| 28 | +For example, the XC energy and potential matrix for a given density matrix are computed by |
| 29 | +:meth:`nr_rks` (or :meth:`nr_uks`), which internally calls |
| 30 | + |
| 31 | +- :func:`eval_ao` -- to compute the atomic orbitals (AOs) and their derivatives on the grid |
| 32 | + |
| 33 | +- :func:`eval_rho` -- to compute the electron density and density derivatives on the grid |
| 34 | + |
| 35 | +- :func:`eval_xc` -- to compute the XC energy and potential through an interface to the external library Libxc (:func:`pyscf.dft.libxc.eval_xc`) |
| 36 | + or XCFun (:func:`pyscf.dft.xcfun.eval_xc`). |
| 37 | + |
| 38 | +Other convenient functions implemented in :mod:`numint` include |
| 39 | + |
| 40 | +- :func:`eval_mat` -- evaluating the XC potential matrix with AO, electron density, and XC potential values on the grid as the input |
| 41 | + |
| 42 | +- :func:`nr_vxc` -- evaluating the XC energy and potential matrix with the density matrix as the input |
| 43 | + |
| 44 | +- :func:`nr_sap_vxc` -- evaluating the superposition of atomic potentials matrix, which is used as the initial guess for :math:`v_{\rm eff}` |
| 45 | + when setting :attr:`mf.init_guess` to ``'vsap'``. |
| 46 | + |
| 47 | +- :func:`nr_rks_fxc`, :func:`nr_uks_fxc` -- evaluating the XC kernel matrix |
4 | 48 |
|
0 commit comments