-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rough draft of some docs to make sure things are working
- Loading branch information
1 parent
bbc638c
commit 0f89115
Showing
12 changed files
with
291 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ DFT Module | |
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.. _settings_module: | ||
|
||
The Settings Module | ||
=================== | ||
|
||
.. automodule:: ciderpress.dft.settings | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Density and Orbital Features in CiderPress | ||
========================================== | ||
|
||
To predict the exchange-correlation energy :math:`E_{\text{xc}}`, we need | ||
to train a machine learning model :math:`e_{\text{xc}}(\mathbf{x})` such that | ||
|
||
.. math:: E_{\text{xc}} = \int \text{d}^3\mathbf{r}\, e_\text{xc}(\mathbf{x}[n_1](\mathbf{r})) | ||
|
||
where :math:`\mathbf{x}[n_1](\mathbf{r})` is a position-dependent feature vector that is | ||
a functional of the density :math:`n(\mathbf{r})` in "pure" Kohn-Sham DFT and a | ||
functional of the density matrix :math:`n_1(\mathbf{r}, \mathbf{r}')` in the case of | ||
"generalized" Kohn-Sham DFT. Cider provides several types of feature that can | ||
be used as input to the ML model. These features | ||
can be divided into four categories: | ||
|
||
* :ref:`Semilocal Features (SL) <sl_feat>`: Same features as in conventional GGA/meta-GGA functionals (i.e. :math:`n`, :math:`\nabla n`, :math:`\tau`). | ||
NOTE: All Cider models must include semilocal features. | ||
They need not be used explicitly in the model, but evaluating | ||
them is required to evalute baseline functionals and other quantities in the code. | ||
* :ref:`Nonlocal Density Features (NLDF) <nldf_feat>`: These features are constructed by integrating the density | ||
over a real-space kernel function to characterize the shape of the density around a point :math:`\mathbf{r}`. | ||
* :ref:`Nonlocal Orbital Features (NLOF) <nlof_feat>`: EXPERIMENTAL, NOT TESTED, NOT RECOMMENDED FOR USE. | ||
One coordinate of the density matrix is operated on by a fractional Laplacian. | ||
* :ref:`Smooth Density Matrix Exchange (SDMX) <sdmx_feat>`: | ||
One coordinate of the density matrix is convolved at different length scales. Then these convolutions | ||
are contracted to approximately characterize the shape of the density matrix around a point :math:`\mathbf{r}`. | ||
|
||
The set of features to be used in a model is specified using the :class:`FeatureSettings` object. To see | ||
the code API for setting up feature settings, see the :ref:`Settings module <settings_module>` section. To see | ||
mathematical descriptions and physical intuition for the different types of features, see | ||
the subsections below. | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
sl | ||
nldf | ||
nlof | ||
sdmx | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.. _nldf_feat: | ||
|
||
Nonlocal Density Features (NLDF) | ||
================================ | ||
|
||
TODO | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _nlof_feat: | ||
|
||
Nonlocal Orbital Features (NLOF) | ||
================================ | ||
|
||
**The nonlocal orbital features are still highly experimental. We note here | ||
that they are implemented in the code so that their presence does not cause | ||
confusion, but their use is not encouraged, and they might be removed at a | ||
later date.** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.. _sdmx_feat: | ||
|
||
Smooth Density Matrix Exchange (SDMX) | ||
===================================== | ||
|
||
TODO | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
.. _sl_feat: | ||
|
||
Semilocal Features (SL) | ||
======================= | ||
|
||
Semilocal features are the ingredient commonly used in semilocal DFT. | ||
They most basic ingredient is the electron density :math:`n(\mathbf{r})`, | ||
which is defined as | ||
|
||
.. math:: n(\mathbf{r}) = \sum_i f_i |\phi_i(\mathbf{r})|^2 | ||
|
||
with :math:`\phi_i(\mathbf{r})` being the Kohn-Sham orbitals. A functional | ||
constructed from :math:`n(\mathbf{r})` only is called a local density | ||
approximation (LDA). The gradient of the density :math:`\nabla n(\mathbf{r})` | ||
is also commonly used and results in a generalized-gradient approximation (GGA). | ||
Lastly, the kinetic energy density | ||
|
||
.. math:: \tau(\mathbf{r}) = \frac{1}{2} \sum_i f_i |\nabla\phi_i(\mathbf{r})|^2 | ||
|
||
can be used, resulting in a meta-generalized gradient approximation (meta-GGA or MGGA). | ||
To help enforce physical constraints such as uniform scaling, regularized | ||
features are often introduced, including the reduced gradient | ||
|
||
.. math:: p = \frac{|\nabla n|^2}{2(3\pi^2)^{1/3}n^{4/3}} | ||
|
||
and the iso-orbital indicator | ||
|
||
.. math:: \alpha = \frac{\tau - \tau_W}{\tau_0} | ||
|
||
where :math:`\tau_W=|\nabla n|^2/8n` is the single-electron kinetic energy, | ||
and :math:`\tau_0=\frac{3}{10}(3\pi^2)^{2/3}n^{5/3}` is the kinetic energy | ||
density of the uniform electron gas. | ||
|
||
Note that for simplicity, all of these definitions are provided for the | ||
non-spin-polarized case, where the orbital occupations :math:`f_i\in [0,2]` | ||
|
||
In Cider, the choice of semilocal features is specified using the class:`SemilocalSettings` | ||
class in :py:mod:`ciderpress.dft.settings`. There is only one argument to this | ||
class, :py:obj:`mode`, which specifies which features to compute. There are four choices: | ||
|
||
* ``ns``: :math:`\mathbf{x}_\text{sl} = [n, |\nabla n|^2]` | ||
* ``np``: :math:`\mathbf{x}_\text{sl} = [n, p]` | ||
* ``nst``: :math:`\mathbf{x}_\text{sl} = [n, |\nabla n|^2, \tau]` | ||
* ``npa``: :math:`\mathbf{x}_\text{sl} = [n, p, \alpha]` | ||
|
||
**IMPORTANT NOTE 1**: If the mode is ``ns`` or ``np``, the kinetic energy density :math:`\tau` | ||
is not computed, so it cannot be used at any point in the calculation. This means | ||
that :ref:`Nonlocal Density Features <nldf_feat>` must be instantiated with | ||
``sl_level="GGA"``. If desired, orbital-dependent features can still be incorporated | ||
via :ref:`Smooth Density Matrix Exchange <sdmx_feat>`. If the mode is ``nst`` or ``npa``, | ||
:math:`\tau` is always computed. | ||
|
||
**IMPORTANT NOTE 2**: The regularized features :math:`p` and :math:`\alpha` are | ||
scale-invariant, meaning that | ||
an exchange functional trained with these features and | ||
a proper exchange functional baseline will obey the | ||
uniform scaling rule (see :ref:`Uniform Scaling Constraints <unif_scaling>`). | ||
The raw features :math:`n`, :math:`|\nabla n|^2`, and :math:`\tau` are not | ||
scale-invariant, and CiderPress does not automatically regularize these features | ||
as it does with nonlocal features. Therefore, these features must be regularized in | ||
the :py:mod:`ciderpress.dft.transform_data` module to enforce the uniform scaling | ||
constraint in trained models. (TODO need to elaborate on this). | ||
|
||
See the :class:`SemilocalSettings` class in the :ref:`Feature Settings <settings_module>` | ||
documentation for more details on the API for setting up these features. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Theory Overview | ||
=============== | ||
|
||
The theory section provides an overview of some of the important concepts | ||
involved in designing exchange-correlation functionals for DFT, | ||
particularly machine learning-based functionals. | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
uniform_scaling | ||
|
Oops, something went wrong.