Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor clarification for optimization task #41

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 23 additions & 13 deletions doc/prog-scf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -786,30 +786,40 @@ contraction coefficients already.
Geometry Optimization
---------------------

The next task is to expand your program to perform a simple geometry optimization.
The next task is to expand your program to perform a simple geometry
optimization.

Numerical Derivatives
~~~~~~~~~~~~~~~~~~~~~

The simplest way to perform geometry optimizations is by using the information
from the energy derivative, since we do not want to code analytical derivatives
from the energy derivative. As we do not want to code analytical derivatives
of the Hartree--Fock energy expression, we will resort to numerical derivatives
instead. This requires to evalulate several SCF energies in one program run,
since you coded your SCF in a subroutine this should not be an issue.
instead. This requires to evalulate several SCF energies in one program run.
Since you coded your SCF in a subroutine, this should not be an issue.
Nevertheless, try to run the subroutine several times to check if the code
is correctly allocating and initializing its variables, they might show up now
and you can fix them before adding much more code to your program.
is correctly allocating and initializing all variables. If errors show up now,
you can fix them before adding much more code to your program.

Copy and modify your input files such that for each parameter (cartesian atomic
coordinates and Slater exponents) *θ*\ :sub:`i` it contains an integer indicating
whether a numerical gradient with respect to *θ*\ :sub:`i` is to be calculated.
Create a new subroutine that will allow the variation of one parameter
*θ*\ :sub:`i` at a time as necessary for each element of the numerical gradient
coordinates and Slater exponents) *θ*\ :sub:`i`, it contains an integer
indicating whether a numerical gradient with respect to *θ*\ :sub:`i` is to be
calculated. Create a new subroutine that will allow the variation of one
parameter *θ*\ :sub:`i` at a time as necessary for each element of the
numerical gradient

.. math::
\frac{\delta E}{\delta \theta_{i}} \approx \frac{E(\theta_{1}, \ldots, \theta_{i}
+ \Delta \theta, \ldots, \theta_{n}) - E(\theta_{1}, \ldots, \theta_{i}
- \Delta \theta, \ldots, \theta_{n})}{2 \Delta \theta}.
\frac{\delta E}{\delta \theta_{i}} \approx \frac{E(\theta_{1}, \ldots,
\theta_{i} + \Delta \theta, \ldots, \theta_{n}) - E(\theta_{1}, \ldots,
\theta_{i} - \Delta \theta, \ldots, \theta_{n})}{2 \Delta \theta}.

Specifically, the geometric derivative is given by (leaving out all other
parameters the energy depends on)

.. math::

\frac{\delta E}{\delta R_{i}} \approx \frac{E(R_{i} + \Delta R) - E(R_{i} -
\Delta R)}{2 \Delta R}.

.. admonition:: Exercise 16

Expand Down
Loading