Morten Hjorth-Jensen, National Superconducting Cyclotron Laboratory and Department of Physics and Astronomy, Michigan State University, East Lansing, MI 48824, USA and Department of Physics, University of Oslo, Oslo, Norway
Date: Jan 16, 2020
Copyright 2013-2020, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license
Large-scale diagonalization (Iterative methods, Lanczo's method, dimensionalities $10^{10}$ states)
Coupled cluster theory, favoured method in quantum chemistry, molecular and atomic physics. Applications to ab initio calculations in nuclear physics as well for large nuclei
Perturbative many-body methods
Density functional theories/Mean-field theory and Hartree-Fock theory
Monte-Carlo methods (Only in FYS4411, Computational quantum mechanics)
Green's function theories
and other. The physics of the system hints at which many-body methods to use.
Blaizot and Ripka, Quantum Theory of Finite systems, MIT press 1986
Negele and Orland, Quantum Many-Particle Systems, Addison-Wesley, 1987.
Fetter and Walecka, Quantum Theory of Many-Particle Systems, McGraw-Hill, 1971.
Helgaker, Jorgensen and Olsen, Molecular Electronic Structure Theory, Wiley, 2001.
Mattuck, Guide to Feynman Diagrams in the Many-Body Problem, Dover, 1971.
Dickhoff and Van Neck, Many-Body Theory Exposed, World Scientific, 2006.
An operator is defined as $\hat{O}$ throughout. Unless otherwise specified the number of particles is always $N$ and $d$ is the dimension of the system. In nuclear physics we normally define the total number of particles to be $A=N+Z$, where $N$ is total number of neutrons and $Z$ the total number of protons. In case of other baryons such isobars $\Delta$ or various hyperons such as $\Lambda$ or $\Sigma$, one needs to add their definitions. Hereafter, $N$ is reserved for the total number of particles, unless otherwise specificied.
The quantum numbers of a single-particle state in coordinate space are defined by the variable
where
with $d=1,2,3$ represents the spatial coordinates and $\sigma$ is the eigenspin of the particle. For fermions with eigenspin $1/2$ this means that
and the integral $\int dx = \sum_{\sigma}\int d^dr = \sum_{\sigma}\int d\boldsymbol{r}$, and
with $x_i=(\boldsymbol{r}_i,\sigma_i)$ and the projection of $\sigma_i$ takes the values $\{-1/2,+1/2\}$ for particles with spin $1/2$. We will hereafter always refer to $\Psi_{\lambda}$ as the exact wave function, and if the ground state is not degenerate we label it as
with
where the single-particle Hilbert space $\hat{H}_1$ is the space of square integrable functions over $\in {\mathbb{R}}^{d}\oplus (\sigma)$ resulting in
Our Hamiltonian is invariant under the permutation (interchange) of two particles. Since we deal with fermions however, the total wave function is antisymmetric. Let $\hat{P}$ be an operator which interchanges two particles. Due to the symmetries we have ascribed to our Hamiltonian, this operator commutes with the total Hamiltonian,
meaning that $\Psi_{\lambda}(x_1, x_2, \dots , x_N)$ is an eigenfunction of $\hat{P}$ as well, that is
where $\beta$ is the eigenvalue of $\hat{P}$. We have introduced the suffix $ij$ in order to indicate that we permute particles $i$ and $j$. The Pauli principle tells us that the total wave function for a system of fermions has to be antisymmetric, resulting in the eigenvalue $\beta = -1$.
The Schrodinger equation reads
where the vector $x_i$ represents the coordinates (spatial and spin) of particle $i$, $\lambda$ stands for all the quantum numbers needed to classify a given $N$-particle state and $\Psi_{\lambda}$ is the pertaining eigenfunction. Throughout this course, $\Psi$ refers to the exact eigenfunction, unless otherwise stated.
We write the Hamilton operator, or Hamiltonian, in a generic way
where $\hat{T}$ represents the kinetic energy of the system
while the operator $\hat{V}$ for the potential energy is given by
Hereafter we use natural units, viz. $\hbar=c=e=1$, with $e$ the elementary charge and $c$ the speed of light. This means that momenta and masses have dimension energy.
If one does quantum chemistry, after having introduced the Born-Oppenheimer approximation which effectively freezes out the nucleonic degrees of freedom, the Hamiltonian for $N=n_e$ electrons takes the following form
where we have defined
and
The first term of Eq. (3), $H_0$, is the sum of the $N$ one-body Hamiltonians $\hat{h}_0$. Each individual Hamiltonian $\hat{h}_0$ contains the kinetic energy operator of an electron and its potential energy due to the attraction of the nucleus. The second term, $H_I$, is the sum of the $n_e(n_e-1)/2$ two-body interactions between each pair of electrons. Note that the double sum carries a restriction $i < j$.
The potential energy term due to the attraction of the nucleus defines the onebody field $u_i=u_{\mathrm{ext}}(x_i)$ of Eq. (2).
We have moved this term into the $\hat{H}_0$ part of the Hamiltonian, instead of keeping it in $\hat{V}$ as in Eq. (2).
The reason is that we will hereafter treat $\hat{H}_0$ as our non-interacting Hamiltonian. For a many-body wavefunction $\Phi_{\lambda}$ defined by an
appropriate single-particle basis, we may solve exactly the non-interacting eigenvalue problem
with $w_{\lambda}$ being the non-interacting energy. This energy is defined by the sum over single-particle energies to be defined below. For atoms the single-particle energies could be the hydrogen-like single-particle energies corrected for the charge $Z$. For nuclei and quantum dots, these energies could be given by the harmonic oscillator in three and two dimensions, respectively.
We will assume that the interacting part of the Hamiltonian can be approximated by a two-body interaction. This means that our Hamiltonian is written as
with
The onebody part $u_{\mathrm{ext}}(x_i)$ is normally approximated by a harmonic oscillator potential or the Coulomb interaction an electron feels from the nucleus. However, other potentials are fully possible, such as one derived from the self-consistent solution of the Hartree-Fock equations.
Our Hamiltonian is invariant under the permutation (interchange) of two particles. % (exercise here, prove it) Since we deal with fermions however, the total wave function is antisymmetric. Let $\hat{P}$ be an operator which interchanges two particles. Due to the symmetries we have ascribed to our Hamiltonian, this operator commutes with the total Hamiltonian,
meaning that $\Psi_{\lambda}(x_1, x_2, \dots , x_N)$ is an eigenfunction of $\hat{P}$ as well, that is
where $\beta$ is the eigenvalue of $\hat{P}$. We have introduced the suffix $ij$ in order to indicate that we permute particles $i$ and $j$. The Pauli principle tells us that the total wave function for a system of fermions has to be antisymmetric, resulting in the eigenvalue $\beta = -1$.
In our case we assume that we can approximate the exact eigenfunction with a Slater determinant
where $x_i$ stand for the coordinates and spin values of a particle $i$ and $\alpha,\beta,\dots, \gamma$ are quantum numbers needed to describe remaining quantum numbers.
The single-particle function $\psi_{\alpha}(x_i)$ are eigenfunctions of the onebody Hamiltonian $h_i$, that is
with eigenvalues
The energies $\varepsilon_{\alpha}$ are the so-called non-interacting single-particle energies, or unperturbed energies. The total energy is in this case the sum over all single-particle energies, if no two-body or more complicated many-body interactions are present.
Let us denote the ground state energy by $E_0$. According to the variational principle we have
where $\Phi$ is a trial function which we assume to be normalized
where we have used the shorthand $d\mathbf{\tau}=d\mathbf{r}_1d\mathbf{r}_2\dots d\mathbf{r}_N$.
Before we proceed with a more compact representation of a Slater determinant, we would like to repeat some linear algebra properties which will be useful for our derivations of the energy as function of a Slater determinant, Hartree-Fock theory and later the nuclear shell model.
The inverse of a matrix is defined by
A unitary matrix $\mathbf{A}$ is one whose inverse is its adjoint
A real unitary matrix is called orthogonal and its inverse is equal to its transpose. A hermitian matrix is its own self-adjoint, that is
Matrix Properties Reminder
Relations | Name | matrix elements |
---|---|---|
$A = A^{T}$ | symmetric | $a_{ij} = a_{ji}$ |
$A = \left (A^{T} \right )^{-1}$ | real orthogonal | $\sum_k a_{ik} a_{jk} = \sum_k a_{ki} a_{kj} = \delta_{ij}$ |
$A = A^{ * }$ | real matrix | $a_{ij} = a_{ij}^{ * }$ |
$A = A^{\dagger}$ | hermitian | $a_{ij} = a_{ji}^{ * }$ |
$A = \left (A^{\dagger} \right )^{-1}$ | unitary | $\sum_k a_{ik} a_{jk}^{ * } = \sum_k a_{ki}^{ * } a_{kj} = \delta_{ij}$ |
If we deal with Fermions (identical and indistinguishable particles) we will form an ansatz for a given state in terms of so-called Slater determinants determined by a chosen basis of single-particle functions.
For a given $n\times n$ matrix $\mathbf{A}$ we can write its determinant
in a more compact form as
where $\hat{P}_i$ is a permutation operator which permutes the column indices $1,2,3,\dots,n$ and the sum runs over all $n!$ permutations. The quantity $p_i$ represents the number of transpositions of column indices that are needed in order to bring a given permutation back to its initial ordering, in our case given by $a_{11}a_{22}\dots a_{nn}$ here.
A simple $2\times 2$ determinant illustrates this. We have
where in the last term we have interchanged the column indices $1$ and $2$. The natural ordering we have chosen is $a_{11}a_{22}$.
With the above we can rewrite our Slater determinant in a more compact form. In the Hartree-Fock method the trial function is the Slater determinant of Eq. (7) which can be rewritten as
with $p$ standing for the number of permutations. We have introduced for later use the so-called Hartree-function, defined by the simple product of all possible single-particle functions
Furthermore, $\hat{A}$ satisfies
is readily reduced to
Orthogonality of the single-particle functions allows us to further simplify the integral, and we arrive at the following expression for the expectation values of the sum of one-body Hamiltonians
and rewrite Eq. (11) as
which reduces to
The first term is the so-called direct term. It is frequently also called the Hartree term, while the second is due to the Pauli principle and is called the exchange term or just the Fock term. The factor $1/2$ is introduced because we now run over all pairs twice.
The last equation allows us to introduce some further definitions.
The single-particle wave functions $\psi_{\mu}(x)$, defined by the quantum numbers $\mu$ and $x$
are defined as the overlap
and
or for a general matrix element
It has the symmetry property
With these notations we rewrite Eq. (14) as
which we will use as our starting point for the Hartree-Fock calculations.
Hartree-Fock (HF) theory is an algorithm for finding an approximative expression for the ground state of a given Hamiltonian. The basic ingredients are
with the Hartree-Fock Hamiltonian defined as
The term $\hat{u}^{\mathrm{HF}}$ is a single-particle potential to be determined by the HF algorithm.
that is to find a local minimum with a Slater determinant $\Phi_0$ being the ansatz for the ground state.
We will show that the Hartree-Fock Hamiltonian $\hat{h}^{\mathrm{HF}}$ equals our definition of the operator $\hat{f}$ discussed in connection with the new definition of the normal-ordered Hamiltonian (see later lectures), that is we have, for a specific matrix element
meaning that
The so-called Hartree-Fock potential $\hat{u}^{\mathrm{HF}}$ brings an explicit medium dependence due to the summation over all single-particle states below the Fermi level $F$. It brings also in an explicit dependence on the two-body interaction (in nuclear physics we can also have complicated three- or higher-body forces). The two-body interaction, with its contribution from the other bystanding fermions, creates an effective mean field in which a given fermion moves, in addition to the external potential $\hat{u}_{\mathrm{ext}}$ which confines the motion of the fermion. For systems like nuclei, there is no external confining potential. Nuclei are examples of self-bound systems, where the binding arises due to the intrinsic nature of the strong force. For nuclear systems thus, there would be no external one-body potential in the Hartree-Fock Hamiltonian.
We will deal only with systems where all possible single-particle states below a certain level are filled up. Such systems are called closed shell systems, a naming inspired from atomic and nuclear physics. These closed shell systems define what is frequently named magic numbers. Quantum dots exhibit also magic numbers, meaning that the addition or removal of one eletron requires more energy than systems where the lowest-lying shells are not filled. Using the harmonic oscillator in two dimensions as basis functions (with degenerate single-particle energies) the magic numbers are $N=2$, $N=6$, $N=12$, $N=20$ etc, where $N$ is the number of electrons. See the table below for more details.
We write our Hamiltonian as a one-body part
and an interacting part
The unperturbed part of the Hamiltonian yields the single-particle energies
the normalized solution for the angular part in two dimensions is
The total wavefunction must satisfy the physical condition that $\psi(r,\theta) = \psi(r,\theta+2\pi)$ This makes a restriction on the quantum number $m$ which can take integral values
The solution of the radial equation is
Here the subscript $n$ denote the principal quantum number, and $m$ is the angular momentum number
$L_n^{|m|}$ is the associated Laguerre polynomials discussed above, and $\beta$ is defined as
with the eigenvalue
which is the same as the energy with cartesian coordinates but now in terms of $n_x$ and $n_y$, that is
The program is based on the analytical expression given by Anisimova and Matulis. It returns the value of the integral (without checking for spin values, you need to add this test) using as input the quantum numbers $n_i$ and $m_i$, that is
and the main code is (click on the above link for the full code)
#include "Coulomb_Functions.hpp"
int main(int argc, char * argv[])
{
if(argc != 10){ std::cerr << "Wrong Input: should be ./QD_Coulomb hw n1 ml1 n2 ml2 n3 ml3 n4 ml4" << std::endl; exit(1); }
double hw = std::atof(argv[1]);
int n1 = std::atoi(argv[2]);
int ml1 = std::atoi(argv[3]);
int n2 = std::atoi(argv[4]);
int ml2 = std::atoi(argv[5]);
int n3 = std::atoi(argv[6]);
int ml3 = std::atoi(argv[7]);
int n4 = std::atoi(argv[8]);
int ml4 = std::atoi(argv[9]);
double TBME = Coulomb_HO(hw, n1, ml1, n2, ml2, n3, ml3, n4, ml4);
std::cout << std::setprecision(12);
std::cout << "< " << n1 << "," << ml1 << " ; " << n2 << "," << ml2 << " || V || " << n3 << "," << ml3 << " ; " << n4 << "," << ml4 << " > = " << TBME << std::endl;
return 0;
}
you need to take into account that there are conserved two-electron quantum numbers since the Hamiltonian is invariant under rotations, namely
and the total spin projection which is not included in the above code. You need to add this as a test, that is check that
Finally, you need to ensure that the single-particle spinors satisfy $\sigma_p=\sigma_r$ and $\sigma_q=\sigma_s$. Pay in particular attention to this when you compute the exchange matrix elements.
The calculus of variations involves problems where the quantity to be minimized or maximized is an integral.
In the general case we have an integral of the type
where $E$ is the quantity which is sought minimized or maximized. The problem is that although $f$ is a function of the variables $\Phi$, $\partial \Phi/\partial x$ and $x$, the exact dependence of $\Phi$ on $x$ is not known. This means again that even though the integral has fixed limits $a$ and $b$, the path of integration is not known. In our case the unknown quantities are the single-particle wave functions and we wish to choose an integration path which makes the functional $E[\Phi]$ stationary. This means that we want to find minima, or maxima or saddle points. In physics we search normally for minima. Our task is therefore to find the minimum of $E[\Phi]$ so that its variation $\delta E$ is zero subject to specific constraints. In our case the constraints appear as the integral which expresses the orthogonality of the single-particle wave functions. The constraints can be treated via the technique of Lagrangian multipliers
Let us specialize to the expectation value of the energy for one particle in three-dimensions. This expectation value reads
with the constraint
and a Hamiltonian
We will, for the sake of notational convenience, skip the variables $x,y,z$ below, and write for example $V(x,y,z)=V$.
The integral involving the kinetic energy can be written as, with the function $\psi$ vanishing strongly for large values of $x,y,z$ (given here by the limits $a$ and $b$),
We will drop the limits $a$ and $b$ in the remaining discussion. Inserting this expression into the expectation value for the energy and taking the variational minimum we obtain
and multiplying with a Lagrangian multiplier $\lambda$ and taking the variational minimum we obtain the final variational equation
We introduce the function $f$
which results in
We can then identify the Lagrangian multiplier as the energy of the system. The last equation is nothing but the standard Schroedinger equation and the variational approach discussed here provides a powerful method for obtaining approximate solutions of the wave function.
In deriving the Hartree-Fock equations, we will expand the single-particle functions in a known basis and vary the coefficients, that is, the new single-particle wave function is written as a linear expansion in terms of a fixed chosen orthogonal basis (for example the well-known harmonic oscillator functions or the hydrogen-like functions etc). We define our new Hartree-Fock single-particle basis by performing a unitary transformation on our previous basis (labelled with greek indices) as
In this case we vary the coefficients $C_{p\lambda}$. If the basis has infinitely many solutions, we need to truncate the above sum. We assume that the basis $\phi_{\lambda}$ is orthogonal. A unitary transformation keeps the orthogonality, as discussed in exercise 1 below.
In the previous slide we stated that a unitary transformation keeps the orthogonality, as discussed in exercise 1 below. To see this consider first a basis of vectors $\mathbf{v}_i$,
We assume that the basis is orthogonal, that is
An orthogonal or unitary transformation
preserves the dot product and orthogonality since
orthogonality is preserved, that is $\langle \alpha \vert \beta\rangle = \delta_{\alpha\beta}$ and $\langle p \vert q\rangle = \delta_{pq}$.
This propertry is extremely useful when we build up a basis of many-body Stater determinant based states.
Note also that although a basis $\vert \alpha\rangle$ contains an infinity of states, for practical calculations we have always to make some truncations.
Before we develop the Hartree-Fock equations, there is another very useful property of determinants that we will use both in connection with Hartree-Fock calculations and later shell-model calculations.
Consider the following determinant
where $det(\mathbf{C})$ and $det(\mathbf{B})$ are the determinants of $n\times n$ matrices
with elements $c_{ij}$ and $b_{ij}$ respectively.
This is a property we will use in our Hartree-Fock discussions. Convince yourself about the correctness of the above expression by setting $n=2$.
With our definition of the new basis in terms of an orthogonal basis we have
If the coefficients $C_{p\lambda}$ belong to an orthogonal or unitary matrix, the new basis is also orthogonal. Our Slater determinant in the new basis $\psi_p(x)$ is written as
which is nothing but $det(\mathbf{C})det(\Phi)$, with $det(\Phi)$ being the determinant given by the basis functions $\phi_{\lambda}(x)$.
It is normal to choose a single-particle basis defined as the eigenfunctions of parts of the full Hamiltonian. The typical situation consists of the solutions of the one-body part of the Hamiltonian, that is we have
The single-particle wave functions $\phi_{\lambda}(\boldsymbol{r})$, defined by the quantum numbers $\lambda$ and $\boldsymbol{r}$ are defined as the overlap
In our discussions hereafter we will use our definitions of single-particle states above and below the Fermi ($F$) level given by the labels $ijkl\dots \le F$ for so-called single-hole states and $abcd\dots > F$ for so-called particle states. For general single-particle states we employ the labels $pqrs\dots$.
In Eq. (16), restated here
we found the expression for the energy functional in terms of the basis function $\phi_{\lambda}(\boldsymbol{r})$. We then varied the above energy functional with respect to the basis functions $|\mu \rangle$. Now we are interested in defining a new basis defined in terms of a chosen basis as defined in Eq. (23). We can then rewrite the energy functional as
We wish now to minimize the above functional. We introduce again a set of Lagrange multipliers, noting that since $\langle i | j \rangle = \delta_{i,j}$ and $\langle \alpha | \beta \rangle = \delta_{\alpha,\beta}$, the coefficients $C_{i\gamma}$ obey the relation
which allows us to define a functional to be minimized that reads
which yields for every single-particle state $i$ and index $\alpha$ (recalling that the coefficients $C_{i\alpha}$ are matrix elements of a unitary (or orthogonal for a real symmetric matrix) matrix) the following Hartree-Fock equations
we can rewrite the new equations as
The latter is nothing but a standard eigenvalue problem.
It suffices to tabulate the matrix elements $\langle \alpha | h | \beta \rangle$ and $\langle \alpha\gamma|\hat{v}|\beta\delta\rangle_{AS}$ once and for all. Successive iterations require thus only a look-up in tables over one-body and two-body matrix elements. These details will be discussed below when we solve the Hartree-Fock equations numerically.
Our Hartree-Fock matrix is thus
The Hartree-Fock equations are solved in an iterative waym starting with a guess for the coefficients $C_{j\gamma}=\delta_{j,\gamma}$ and solving the equations by diagonalization till the new single-particle energies $\epsilon_i^{\mathrm{HF}}$ do not change anymore by a prefixed quantity.
Normally we assume that the single-particle basis $|\beta\rangle$ forms an eigenbasis for the operator $\hat{h}_0$, meaning that the Hartree-Fock matrix becomes
The Hartree-Fock eigenvalue problem
can be written out in a more compact form as
The Hartree-Fock equations are, in their simplest form, solved in an iterative way, starting with a guess for the coefficients $C_{i\alpha}$. We label the coefficients as $C_{i\alpha}^{(n)}$, where the subscript $n$ stands for iteration $n$. To set up the algorithm we can proceed as follows:
We start with a guess $C_{i\alpha}^{(0)}=\delta_{i,\alpha}$. Alternatively, we could have used random starting values as long as the vectors are normalized. Another possibility is to give states below the Fermi level a larger weight.
The Hartree-Fock matrix simplifies then to (assuming that the coefficients $C_{i\alpha} $ are real)
The diagonalization with the new Hartree-Fock potential yields new eigenvectors and eigenvalues. This process is continued till for example
where $\lambda$ is a user prefixed quantity ($\lambda \sim 10^{-8}$ or smaller) and $p$ runs over all calculated single-particle energies and $m$ is the number of single-particle states.
We can rewrite the ground state energy by adding and subtracting $\hat{u}^{HF}(x_i)$
which results in
Our single-particle states $ijk\dots$ are now single-particle states obtained from the solution of the Hartree-Fock equations.
Using our definition of the Hartree-Fock single-particle energies we obtain then the following expression for the total ground-state energy
where $\Phi^{\mathrm{HF}}(N)$ is the new Slater determinant defined by the new basis of Eq. (23) for $N$ electrons (same $Z$). If we assume that the single-particle wave functions in the new basis do not change when we remove one electron or add one electron, we can then define the corresponding energy for the $N-1$ systems as
we obtain
which is just our definition of the Hartree-Fock single-particle energy
These two equations can thus be used to the electron affinity or ionization energies, respectively. Koopman's theorem states that for example the ionization energy of a closed-shell system is given by the energy of the highest occupied single-particle state. If we assume that changing the number of electrons from $N$ to $N+1$ does not change the Hartree-Fock single-particle energies and eigenfunctions, then Koopman's theorem simply states that the ionization energy of an atom is given by the single-particle energy of the last bound state. In a similar way, we can also define the electron affinities.
As an example, consider a simple model for atomic sodium, Na. Neutral sodium has eleven electrons, with the weakest bound one being confined the $3s$ single-particle quantum numbers. The energy needed to remove an electron from neutral sodium is rather small, 5.1391 eV, a feature which pertains to all alkali metals. Having performed a Hartree-Fock calculation for neutral sodium would then allows us to compute the ionization energy by using the single-particle energy for the $3s$ states, namely $\epsilon_{3s}^{\mathrm{HF}}$.
From these considerations, we see that Hartree-Fock theory allows us to make a connection between experimental
observables (here ionization and affinity energies) and the underlying interactions between particles.
In this sense, we are now linking the dynamics and structure of a many-body system with the laws of motion which govern the system. Our approach is a reductionistic one, meaning that we want to understand the laws of motion
in terms of the particles or degrees of freedom which we believe are the fundamental ones. Our Slater determinant, being constructed as the product of various single-particle functions, follows this philosophy.
The Hamiltonian for a system of $N$ electrons confined in a harmonic potential reads
with $\hat{V}_{ij}$ is the two-body potential whose matrix elements are calculated on fly in your program. See expression below.
The Hartree-Fock algorithm can be broken down as follows. We recall that our Hartree-Fock matrix is
Normally we assume that the single-particle basis $\vert\beta\rangle$ forms an eigenbasis for the operator $\hat{h}_0$ (this is our case), meaning that the Hartree-Fock matrix becomes
The Hartree-Fock eigenvalue problem
can be written out in a more compact form as
The equations are often rewritten in terms of a so-called density matrix, which is defined as
It means that we can rewrite the Hartree-Fock Hamiltonian as
It is convenient to use the density matrix since we can precalculate in every iteration the product of two eigenvector components $C$.
Here we show a simple code in python for a Hartree-Fock calculation using precalculated matrix elements.
In [1]:
import numpy as np
from decimal import Decimal
# expectation value for the one body part, Harmonic oscillator in three dimensions
def onebody(i, n, l):
homega = 10.0
return homega*(2*n[i] + l[i] + 1.5)
if __name__ == '__main__':
Nparticles = 16
""" Read quantum numbers from file """
index = []
n = []
l = []
j = []
mj = []
tz = []
spOrbitals = 0
with open("nucleispnumbers.dat", "r") as qnumfile:
for line in qnumfile:
nums = line.split()
if len(nums) != 0:
index.append(int(nums[0]))
n.append(int(nums[1]))
l.append(int(nums[2]))
j.append(int(nums[3]))
mj.append(int(nums[4]))
tz.append(int(nums[5]))
spOrbitals += 1
""" Read two-nucleon interaction elements (integrals) from file, brute force 4-dim array """
nninteraction = np.zeros([spOrbitals, spOrbitals, spOrbitals, spOrbitals])
with open("nucleitwobody.dat", "r") as infile:
for line in infile:
number = line.split()
a = int(number[0]) - 1
b = int(number[1]) - 1
c = int(number[2]) - 1
d = int(number[3]) - 1
#print a, b, c, d, float(l[4])
nninteraction[a][b][c][d] = Decimal(number[4])
""" Set up single-particle integral """
singleparticleH = np.zeros(spOrbitals)
for i in range(spOrbitals):
singleparticleH[i] = Decimal(onebody(i, n, l))
""" Star HF-iterations, preparing variables and density matrix """
""" Coefficients for setting up density matrix, assuming only one along the diagonals """
C = np.eye(spOrbitals) # HF coefficients
DensityMatrix = np.zeros([spOrbitals,spOrbitals])
for gamma in range(spOrbitals):
for delta in range(spOrbitals):
sum = 0.0
for i in range(Nparticles):
sum += C[gamma][i]*C[delta][i]
DensityMatrix[gamma][delta] = Decimal(sum)
maxHFiter = 100
epsilon = 1.0e-5
difference = 1.0
hf_count = 0
oldenergies = np.zeros(spOrbitals)
newenergies = np.zeros(spOrbitals)
while hf_count < maxHFiter and difference > epsilon:
print "############### Iteration %i ###############" % hf_count
HFmatrix = np.zeros([spOrbitals,spOrbitals])
for alpha in range(spOrbitals):
for beta in range(spOrbitals):
""" If tests for three-dimensional systems, including isospin conservation """
if l[alpha] != l[beta] and j[alpha] != j[beta] and mj[alpha] != mj[beta] and tz[alpha] != tz[beta]: continue
""" Setting up the Fock matrix using the density matrix and antisymmetrized NN interaction in m-scheme """
sumFockTerm = 0.0
for gamma in range(spOrbitals):
for delta in range(spOrbitals):
if (mj[alpha]+mj[gamma]) != (mj[beta]+mj[delta]) and (tz[alpha]+tz[gamma]) != (tz[beta]+tz[delta]): continue
sumFockTerm += DensityMatrix[gamma][delta]*nninteraction[alpha][gamma][beta][delta]
HFmatrix[alpha][beta] = Decimal(sumFockTerm)
""" Adding the one-body term, here plain harmonic oscillator """
if beta == alpha: HFmatrix[alpha][alpha] += singleparticleH[alpha]
spenergies, C = np.linalg.eigh(HFmatrix)
""" Setting up new density matrix in m-scheme """
DensityMatrix = np.zeros([spOrbitals,spOrbitals])
for gamma in range(spOrbitals):
for delta in range(spOrbitals):
sum = 0.0
for i in range(Nparticles):
sum += C[gamma][i]*C[delta][i]
DensityMatrix[gamma][delta] = Decimal(sum)
newenergies = spenergies
""" Brute force computation of difference between previous and new sp HF energies """
sum =0.0
for i in range(spOrbitals):
sum += (abs(newenergies[i]-oldenergies[i]))/spOrbitals
difference = sum
oldenergies = newenergies
print "Single-particle energies, ordering may have changed "
for i in range(spOrbitals):
print('{0:4d} {1:.4f}'.format(i, Decimal(oldenergies[i])))
hf_count += 1
In the setup of the two-body matrix elements we can typically opt between two alternatives. We can read the matrix elements from file or calculate the matrix elements on the fly. The latter requires simply that we call the abovementioned function for setting up the two-body matrix elements when we run our Hartree-Fock code.
If we however wish to read from file, we can store the matrix elements in two ways:
Brute force
Organize according to conserved two-body quantum numbers
The brute force way is easy to implement.
We can read in from file the two-body interaction matrix elements or compute once and for all and store in memory. The elements are
The time-consuming part in the Hartree-Fock calculations involves the calculation of the two-body matrix. Furthermore, the storage of these matrix elements plays also an important role, in particular we wish to access the table of matrix elements as fast as possible.
In a brute force algorithm for storing the matrix elements, if we have $d$ basis functions, we end up with the need of storing $d^4$ matrix elements. We can reduce this considerably by the following considerations. In the calculation of the two-body matrix elements $\langle pr | \hat{v}|qs\rangle$ we have the following symmetries
This reduces by a factor of eight the total number of matrix elements to be stored if we also use that we can store only for $p < q$ and $ r < s$.
Furthermore, in setting up a table for the two-body matrix elements we can convert the need of using four indices $pqrs$ of
which in a brute forces way could be coded as a four-dimensional array, to a two-dimensional array $V_{lm}$, where $l$ and $m$ stand for all possible two-body configurations $pq$.
Each number $l$ and $m$ in $V_{lm}$ should then point to a set of single-particle states $(p,q)$ and $(r,s)$.
In our case, since we have symmetries which allow us to set $p\le q$, we have, with $d$ single particle states a total of $d(d+1)/2$ two-body configurations.
How do we store such a matrix? The simplest thing to do is to convert it into a one-dimensional array. How do we achieve that?
We now have a matrix $V$ of dimension $n\times n$ and we want to store the elements $V_{lm}$ as a one-dimensional array $A$ using $0 \le l \le m \le n-1$. For
$l=0$ we have $n$ elements
$l=1$ we have $n-1$ elements
$\dots$
$l=\nu$ we have $n-\nu$ elements
$\dots$
$l=n-1$ we have $1$ element,
and the total number is
The first matrix element $V(0,0)$ is obviously given by the element $A(0)$.
We have thus reduced a four dimensional array to a one-dimensional array, where the given pairs $(p,q)$ and $(r,s)$ point to the matrix indices $l$ and $m$, respectively. The latter are used to find the explicit number $\mathrm{number}(l,m)$ which points to the desired matrix element stored in a one-dimensional array.
Another way to store the matrix elements is to organize the matrix elements according to conserved quantum numbers. This means setting up a block structure and to look up matrix elements using two-body conserved quantum numbers. For quantum dots, the two-body quantum numbers that are conserved are The total orbital momentum projection
and the total spin projection
For 2 shells we have
In developing our Hartree-Fock code, we can define a configuration class with the following mapping for a single-particle state
and a similar mapping for a two-body state
where $M$ is the total angualar momentum
and the $M_s$ is the total spin
with
The two-body matrix elements are diagonal in the $M$ and $M_s$, that is
We list here some selected Hartree-Fock results for $N=6$ electrons as function of the number of major shells $R$ included. Here we have $\omega =1$ a.u.
We list here some selected Hartree-Fock results for $N=6$ electrons as function of the number of major shells $R$ included. Here we have $\omega =0.1$ a.u.