|
| 1 | +Scalar field analysis |
| 2 | +===================== |
| 3 | + |
| 4 | +.. contents:: Table of Contents |
| 5 | + :depth: 3 |
| 6 | + |
| 7 | +Once the electronic structure has been determined, a variety of scalar fields |
| 8 | +derived from the electron density can be analyzed and visualized. These fields |
| 9 | +provide insight into the spatial distribution of electronic properties and form |
| 10 | +the basis for interpreting exchange, correlation, and density-related |
| 11 | +quantities. |
| 12 | + |
| 13 | +Electron density and its gradient |
| 14 | +--------------------------------- |
| 15 | + |
| 16 | +The :class:`pydft.DFT` class exposes its internal matrices and a number of |
| 17 | +useful functions which we can readily use to interpret its operation. Let us |
| 18 | +start by generating a plot of the electron density using the method |
| 19 | +:meth:`pydft.DFT.get_density_at_points`. |
| 20 | + |
| 21 | +.. literalinclude:: scripts/01-electron-density.py |
| 22 | + :language: python |
| 23 | + :linenos: |
| 24 | + :emphasize-lines: 25 |
| 25 | + |
| 26 | +Running the above script yields the electron density. |
| 27 | + |
| 28 | +.. figure:: _static/img/user_interface/01-electron-density.png |
| 29 | + |
| 30 | +Using largely the same code, we can also readily build the electron density |
| 31 | +gradient magnitude using :meth:`pydft.DFT.get_gradient_at_points`. |
| 32 | + |
| 33 | +.. literalinclude:: scripts/02-electron-density-gradient.py |
| 34 | + :language: python |
| 35 | + :linenos: |
| 36 | + :emphasize-lines: 25 |
| 37 | + |
| 38 | +.. figure:: _static/img/user_interface/02-electron-density-gradient.png |
| 39 | + |
| 40 | +Exchange potential |
| 41 | +------------------ |
| 42 | + |
| 43 | +To construct the exchange potential at arbitrary grid points, we can use the |
| 44 | +script as shown below which uses the :meth:`pydft.MolecularGrid.get_exchange_potential_at_points` |
| 45 | +method. |
| 46 | + |
| 47 | +.. literalinclude:: scripts/08-exchange-potential.py |
| 48 | + :language: python |
| 49 | + :linenos: |
| 50 | + :emphasize-lines: 13 |
| 51 | + |
| 52 | +.. image:: _static/img/user_interface/08-exchange-potential.png |
| 53 | + |
| 54 | +Correlation potential |
| 55 | +--------------------- |
| 56 | + |
| 57 | +In a similar fashion as for the exchange potential, we can use the method |
| 58 | +:meth:`pydft.MolecularGrid.get_correlation_potential_at_points` to obtain the |
| 59 | +correlation potential field. |
| 60 | + |
| 61 | +.. literalinclude:: scripts/08-correlation-potential.py |
| 62 | + :language: python |
| 63 | + :linenos: |
| 64 | + :emphasize-lines: 13 |
| 65 | + |
| 66 | +.. image:: _static/img/user_interface/08-correlation-potential.png |
0 commit comments