\documentstyle[a4wide,12pt]{article}
\newcommand{\be}{\begin{equation}}
\newcommand{\ee}{\end{equation}}
\newcommand{\OP}[1]{{\bf\widehat{#1}}}

\begin{document}
\section*{Introduction to numerical projects}

Here follows a brief recipe and recommendation on how to write a report for each
project.
\begin{itemize}
\item Give a short description of the nature of the problem and the eventual 
numerical methods you have used.
\item Describe the algorithm you have used and/or developed. Here you may find it convenient
to use pseudocoding. In many cases you can describe the algorithm
in the program itself.

\item Include the source code of your program. Comment your program properly.
\item If possible, try to find analytic solutions, or known limits
in order to test your program when developing the code.
\item Include your results either in figure form or in a table. Remember to
       label your results. All tables and figures should have relevant captions
       and labels on the axes.
\item Try to evaluate the reliabilty and numerical stability/precision
of your results. If possible, include a qualitative and/or quantitative
discussion of the numerical stability, eventual loss of precision etc. 

\item Try to give an interpretation of you results in your answers to 
the problems.
\item Critique: if possible include your comments and reflections about the 
exercise, whether you felt you learnt something, ideas for improvements and 
other thoughts you've made when solving the exercise.
We wish to keep this course at the interactive level and your comments can help
us improve it. We do appreciate your comments. 
\item Try to establish a practice where you log your work at the 
computerlab. You may find such a logbook very handy at later stages
in your work, especially when you don't properly remember 
what a previous test version 
of your program did. Here you could also record 
the time spent on solving the exercise, various algorithms you may have tested
or other topics which you feel worthy of mentioning.
\end{itemize}



\section*{Format for electronic delivery of report and programs}
%
The preferred format for the report is a PDF file.
As programming language we prefer that you choose between C/C++ and Fortran.
You could also use Java or Python as programming languages. 
Matlab/Maple/Mathematica/IDL are not accepted, but you can use them to check your results where possible.
Finally, 
we do prefer that you work together. Optimal working groups consist of 
2-3 students, but more people can collaborate. You can then hand in a common report. 

Below you will also find a guide on how to write up the project as a scientific article. We recommend this option when writing the final report.

\section*{Project for FYS4411/9411 Spring 2014, Advanced Hartree-Fock}

\section*{Part 1: Hartree-Fock calculations of closed-shell atoms}

The Hartree-Fock functional is written as 
\[
  E[\Phi] 
  = \sum_{\mu=1}^N \langle \mu | h | \mu\rangle+ \frac{1}{2}\sum_{\mu=1}^N\sum_{\nu=1}^N\left[\langle \mu\nu |\frac{1}{r_{ij}}|\mu\nu\rangle-\langle \mu\nu |\frac{1}{r_{ij}}|\nu\mu\rangle\right].
\]

With the given functional, we can perform at least two types of variational strategies.
\begin{itemize}
\item Vary the Slater determinant by changing the spatial part of the single-particle
wave functions themselves. 
\item   Expand the single-particle functions in a known basis  and vary the coefficients, 
that is, the new function single-particle wave function $|a\rangle$ is written as a linear expansion
in terms of a fixed basis $\phi$ (harmonic oscillator, Laguerre polynomials etc)
\[
\psi_a  = \sum_{\lambda} C_{a\lambda}\phi_{\lambda},
\]
 \end{itemize}
Both cases lead to a new Slater determinant which is related to the previous via  a unitary transformation.
The second one is the one we will use in this project.

\begin{enumerate}
\item[1a)] Consider a Slater determinant built up of single-particle orbitals $\psi_{\lambda}$, 
with $\lambda = 1,2,\dots,N$.

The unitary transformation
\[
\psi_a  = \sum_{\lambda} C_{a\lambda}\phi_{\lambda},
\]brings us into the new basis.  Show that the new basis is orthonormal.
Show that the new Slater determinant constructed from the new single-particle wave functions can be
written as the determinant based on the previous basis and the determinant of the matrix $C$.
Show that the old and the new Slater determinants are equal up to a complex constant with absolute value unity.
(Hint, $C$ is a unitary matrix). 


\item[1b)]
Minimizing with respect to $C^*_{k\alpha}$, remembering that $C^*_{k\alpha}$ and $C_{k\alpha}$
are independent and defining
\[
h_{\alpha\gamma}^{HF}=\langle \alpha | h | \gamma \rangle+
\sum_{a=1}^N\sum_{\beta\delta} C^*_{a\beta}C_{a\delta}\langle \alpha\beta|V|\gamma\delta\rangle_{AS},
\]
show that you can write the Hartree-Fock  equations as 
\[
\sum_{\gamma}h_{\alpha\gamma}^{HF}C_{k\gamma}=\epsilon_kC_{k\alpha}.
\label{eq:newhf}
\]
Explain the meaning of the different terms.

\item[1c)] We will now set up the Hartree-Fock program by using
  hydrogen-like single-particle functions for the $1s$, $2s$ and $3s$
  orbitals.  We will apply these basis functions only to the helium
  and beryllium atoms.  For all other systems, we will use so-called
  Gaussian type of orbitals (GTO).  These will be introduced after we
  have set up our first Hartree-Fock programs. For Hydrogen
  like-orbitals, the matrix elements involving the Coulomb
  interaction, can all be evaluated in a closed form, see the table
  below for all integrals involving these orbitals.
Your first step is to write a function which reads in these integrals and sets up the antisymmetrized matrix elements.
(Hint: the table lists only the integrals, there is no spin). 

\item[1d)] 
With the above ingredients we are now ready to solve 
the Hartree-Fock equations  for the helium and beryllium atoms.  

Set up the Hartree-Fock equations for the ground states of helium and beryllium
with the electrons  occupying
the respective 'hydrogen-like' orbitals $1s$, $2s$ and $3s$.
There is no spin-orbit part in the two-body Hamiltonian.  Find the single-particle energies iteratively as explained 
in the slides and lecture notes. Find also the total binding ground state energy and compare this to the energy obtaining without performing the Hartree-Fock calculations. The experimental values are $-2.904$ atomic units (a.u.) and
$-14.67$ a.u. for the helium and beryllium atoms, respectively. 

In setting up the equations make sure your Hartree-Fock matrix is block diagonal in the spin quantum numbers. Since there is no
spin-dependent part in the Hamiltonian, states with the same $l$ and $n$ will be degenerate in energy with respect to the spin
projections. 

\section*{Part 2: Hartree-Fock calculations of atoms and molecules using GTOs}

\item[2a)] Our next steps involves an object orientation of the code and the inclusion of Gaussian-type of orbitals (GTOs) as detailed in the slides. Your task here is to repeat the calculations of the helium and beryllium atoms using
GTOs using  three and five primitive functions, a so-called STO-3G and STO-5L basis.
Compare your results with those obtained with the hydrogen-like basis discussed above. Comment your results.


\item[2b)] Use thereafter a chosen GTO basis and compute the ground state energy of the neon and argon atoms and compare with 
existing theoretical calculations in the literature. Comment your results.

\item[2c)] We switch now to the computation of molecules and will use the hydrogen and beryllium molecules as our first test case with GTOs.
The 
H$_2$ molecule consists of two protons and two electrons 
with a ground state energy $E=-31.949$ eV or $-1.175$ a.u. and the 
equilibrium distance between the two hydrogen atoms
of $r_0=1.40$ Bohr radii (recall that a Bohr radius is $0.05\times 10^{-9}$m.
The Be$_2$ molecule contains eight electrons and eight protons (in addition we have eight neutrons but their charge is zero). Useful benchmarks for these molecules are the articles of 
Moskowitz and Kalos, Int.~Journal of Quantum Chemistry {\bf XX}, 1107 (1981) for He and H$_2$ and 
Filippi, Singh and Umrigar, J.~Chemical Physics {\bf 105}, 123 (1996) for the 
Be$_2$ molecule. You may also find J\o rgen H\o gberget's Master of Science thesis at the University of Oslo, 2013 a useful reference.

\item[2d)] Our final aim is to compute the ground state energy and equilibrium configuration for the water molecule H$_2$O and Si$_2$O using GTOs. Your task here is to figure out which is the optimal basis and perform calculations
of the ground state energy and compare with the literature.  With the optimal orbitals we can in turn also compute
the charge distribution of electrons, which is given by the 
the so-called density distribution. Multiplying with the electrical charge gives the charge distribution. 
The density distribution is
defined as
\[
\rho({\bf r})=\rho({\bf r}_1) = \int d{\bf r}_2\dots d{\bf r}_N \left| \Psi({\bf r}_1,{\bf r}_2\dots {\bf r}_N)\right|^2, 
\]
which in a Hartree-Fock based approach becomes 
\[
\rho({\bf r})=\sum_{i=1}^{N}\left| \psi_i({\bf r})\right|^2,
\]
with $\psi$ the single-particle wave functions (our best basis).  A useful check that the numerics works properly is 
to  integrate the density distributions since it has to give us the total number of electrons in the system, that is
\[
N=\int d{\bf r}\rho({\bf r}).
\]
Compute the density distribution for the H$_2$, Be$_2$, H$_2$O and Si$_2$O molecules at their equilbrium positions
(the value of $R$ where the ground state energy is at its minimum). Make plots of the density distributions. Give an interpretation of your results and
discuss the physics behind the results. 

\end{enumerate}


\section*{How to write a scientific report}
\subsection*{What should it contain? A possible structure}

If you wish to write up your findings as a scientific article, here are some simple guidelines
\begin{itemize}
\item An introduction where you explain the rational for the physics case and 
what you have done. At the end of the introduction you should give a brief
summary of the structure of the report
\item Theoretical models and technicalities. This is the methods section.
\item Results and discussion
\item Conclusions and perspectives
\item Appendix with extra material
\item Bibliography
\end{itemize}

You don't need to answer all questions in a chronological order.  When you write the introduction you could focus on the following aspects
\begin{itemize}
\item A central aim is to study the role of correlations due to the repulsion between the electrons.
\item To do this we have singled out several systems from atomic and molecular physics.
\item We test also the wave functions by computing onebody densities.
\end{itemize}
The methods section could contain the following elements:
\begin{itemize}
\item Describe the methods (quantum mechanical and algorithms)
\item You need to explain  Hartree-Fock theory.
\item The trial wave functions. Why do you choose the functions you do?
\item You can also plug in some calculations to demonstrate your code, such as selected runs from exercises 1a-1d for helium and beryllium.
\end{itemize}
The results section should include results which support your conclusions. You don't need to present all results, focus on those which you find the most relevant. Provide also benchmarks which you have used in order to validate your code. Present your discussions of results and compare with other calculations and theories and give critical assessments of what you have done.
In the concluding section you could focus on
\begin{itemize}
\item State your main findings and interpretations
\item Try as far as possible to present perspectives for future work
\item Try to discuss the pros and cons of the method and possible improvements
\end{itemize}
Additional material, code listings etc can be placed in various appendices. Finally, you should provide a proper list of relevant references.
Give always references to material you base your work on, either 
scientific articles/reports or books. When citing articles, refer as: name(s) of author(s), journal, volume (boldfaced), page and year. For books, 
refer as: name(s) of author(s), title of book, publisher, place and year, eventual page numbers.

\section*{Appendix}
Table \ref{tab:mtxlisting} contains the matrix elements for the radial integrals to be used for the direct part and the exchange part. Note again that these integrals do not include spin. You will need these integrals in solving the Hartree-Fock equations for the helium and beryllium atoms when using hydrogen-like single-particle states. 
\begin{table}[htbp]
\caption{Closed form expressions for the Coulomb matrix elements. The nomenclature is $1=1s$, $2=2s$ and $3=3s$, with no
spin degrees of freedom. \label{tab:mtxlisting}}
\begin{tabular} {|cr|cr|} \hline 
$\langle 11|V|11\rangle  =$& $ (5Z)/8 $ &$\langle 11|V|12\rangle  =$& $ (4096\sqrt{2}Z)/64827$ \\
$\langle 11|V|13\rangle  =$& $ (1269\sqrt{3}Z)/50000$ &$\langle 11|V|21\rangle  =$& $ (4096\sqrt{2}Z)/64827$ \\
$\langle 11|V|22\rangle  =$& $ (16Z)/729$ & $\langle 11|V|23\rangle  =$& $ (110592\sqrt{6}Z)/24137569$ \\
$\langle 11|V|31\rangle  =$& $ (1269\sqrt{3}Z)/50000$ &$\langle 11|V|32\rangle  =$& $ (110592\sqrt{6}Z)/24137569$ \\
$\langle 11|V|33\rangle  =$& $ (189Z)/32768$ & $\langle 12|V|11\rangle  =$& $ (4096\sqrt{2}Z)/64827$ \\
$\langle 12|V|12\rangle  =$& $ (17Z)/81$ &$\langle 12|V|13\rangle  =$& $ (1555918848\sqrt{6}Z)/75429903125$ \\
$\langle 12|V|21\rangle  =$& $ (16Z)/729$ &$\langle 12|V|22\rangle  =$& $ (512\sqrt{2}Z)/84375$ \\
$\langle 12|V|23\rangle  =$& $ (2160\sqrt{3}Z)/823543$ &$\langle 12|V|31\rangle  =$& $ (110592\sqrt{6}Z)/24137569$ \\
$\langle 12|V|32\rangle  =$& $ (29943\sqrt{3}Z)/13176688$ &$\langle 12|V|33\rangle  =$& $ (1216512\sqrt{2}Z)/815730721$ \\
$\langle 13|V|11\rangle  =$& $ (1269\sqrt{3}Z)/50000$ &$\langle 13|V|12\rangle  =$& $ (1555918848\sqrt{6}Z)/75429903125$ \\
$\langle 13|V|13\rangle  =$& $ (815Z)/8192$ & $\langle 13|V|21\rangle  =$& $ (110592\sqrt{6}Z)/24137569$ \\
$\langle 13|V|22\rangle  =$& $ (2160\sqrt{3}Z)/823543$ & $\langle 13|V|23\rangle  =$& $ (37826560\sqrt{2}Z)/22024729467$ \\
$\langle 13|V|31\rangle  =$& $ (189Z)/32768$ & $\langle 13|V|32\rangle  =$& $ (1216512\sqrt{2}Z)/815730721$ \\
$\langle 13|V|33\rangle  =$& $ (617Z)/(314928\sqrt{3})$ &$\langle 21|V|11\rangle  =$& $ (4096\sqrt{2}Z)/64827$ \\
$\langle 21|V|12\rangle  =$& $ (16Z)/729$ & $\langle 21|V|13\rangle  =$& $ (110592\sqrt{6}Z)/24137569$ \\
$\langle 21|V|21\rangle  =$& $ (17Z)/81$ & $\langle 21|V|22\rangle  =$& $ (512\sqrt{2}Z)/84375$ \\
$\langle 21|V|23\rangle  =$& $ (29943\sqrt{3}Z)/13176688$ & $\langle 21|V|31\rangle  =$& $ (1555918848\sqrt{6}Z)/75429903125$ \\
$\langle 21|V|32\rangle  =$& $ (2160\sqrt{3}Z)/823543$ & $\langle 21|V|33\rangle  =$& $ (1216512\sqrt{2}Z)/815730721$ \\
$\langle 22|V|11\rangle  =$& $ (16Z)/729$ & $\langle 22|V|12\rangle  =$& $ (512\sqrt{2}Z)/84375$ \\
$\langle 22|V|13\rangle  =$& $ (2160\sqrt{3}Z)/823543$ & $\langle 22|V|21\rangle  =$& $ (512\sqrt{2}Z)/84375$ \\
$\langle 22|V|22\rangle  =$& $ (77Z)/512$ & $\langle 22|V|23\rangle  =$& $ (5870679552\sqrt{6}Z)/669871503125$ \\
$\langle 22|V|31\rangle  =$& $ (2160\sqrt{3}Z)/823543$ & $\langle 22|V|32\rangle  =$& $ (5870679552\sqrt{6}Z)/669871503125$ \\
$\langle 22|V|33\rangle  =$& $ (73008Z)/9765625$ & $\langle 23|V|11\rangle  =$& $ (110592\sqrt{6}Z)/24137569$ \\
$\langle 23|V|12\rangle  =$& $ (2160\sqrt{3}Z)/823543$ & $\langle 23|V|13\rangle  =$& $ (37826560\sqrt{2}Z)/22024729467$ \\
$\langle 23|V|21\rangle  =$& $ (29943\sqrt{3}Z)/13176688$ & $\langle 23|V|22\rangle  =$& $ (5870679552\sqrt{6}Z)/669871503125$ \\
$\langle 23|V|23\rangle  =$& $ (32857Z)/390625$ & $\langle 23|V|31\rangle  =$& $ (1216512\sqrt{2}Z)/815730721$ \\
$\langle 23|V|32\rangle  =$& $ (73008Z)/9765625$ & $\langle 23|V|33\rangle  =$& $ (6890942464\sqrt{2/3}Z)/1210689028125$ \\
$\langle 31|V|11\rangle  =$& $ (1269\sqrt{3}Z)/50000$ & $\langle 31|V|12\rangle  =$& $ (110592\sqrt{6}Z)/24137569$ \\
$\langle 31|V|13\rangle  =$& $ (189Z)/32768$ & $\langle 31|V|21\rangle  =$& $ (1555918848\sqrt{6}Z)/75429903125$ \\
$\langle 31|V|22\rangle  =$& $ (2160\sqrt{3}Z)/823543$ & $\langle 31|V|23\rangle  =$& $ (1216512\sqrt{2}Z)/815730721$ \\
$\langle 31|V|31\rangle  =$& $ (815Z)/8192$ & $\langle 31|V|32\rangle  =$& $ (37826560\sqrt{2}Z)/22024729467$ \\
$\langle 31|V|33\rangle  =$& $ (617Z)/(314928\sqrt{3})$ & $\langle 32|V|11\rangle  =$& $ (110592\sqrt{6}Z)/24137569$ \\
$\langle 32|V|12\rangle  =$& $ (29943\sqrt{3}Z)/13176688$ & $\langle 32|V|13\rangle  =$& $ (1216512\sqrt{2}Z)/815730721$ \\
$\langle 32|V|21\rangle  =$& $ (2160\sqrt{3}Z)/823543$ & $\langle 32|V|22\rangle  =$& $ (5870679552\sqrt{6}Z)/669871503125$ \\
$\langle 32|V|23\rangle  =$& $ (73008Z)/9765625$ & $\langle 32|V|31\rangle  =$& $ (37826560\sqrt{2}Z)/22024729467$ \\
$\langle 32|V|32\rangle  =$& $ (32857Z)/390625$ & $\langle 32|V|33\rangle  =$& $ (6890942464\sqrt{2/3}Z)/1210689028125$ \\
$\langle 33|V|11\rangle  =$& $ (189Z)/32768$ & $\langle 33|V|12\rangle  =$& $ (1216512\sqrt{2}Z)/815730721$ \\
$\langle 33|V|13\rangle  =$& $ (617Z)/(314928\sqrt{3})$ & $\langle 33|V|21\rangle  =$& $ (1216512\sqrt{2}Z)/815730721$ \\
$\langle 33|V|22\rangle  =$& $ (73008Z)/9765625$ & $\langle 33|V|23\rangle  =$& $ (6890942464\sqrt{2/3}Z)/1210689028125$ \\
$\langle 33|V|31\rangle  =$& $ (617Z)/(314928\sqrt{3})$ &$\langle 33|V|32\rangle  =$& $ (6890942464\sqrt{2/3}Z)/1210689028125$ \\
$\langle 33|V|33\rangle  =$& $ (17Z)/256$ & & \\ \hline
\end{tabular}
\end{table}



\end{document}




