How to convert from spin orbitals to spatial orbitals in the Hartree-Fock approximation?

I need to calculate some of the more complicated self-energy terms from chapter 7 of Szabo and Ostlund's "Modern Quantum Chemistry", and I'm having trouble converting summations from spin orbitals to spatial orbitals.


Exercise 2.18 (page 85) is indicative of what I'm doing wrong, since I can't get the correct answer.


The exercise is to show that the leading correction to the Hartree-Fock ground state energy


$$
E\_0^2 = \frac{1}{4} \sum\_{abrs} \frac{|\langle ab || rs \rangle |^2}
{\varepsilon\_a + \varepsilon\_b - \varepsilon\_r - \varepsilon\_s}
$$


where the summation is over spin orbitals ($a$, $b$ over occupieds, $r$, $s$ over virtuals), can be converted to the following sum over spatial orbitals:


$$
E\_0^2 =
\sum\_{a,b=1}^{N/2} \sum\_{r,s=N/2+1}^{K}
\frac{ \langle ab | rs \rangle (2 \langle rs | ab \rangle - \langle rs | ba \rangle)}
{\varepsilon\_a + \varepsilon\_b - \varepsilon\_r - \varepsilon\_s}
$$


The integrals are in "physicists notation", which means that


$$
\langle ij|kl \rangle =
\int \chi\_{i}^\*(\mathbf{x}\_1) \chi\_{j}^\*(\mathbf{x}\_2) r\_{12}^{-1}
 \chi\_{k}(\mathbf{x}\_1) \chi\_{l}(\mathbf{x}\_2) \,\mathrm{d}\mathbf{x}\_1 \,\mathrm{d}\mathbf{x}\_2
$$


and


$$
\langle ij||kl \rangle = \langle ij | kl \rangle - \langle ij | lk \rangle
$$


where the $\chi\_i$ are spin orbitals and the variables $\mathbf{x}$ comprise both spatial and spin coordinates.


The following is what I have, I'd appreciate any pointers to get to the right answer.


First, decompose the sum into the different possible permutations of spin for the different orbitals ($a$ and $\bar{a}$ are orbitals with opposite spin), and use the definition of $\langle ab || rs \rangle$:


$$\begin{align}
E\_0^2 &=\frac{1}{4}\Bigg(
\sum\_{a,b=1}^{N/2} \sum\_{r,s=N/2+1}^{K}
\frac{ |\langle ab|rs \rangle - \langle ab|sr \rangle |^2}
{\varepsilon\_a + \varepsilon\_b - \varepsilon\_r - \varepsilon\_s}
+\sum\_{a,b=1}^{N/2} \sum\_{r,s=N/2+1}^{K}
\frac{ |\langle \bar{a}\bar{b}|rs \rangle - \langle \bar{a}\bar{b}|sr \rangle |^2}
{\varepsilon\_a + \varepsilon\_b - \varepsilon\_r - \varepsilon\_s}
\\&\qquad\quad
+\sum\_{a,b=1}^{N/2} \sum\_{r,s=N/2+1}^{K}
\frac{ |\langle \bar{a}b|\bar{r}s \rangle - \langle \bar{a}b|s\bar{r} \rangle |^2}
{\varepsilon\_a + \varepsilon\_b - \varepsilon\_r - \varepsilon\_s}
+\sum\_{a,b=1}^{N/2} \sum\_{r,s=N/2+1}^{K}
\frac{ |\langle \bar{a}b|r\bar{s} \rangle - \langle \bar{a}b|\bar{s}r \rangle |^2}
{\varepsilon\_a + \varepsilon\_b - \varepsilon\_r - \varepsilon\_s}
\\&\qquad\quad
+\sum\_{a,b=1}^{N/2} \sum\_{r,s=N/2+1}^{K}
\frac{ |\langle a\bar{b}|\bar{r}s \rangle - \langle a\bar{b}|s\bar{r} \rangle |^2}
{\varepsilon\_a + \varepsilon\_b - \varepsilon\_r - \varepsilon\_s}
+\sum\_{a,b=1}^{N/2} \sum\_{r,s=N/2+1}^{K}
\frac{ |\langle a\bar{b}|r\bar{s} \rangle - \langle a\bar{b}|\bar{s}r \rangle |^2}
{\varepsilon\_a + \varepsilon\_b - \varepsilon\_r - \varepsilon\_s}
\\&\qquad\quad
+\sum\_{a,b=1}^{N/2} \sum\_{r,s=N/2+1}^{K}
\frac{ |\langle ab|\bar{r}\bar{s} \rangle - \langle ab|\bar{s}\bar{r} \rangle |^2}
{\varepsilon\_a + \varepsilon\_b - \varepsilon\_r - \varepsilon\_s}
+\sum\_{a,b=1}^{N/2} \sum\_{r,s=N/2+1}^{K}
\frac{ |\langle \bar{a}\bar{b}|\bar{r}\bar{s} \rangle - \langle \bar{a}\bar{b}|\bar{s}\bar{r} \rangle |^2}
{\varepsilon\_a + \varepsilon\_b - \varepsilon\_r - \varepsilon\_s}
\Bigg)
\end{align}$$


Note that we do not need to consider terms with odd numbers of orbitals of either spin, since terms of the form $\langle \bar{i}j|kl \rangle$ and $\langle i\bar{j}|\bar{k}\bar{l}\rangle$ are zero.


Next, we use the additional rules $\langle \bar{i}j|k\bar{l}\rangle$ = $\langle i\bar{j}|\bar{k}l \rangle$ = $\langle \bar{i}\bar{j}|kl \rangle$ = $\langle ij|\bar{k}\bar{l}\rangle$ = $0$.


We see that in the above eight summations, the second and seventh cancel completely, while in the middle four, only one term is retained.


Then, expanding the squares and collecting terms, we get


$$\begin{align}
E\_0^2 &=\frac{1}{4}\Bigg(\quad
4\sum\_{a,b=1}^{N/2} \sum\_{r,s=N/2+1}^{K}
\frac{ |\langle ab|rs \rangle |^2}
{\varepsilon\_a + \varepsilon\_b - \varepsilon\_r - \varepsilon\_s}
\\&\qquad\quad
-4\sum\_{a,b=1}^{N/2} \sum\_{r,s=N/2+1}^{K}
\frac{ \langle ab|rs \rangle \langle ab|sr \rangle }
{\varepsilon\_a + \varepsilon\_b - \varepsilon\_r - \varepsilon\_s}
\\&\qquad\quad
+4\sum\_{a,b=1}^{N/2} \sum\_{r,s=N/2+1}^{K}
\frac{ |\langle ab|sr \rangle |^2}
{\varepsilon\_a + \varepsilon\_b - \varepsilon\_r - \varepsilon\_s}
\Bigg)
\end{align}$$


which is where I'm stuck (besides of course cancelling out the factor 4). Any help in moving towards the correct answer is massively appreciated!





> 
> 
> > 
> > *Technical Note: This page makes heavy use of MathJax, **give it time to load**.*
> > 
> > 
> > 
> 
> 
> 


$
%some shortcuts
\newcommand{\op}[1]{\mathbf{#1}}
\newcommand{\ve}[1]{\mathbf{#1}}
\newcommand{\id}[1]{\mathrm{#1}}
\newcommand{\bra}[1]{\left\langle#1\right|}
\newcommand{\ket}[1]{\left|#1\right\rangle}
\newcommand{\bracket}[2]{\left\langle#1\middle|#2\right\rangle}
\newcommand{\diff}{\mathrm{d}}
\newcommand{\eps}[1]{\varepsilon\_{#1}}
$


### Preamble


I need to get this out of the way first. While I think the exercises in Szabo-Ostlund are a great way to learn maths and understand how lazy chemists and physicists are when it comes to writing, I consider them all painful and of no particular pedagogical value. I don't think it is particular useful to explain everything with the dihydrogen model and leave the generalisation to the user. From my personal point of view, it should be the other way around. With that out of the way, I admire you for working with this manuscript.


It took me quite some time getting into this topic again and I spent various pencils and a lot of paper on it. As you mentioned, you have been doing the same. You also found that the same exercise will be given on S.O. page 352 again (6.8). Because you asked for hints, I will provide the key step as a single formula first, so that you have the chance of finding it without any help. At the end of the post I will explain the reasoning, too.


### The Goal


Let us reconsider what our exercise was:



> 
> **Exercise 2.18** (p. 85) In Chapter 6, where we consider perturbation theory, we show that the leading correction to the Hartree-Fock ground state energy is
>  $$\begin{align}
> E\_0^{(2)} &= 
>  \frac{1}{4} \sum\_{abrs} 
>  \frac{\left|\bra{ab}\ket{rs}\right|^2}
>  {\eps{a} +\eps{b} -\eps{r} -\eps{s}}
> \end{align}$$
>  Show that for a closed-shell system (where $\eps{i}=\eps{\bar{\imath}}$) this becomes
>  $$\begin{align}
> E\_0^{(2)} &= 
>  \sum\_{a,b=1}^{N/2}\quad \sum\_{r,s=N/2+1}^{K}
>  \frac{\bracket{ab}{rs} \left(2 \bracket{rs}{ab} -\bracket{rs}{ba}\right)}
>  {\eps{a} +\eps{b} -\eps{r} -\eps{s}}
> \end{align}$$
> 
> 
> 


And because it is the same but different:



> 
> **Exercise 6.8** (p 352) Derive Eqs. (6.73) and (6.74) starting with Eq. (6.72).
>  $$\begin{align}
> E\_0^{(2)} &=
>  \frac{1}{4} \sum\_{abrs} 
>  \frac{\left|\bra{ab}\ket{rs}\right|^2}
>  {\eps{a} +\eps{b} -\eps{r} -\eps{s}}
>  \tag{6.72}\\
> E\_0^{(2)} &=
>  \frac{1}{2} \sum\_{abrs} 
>  \frac{\bracket{ab}{rs}\bracket{rs}{ab}}
>  {\eps{a} +\eps{b} -\eps{r} -\eps{s}}
>  -\frac{1}{2} \sum\_{abrs} 
>  \frac{\bracket{ab}{rs}\bracket{rs}{ba}}
>  {\eps{a} +\eps{b} -\eps{r} -\eps{s}}
>  \tag{6.73}\\
> E\_0^{(2)} &=
>  2 \sum\_{abrs}^{N/2}
>  \frac{\bracket{ab}{rs}\bracket{rs}{ab}}
>  {\eps{a} +\eps{b} -\eps{r} -\eps{s}}
>  - \sum\_{abrs}^{N/2} 
>  \frac{\bracket{ab}{rs}\bracket{rs}{ba}}
>  {\eps{a} +\eps{b} -\eps{r} -\eps{s}}
>  \tag{6.74}\\
> \end{align}$$
> 
> 
> 


*Annotation: It is actually just simplified Dirac notation. There is nothing especially "physicist" about it. And even though they state otherwise I consider this lazy. (p. 350)*


The notation $\bracket{ij}{kl}$ refers to the electron ordering 1,2,1,2.  

What SO calls the chemists notation is better referred to as charge-cloud notation as the electron ordering is 1,1,2,2. It is usually denoted as $\left[ij\middle|kl\right]$.  

Therefore $\bracket{ij}{kl}=\left[ik\middle|jl\right]$.


We need the following first $$\bra{ij}\ket{kl} = \bracket{ij}{kl}-\bracket{ij}{lk}.$$


We also need to consider that the indices early in the alphabet $a,b,\dots\in\mathbb{N}$ refer to occupied orbitals, hence $a,b,\dots<N$ with $N$ being the total number of electrons. Then $r,s,\dots\in\mathbb{N}$ belong to virtual orbitals.


It is further implied that summation signs without any upper limit are considered spin orbitals and to have $N$ as an upper boundary for occupied and an arbitrary number $K$ (total number of basis functions) for virtual.


A sum with multiple indices refers to as many sum signs. $$\sum\_{ijkl} \text{terms} = \sum\_i\sum\_j\sum\_k\sum\_l \text{terms}$$


### Regular two electron integrals


I have no idea what this actually means, so I just made the assumption, that we just consider real functions. Therefore a lot of integrals will be symmetrical.
$$\bracket{ij}{kl} = \bracket{kj}{il} = \bracket{il}{kj} = \bracket{kl}{ij} =
 \bracket{ji}{lk} = \bracket{li}{jk} = \bracket{jk}{li} = \bracket{lk}{ji} $$


First of all we decode the shorthand and expand the square
$$\begin{align}
E\_0^{(2)} &= 
 \frac{1}{4} \sum\_{abrs} 
 \frac{\left|\bra{ab}\ket{rs}\right|^2}
 {\eps{a} +\eps{b} -\eps{r} -\eps{s}}
\\
E\_0^{(2)} &= 
 \frac{1}{4} \sum\_{abrs} 
 \frac{\left|\bracket{ab}{rs}-\bracket{ab}{rs}\right|^2}
 {\eps{a} +\eps{b} -\eps{r} -\eps{s}}
\tag{1}\\
E\_0^{(2)} &= 
 \frac{1}{4} \sum\_{a=1}\sum\_{b=1}\sum\_{r=N+1}\sum\_{s=N+1} 
 \\&\qquad\qquad
 \left\{
 \frac{\bracket{ab}{rs}^2}{\eps{a} +\eps{b} -\eps{r} -\eps{s}}
 + \frac{\bracket{ab}{sr}^2}{\eps{a} +\eps{b} -\eps{r} -\eps{s}}
 -2\frac{\bracket{ab}{rs}\bracket{ab}{sr}}{\eps{a} +\eps{b} -\eps{r} -\eps{s}}
 \right\}
\tag{2}\\
\end{align}$$


We can further proof that
$$\begin{multline}
 \frac{1}{4} \sum\_{a=1}\sum\_{b=1}\sum\_{r=N+1}\sum\_{s=N+1} 
 \frac{\bracket{ab}{rs}^2}{\eps{a} +\eps{b} -\eps{r} -\eps{s}}\\
=
 \frac{1}{4} \sum\_{a=1}\sum\_{b=1}\sum\_{r=N+1}\sum\_{s=N+1} 
 \frac{\bracket{ab}{sr}^2}{\eps{a} +\eps{b} -\eps{r} -\eps{s}}\tag{3}
\end{multline}$$
because $a,b=1$ and $r,s=N+1$ and the integral permutations become identical. I will explain this at the end with an example. *This is the key.* Therefore we can further reduce to
$$\begin{align}
E\_0^{(2)} &= 
 \frac{1}{4} \sum\_{a=1}\sum\_{b=1}\sum\_{r=N+1}\sum\_{s=N+1} 
 2\frac{\bracket{ab}{rs}^2}{\eps{a} +\eps{b} -\eps{r} -\eps{s}}
 \\&\qquad
 - \frac{1}{4} \sum\_{a=1}\sum\_{b=1}\sum\_{r=N+1}\sum\_{s=N+1} 
 2\frac{\bracket{ab}{rs}\bracket{ab}{sr}}{\eps{a} +\eps{b} -\eps{r} -\eps{s}}
.\tag{4}\\
\end{align}$$
We use symmetry and find (6.73)
$$\begin{align}
E\_0^{(2)} &=
 \frac{1}{2} \sum\_{abrs} 
 \frac{\bracket{ab}{rs}\bracket{rs}{ab}}
 {\eps{a} +\eps{b} -\eps{r} -\eps{s}}
 -\frac{1}{2} \sum\_{abrs} 
 \frac{\bracket{ab}{rs}\bracket{rs}{ba}}
 {\eps{a} +\eps{b} -\eps{r} -\eps{s}}
 \tag{5 $\equiv$ 6.73}\\
\end{align}$$


### Closed shell


This is what you tried first, me too. This is where short notation will gently kicks you into your derrière, pardon my French.


Let us consider the definitions for spin orbitals and spatial orbitals:
\begin{align}
\chi\_1(\ve{x}\_1) &=\psi\_1(\ve{r}\_1)\alpha(s\_1)\\
\chi\_2(\ve{x}\_2) &=\psi\_1(\ve{r}\_2)\beta(s\_2)\\
\chi\_3(\ve{x}\_3) &=\psi\_2(\ve{r}\_3)\alpha(s\_3)\\
\chi\_4(\ve{x}\_4) &=\psi\_2(\ve{r}\_4)\beta(s\_4)\\
\vdots &\qquad\vdots\\
\chi\_{N-1}(\ve{x}\_{N-1}) &=\psi\_{N/2}(\ve{r}\_{N-1})\alpha(s\_{N-1})\\
\chi\_{N}(\ve{x}\_{N}) &=\psi\_{N/2}(\ve{r}\_{N})\beta(s\_{N})\\
\vdots &\qquad\vdots\\
\end{align}


Since $a,b,\dots,r,s,\dots$ are arbitrary natural numbers it does not really matter which index we choose, but it can lead to great confusion if on the left side $a$ refers to a different number than on the right side.


Hence I choose, for a completely arbitrary number $酒$ of spinfunctions $\chi$ to represent them as a product of a spatial function $\psi$ with a spin component $\alpha,\beta$. The set of functions is therefore half the number of the complete set.
$$\sum\_{a}^{(酒)} \chi\_a = 
 \sum\_{c}^{(酒/2)}\psi\_c\alpha + \sum\_{c}^{(酒/2)}\psi\_c\beta,$$
We are basically introducing just a new name of indices to avoid confusion. I will now shorten $\psi\_c\alpha$ to $c$ and $\psi\_c\beta$ to $\bar{c}$. And this will apply analogous to all other kinds of indices. Therefore we write symbolically: 
$$\sum\_{a}^{(酒)} a = 
 \sum\_{c}^{(酒/2)}c + \sum\_{\bar{c}}^{(酒/2)}\bar{c}$$


Now we need to expand equation 5 into this formalism. We then will see that it simplifies quite a lot. Without spoiling the surprise, we can see that the number of integrals that survive spin integration is exactly twice in the first term than in the second term, just because it is symmetric.


In general we know that any integral where electron one has $alpha$ spin on the left side and $beta$ spin on the right side will be zero, hence vanish.
Therefore the integrals of the form
$$
\bracket{\bar{i}j}{kl};
\bracket{i\bar{j}}{kl};
\bracket{ij}{\bar{k}l};
\bracket{ij}{k\bar{l}};\\
\bracket{\bar{i}\bar{j}}{kl};
\bracket{ij}{\bar{k}\bar{l}};
\bracket{\bar{i}j}{k\bar{l}};
\bracket{i\bar{j}}{\bar{k}l};\\
\bracket{i\bar{j}}{\bar{k}\bar{l}};
\bracket{\bar{i}j}{\bar{k}\bar{l}};
\bracket{\bar{i}\bar{j}}{k\bar{l}};
\bracket{\bar{i}\bar{j}}{\bar{k}l};
$$
will all vanish.


I will provide the full terms at the end, so you can check your own attempt, but here is equation 5 with all non-vanishing terms. Note that we need to include the limits to the sum here, because we have expanded the spinorbitals into spatial orbitals. Because we are having a closed shell system, the number of electrons $N$ is even, while the total number of basis functions $M$ could be anything. Please also note, that I am not including the starting numbers for the indices, because it will look a bit ugly. Hence it is implied by the notation, that $a,b,c,d=1$, $r,s=N+1$ and $t,u=N/2+1$. (If we're lazy, we go [the whole nine yards](http://www.imdb.com/title/tt0190138/).)
$$\begin{align}
E\_0^{(2)} &=
 \frac{1}{2} \sum\_{abrs} 
 \frac{\bracket{ab}{rs}\bracket{rs}{ab}}
 {\eps{a} +\eps{b} -\eps{r} -\eps{s}}
 -\frac{1}{2} \sum\_{abrs} 
 \frac{\bracket{ab}{rs}\bracket{rs}{ba}}
 {\eps{a} +\eps{b} -\eps{r} -\eps{s}}
 \tag{5 $\equiv$ 6.73}\\
&=\phantom{-}\Bigg(
 \frac{1}{2} \sum\_{cd}^{N/2}\sum\_{tu}^M 
 \frac{\bracket{cd}{tu}\bracket{tu}{cd}}
 {\eps{c} +\eps{d} -\eps{t} -\eps{u}}
 +\frac{1}{2} \sum\_{\bar{c}d}^{N/2}\sum\_{\bar{t}u}^M 
 \frac{\bracket{\bar{c}d}{\bar{t}u}\bracket{\bar{t}u}{\bar{c}d}}
 {\eps{\bar{c}} +\eps{d} -\eps{\bar{t}} -\eps{u}}
\\&\phantom{=-\Bigg(}
 +\frac{1}{2} \sum\_{c\bar{d}}^{N/2}\sum\_{t\bar{u}}^M 
 \frac{\bracket{c\bar{d}}{t\bar{u}}\bracket{t\bar{u}}{c\bar{d}}}
 {\eps{c} +\eps{\bar{d}} -\eps{t} -\eps{\bar{u}}}
 +\frac{1}{2} \sum\_{\bar{c}\bar{d}}^{N/2}\sum\_{\bar{t}\bar{u}}^M 
 \frac{\bracket{\bar{c}\bar{d}}{\bar{t}\bar{u}}
 \bracket{\bar{t}\bar{u}}{\bar{c}\bar{d}}}
 {\eps{\bar{c}} +\eps{\bar{d}} -\eps{\bar{t}} -\eps{\bar{u}}}
\Bigg)\\&\phantom{=} -\left(
 \frac{1}{2} \sum\_{cd}^{N/2}\sum\_{tu}^M 
 \frac{\bracket{cd}{tu}\bracket{tu}{dc}}
 {\eps{c} +\eps{d} -\eps{t} -\eps{u}}
 +\frac{1}{2} \sum\_{\bar{c}\bar{d}}^{N/2}\sum\_{\bar{t}\bar{u}}^M 
 \frac{\bracket{\bar{c}\bar{d}}{\bar{t}\bar{u}}
 \bracket{\bar{t}\bar{u}}{\bar{d}\bar{c}}}
 {\eps{\bar{c}} +\eps{\bar{d}} -\eps{\bar{t}} -\eps{\bar{u}}}
\right)\tag{6}
\end{align}$$


Now we can get rid of the spin and notice, that all integrals in the first parenthesis are equal, as wall as in the second.
$$\begin{align}
E\_0^{(2)} &=
 2 \sum\_{cd}^{N/2}\sum\_{tu}^M 
 \frac{\bracket{cd}{tu}\bracket{tu}{cd}}
 {\eps{c} +\eps{d} -\eps{t} -\eps{u}}
 \sum\_{cd}^{N/2}\sum\_{tu}^M 
 \frac{\bracket{cd}{tu}\bracket{tu}{dc}}
 {\eps{c} +\eps{d} -\eps{t} -\eps{u}}
\tag{7}\end{align}$$


When we now relabel $c,d\to a,b$ and $t,u\to s,r$ we will get (6.74) and when we move $\bracket{cd}{tu}\bracket{tu}{cd}$ in front of the parenthesis we have our desired equation for exercise 2.18.
$$\begin{align}
E\_0^{(2)} &= 
 \sum\_{ab}^{N/2}\quad \sum\_{rs}^{M}
 \frac{\bracket{ab}{rs} \left(2 \bracket{rs}{ab} -\bracket{rs}{ba}\right)}
 {\eps{a} +\eps{b} -\eps{r} -\eps{s}}
\end{align}$$


### Additional notes


After doing this exercise and I also spent quite a few hours on it, I still have the feeling I have not learned anything new. Surely, I do now understand the lazy notation better. I can also see why introducing the restriction of closed shell orbitals is a quite good idea from a computational point of view. But I did know that before and it seems more than logical when you consider that you slash your complete basis in halves.  

Well, since I like crosswords and the likes, I actually liked thinking about this. Apart from this I don't think this exercise furthers understanding quantum chemistry.  

While I did some reading along the lines, I came across a book on the shelf of my sensei, which has also a focus on implementation. I guess it doesn't hurt checking it out, if you have access to it: David B. Cook; Hondbook of Computational Chemistry; Oxford University Press: Oxford, New York, Tokyo, 1998. (New edition 2005 [@ Dover publications](http://store.doverpublications.com/0486443078.html))




---


### Proof (deduction) of (3)


Recall what I used earlier, I already threw away the $\frac{1}{4}$:
$$\small
 \sum\_{a=1}\sum\_{b=1}\sum\_{r=N+1}\sum\_{s=N+1} 
 \frac{\bracket{ab}{rs}^2}{\eps{a} +\eps{b} -\eps{r} -\eps{s}}
= \sum\_{a=1}\sum\_{b=1}\sum\_{r=N+1}\sum\_{s=N+1} 
 \frac{\bracket{ab}{sr}^2}{\eps{a} +\eps{b} -\eps{r} -\eps{s}}\tag{3'}
$$
 I am no mathematician. The only way I knew how to tackle this was to actually expand each term (completely). And yes, that is quite some work.  

To make things a little easier, we can reduce the terms a little further, because the denominator on both sides is equal when $a,b,r,s\in\mathbb{N}$; $a=[1,N]$; $b=[1,N]$; $r=[N+1,M]$; $s=[N+1,M]$; and $N,M$ are the same on the left and the right side.  

Therefore we "simply" need to show that
$$
 \sum\_{a=1}^N\sum\_{b=1}^N\sum\_{r=N+1}^M\sum\_{s=N+1}^M 
 \bracket{ab}{rs}^2
= \sum\_{a=1}^N\sum\_{b=1}^N\sum\_{r=N+1}^M\sum\_{s=N+1}^M
 \bracket{ab}{sr}^2\tag{A1}
$$


Now we again need to simplify our notation or we will not get anywhere. For $a=1$ we simply write $1$ and for $r=N+1$ we also simply write $1$, where the position of the number implies if it is part of the first set or the second. (I can't believe I am actually writing this.) In the integral we will from now on use a semicolon to separate the functions. Since there are so many squares and we don't need them, we also get rid of that. Let's make a practical example:
$$\text{For} a=1,b=2,r=N+1,s=N+2: \bracket{ab}{rs}^2:=\bracket{1;2}{1;2}$$


Let's tackle the left side first:
$$\small\begin{align}
 \sum\_{a=1}^N\sum\_{b=1}^N\sum\_{r=N+1}^M\sum\_{s=N+1}^M \bracket{ab}{rs}^2
 &=
 \begin{array}{l}
 \color{\green}{
 \phantom{+}
 \bracket{1;1}{1;1} +\bracket{2;1}{1;1} 
 +\bracket{1;2}{1;1} +\bracket{2;2}{1;1} 
 +\cdots+\bracket{N;N}{1;1}}\\
 \color{\red}{
 +\bracket{1;1}{2;1} +\bracket{2;1}{2;1} 
 +\bracket{1;2}{2;1} +\bracket{2;2}{2;1} 
 +\cdots+\bracket{N;N}{2;1}}\\
 \color{\navy}{
 +\bracket{1;1}{1;2} +\bracket{2;1}{1;2} 
 +\bracket{1;2}{1;2} +\bracket{2;2}{1;2} 
 +\cdots+\bracket{N;N}{1;2}}\\
 \color{\green}{
 +\bracket{1;1}{2;2} +\bracket{2;1}{2;2} 
 +\bracket{1;2}{2;2} +\bracket{2;2}{2;2} 
 +\cdots+\bracket{N;N}{2;2}}\\
 +\qquad\vdots\\
 +\bracket{1;1}{M;M} +\bracket{2;1}{M;M} 
 +\bracket{1;2}{M;M} +\bracket{2;2}{M;M} 
 +\cdots+\bracket{N;N}{M;M}\\
 \end{array}
\end{align}$$


This doesn't really help, because we also need the right side. 
$$\small\begin{align}
 \sum\_{a=1}^N\sum\_{b=1}^N\sum\_{r=N+1}^M\sum\_{s=N+1}^M \bracket{ab}{sr}^2
 &=
 \begin{array}{l}
 \color{\green}{
 \phantom{+}
 \bracket{1;1}{1;1} +\bracket{2;1}{1;1} 
 +\bracket{1;2}{1;1} +\bracket{2;2}{1;1} 
 +\cdots+\bracket{N;N}{1;1}}\\
 \color{\navy}{
 +\bracket{1;1}{1;2} +\bracket{2;1}{1;2} 
 +\bracket{1;2}{1;2} +\bracket{2;2}{1;2} 
 +\cdots+\bracket{N;N}{1;2}}\\
 \color{\red}{
 +\bracket{1;1}{2;1} +\bracket{2;1}{2;1} 
 +\bracket{1;2}{2;1} +\bracket{2;2}{2;1} 
 +\cdots+\bracket{N;N}{2;1}}\\
 \color{\green}{
 +\bracket{1;1}{2;2} +\bracket{2;1}{2;2} 
 +\bracket{1;2}{2;2} +\bracket{2;2}{2;2} 
 +\cdots+\bracket{N;N}{2;2}}\\
 +\qquad\vdots\\
 +\bracket{1;1}{M;M} +\bracket{2;1}{M;M} 
 +\bracket{1;2}{M;M} +\bracket{2;2}{M;M} 
 +\cdots+\bracket{N;N}{M;M}\\
 \end{array}
\end{align}$$


Now you can probably already guess from the colour-coding where I am going with this. We can easily see now, that the sums are equivalent since $a,b$ and $r,s$ run over the same indices in both cases. The only difference we have is in which order the integrals will appear. So the green lines are identical in both cases (and zero btw.) while the red and navy ones just interchange positions.




---


### Full expansion of (6)


Note that I actually appreciate how insane this is. I am including this, because I noticed that your expansion was incomplete. It still leads to the correct conclusion, because the terms you did not include are all vanishing.
$$%\require{cancel}
 \newcommand{\cancel}[1]{\color{\red}{#1}}
 \begin{align}
E\_0^{(2)} &=
 \phantom{-}\frac{1}{2}\Bigg(
%all alpha
 \sum\_{cd}^{N/2}\sum\_{tu}^M 
 \frac{\bracket{cd}{tu}\bracket{tu}{cd}}
 {\eps{c} +\eps{d} -\eps{t} -\eps{u}}
\\&\phantom{=-\frac{1}{2}\Bigg(}
%three alpha one beta 
 + \sum\_{\bar{c}d}^{N/2}\sum\_{tu}^M 
 \frac{\cancel{\bracket{\bar{c}d}{tu}}
 \cancel{\bracket{tu}{\bar{c}d}}}
 {\eps{\bar{c}} +\eps{d} -\eps{t} -\eps{u}}
 + \sum\_{c\bar{d}}^{N/2}\sum\_{tu}^M 
 \frac{\cancel{\bracket{c\bar{d}}{tu}}
 \cancel{\bracket{tu}{c\bar{d}}}}
 {\eps{c} +\eps{\bar{d}} -\eps{t} -\eps{u}}
\\&\phantom{=-\frac{1}{2}\Bigg(}
 + \sum\_{cd}^{N/2}\sum\_{\bar{t}u}^M 
 \frac{\cancel{\bracket{cd}{\bar{t}u}}
 \cancel{\bracket{\bar{t}u}{cd}}}
 {\eps{c} +\eps{d} -\eps{\bar{t}} -\eps{u}}
 + \sum\_{cd}^{N/2}\sum\_{t\bar{u}}^M 
 \frac{\cancel{\bracket{cd}{t\bar{u}}}
 \cancel{\bracket{t\bar{u}}{cd}}}
 {\eps{c} +\eps{d} -\eps{t} -\eps{\bar{u}}}
\\&\phantom{=-\frac{1}{2}\Bigg(}
%two alpha two beta
 + \sum\_{\bar{c}\bar{d}}^{N/2}\sum\_{tu}^M 
 \frac{\cancel{\bracket{\bar{c}\bar{d}}{tu}}
 \cancel{\bracket{tu}{\bar{c}\bar{d}}}}
 {\eps{\bar{c}} +\eps{\bar{d}} -\eps{t} -\eps{u}}
 + \sum\_{c\bar{d}}^{N/2}\sum\_{\bar{t}u}^M 
 \frac{\cancel{\bracket{c\bar{d}}{\bar{t}u}}
 \cancel{\bracket{\bar{t}u}{c\bar{d}}}}
 {\eps{c} +\eps{\bar{d}} -\eps{\bar{t}} -\eps{u}}
\\&\phantom{=-\frac{1}{2}\Bigg(}
 + \sum\_{cd}^{N/2}\sum\_{\bar{t}\bar{u}}^M 
 \frac{\cancel{\bracket{cd}{\bar{t}\bar{u}}}
 \cancel{\bracket{\bar{t}\bar{u}}{cd}}}
 {\eps{c} +\eps{d} -\eps{\bar{t}} -\eps{\bar{u}}}
 + \sum\_{\bar{c}d}^{N/2}\sum\_{\bar{t}u}^M 
 \frac{\bracket{\bar{c}d}{\bar{t}u}\bracket{\bar{t}u}{\bar{c}d}}
 {\eps{\bar{c}} +\eps{d} -\eps{\bar{t}} -\eps{u}}
\\&\phantom{=-\frac{1}{2}\Bigg(}
 + \sum\_{c\bar{d}}^{N/2}\sum\_{t\bar{u}}^M 
 \frac{\bracket{c\bar{d}}{t\bar{u}}\bracket{t\bar{u}}{c\bar{d}}}
 {\eps{c} +\eps{\bar{d}} -\eps{t} -\eps{\bar{u}}}
 + \sum\_{\bar{c}d}^{N/2}\sum\_{t\bar{u}}^M 
 \frac{\cancel{\bracket{\bar{c}d}{t\bar{u}}}
 \cancel{\bracket{t\bar{u}}{\bar{c}d}}}
 {\eps{\bar{c}} +\eps{d} -\eps{t} -\eps{\bar{u}}}
\\&\phantom{=-\frac{1}{2}\Bigg(}
%one alpha three beta
 + \sum\_{c\bar{d}}^{N/2}\sum\_{\bar{t}\bar{u}}^M 
 \frac{\cancel{\bracket{c\bar{d}}{\bar{t}\bar{u}}}
 \cancel{\bracket{\bar{t}\bar{u}}{c\bar{d}}}}
 {\eps{c} +\eps{\bar{d}} -\eps{\bar{t}} -\eps{\bar{u}}}
 + \sum\_{\bar{c}d}^{N/2}\sum\_{\bar{t}\bar{u}}^M 
 \frac{\cancel{\bracket{\bar{c}d}{\bar{t}\bar{u}}}
 \cancel{\bracket{\bar{t}\bar{u}}{\bar{c}d}}}
 {\eps{c} +\eps{\bar{d}} -\eps{\bar{t}} -\eps{\bar{u}}}
\\&\phantom{=-\frac{1}{2}\Bigg(}
 + \sum\_{\bar{c}\bar{d}}^{N/2}\sum\_{t\bar{u}}^M 
 \frac{\cancel{\bracket{\bar{c}\bar{d}}{t\bar{u}}}
 \cancel{\bracket{t\bar{u}}{\bar{c}\bar{d}}}}
 {\eps{\bar{c}} +\eps{\bar{d}} -\eps{t} -\eps{\bar{u}}}
 + \sum\_{\bar{c}\bar{d}}^{N/2}\sum\_{\bar{t}u}^M 
 \frac{\cancel{\bracket{\bar{c}\bar{d}}{\bar{t}u}}
 \cancel{\bracket{\bar{t}u}{\bar{c}\bar{d}}}}
 {\eps{\bar{c}} +\eps{\bar{d}} -\eps{\bar{t}} -\eps{u}}
\\&\phantom{=-\frac{1}{2}\Bigg(}
%all beta
 + \sum\_{\bar{c}\bar{d}}^{N/2}\sum\_{\bar{t}\bar{u}}^M 
 \frac{\bracket{\bar{c}\bar{d}}{\bar{t}\bar{u}}
 \bracket{\bar{t}\bar{u}}{\bar{c}\bar{d}}}
 {\eps{\bar{c}} +\eps{\bar{d}} -\eps{\bar{t}} -\eps{\bar{u}}}
\Bigg)\\
&\phantom{=} -\frac{1}{2}\Bigg(
%all alpha
 \sum\_{cd}^{N/2}\sum\_{tu}^M 
 \frac{\bracket{cd}{tu}\bracket{tu}{dc}}
 {\eps{c} +\eps{d} -\eps{t} -\eps{u}}
\\&\phantom{=-\frac{1}{2}\Bigg(}
%three alpha one beta 
 + \sum\_{\bar{c}d}^{N/2}\sum\_{tu}^M 
 \frac{\cancel{\bracket{\bar{c}d}{tu}}
 \cancel{\bracket{tu}{d\bar{c}}}}
 {\eps{\bar{c}} +\eps{d} -\eps{t} -\eps{u}}
 + \sum\_{c\bar{d}}^{N/2}\sum\_{tu}^M 
 \frac{\cancel{\bracket{c\bar{d}}{tu}}
 \cancel{\bracket{tu}{\bar{d}c}}}
 {\eps{c} +\eps{\bar{d}} -\eps{t} -\eps{u}}
\\&\phantom{=-\frac{1}{2}\Bigg(}
 + \sum\_{cd}^{N/2}\sum\_{\bar{t}u}^M 
 \frac{\cancel{\bracket{cd}{\bar{t}u}}
 \cancel{\bracket{\bar{t}u}{dc}}}
 {\eps{c} +\eps{d} -\eps{\bar{t}} -\eps{u}}
 + \sum\_{cd}^{N/2}\sum\_{t\bar{u}}^M 
 \frac{\cancel{\bracket{cd}{t\bar{u}}}
 \cancel{\bracket{t\bar{u}}{dc}}}
 {\eps{c} +\eps{d} -\eps{t} -\eps{\bar{u}}}
\\&\phantom{=-\frac{1}{2}\Bigg(}
%two alpha two beta
 + \sum\_{\bar{c}\bar{d}}^{N/2}\sum\_{tu}^M 
 \frac{\cancel{\bracket{\bar{c}\bar{d}}{tu}}
 \cancel{\bracket{tu}{\bar{d}\bar{c}}}}
 {\eps{\bar{c}} +\eps{\bar{d}} -\eps{t} -\eps{u}}
 + \sum\_{c\bar{d}}^{N/2}\sum\_{\bar{t}u}^M 
 \frac{\cancel{\bracket{c\bar{d}}{\bar{t}u}}
 \bracket{\bar{t}u}{\bar{d}c}}
 {\eps{c} +\eps{\bar{d}} -\eps{\bar{t}} -\eps{u}}
\\&\phantom{=-\frac{1}{2}\Bigg(}
 + \sum\_{cd}^{N/2}\sum\_{\bar{t}\bar{u}}^M 
 \frac{\cancel{\bracket{cd}{\bar{t}\bar{u}}}
 \cancel{\bracket{\bar{t}\bar{u}}{dc}}}
 {\eps{c} +\eps{d} -\eps{\bar{t}} -\eps{\bar{u}}}
 + \sum\_{\bar{c}d}^{N/2}\sum\_{\bar{t}u}^M 
 \frac{\bracket{\bar{c}d}{\bar{t}u}
 \cancel{\bracket{\bar{t}u}{d\bar{c}}}}
 {\eps{\bar{c}} +\eps{d} -\eps{\bar{t}} -\eps{u}}
\\&\phantom{=-\frac{1}{2}\Bigg(}
 + \sum\_{c\bar{d}}^{N/2}\sum\_{t\bar{u}}^M 
 \frac{\bracket{c\bar{d}}{t\bar{u}}
 \cancel{\bracket{t\bar{u}}{\bar{d}c}}}
 {\eps{c} +\eps{\bar{d}} -\eps{t} -\eps{\bar{u}}}
 + \sum\_{\bar{c}d}^{N/2}\sum\_{t\bar{u}}^M 
 \frac{\cancel{\bracket{\bar{c}d}{t\bar{u}}}
 \bracket{t\bar{u}}{d\bar{c}}}
 {\eps{\bar{c}} +\eps{d} -\eps{t} -\eps{\bar{u}}}
\\&\phantom{=-\frac{1}{2}\Bigg(}
%one alpha three beta
 + \sum\_{c\bar{d}}^{N/2}\sum\_{\bar{t}\bar{u}}^M 
 \frac{\cancel{\bracket{c\bar{d}}{\bar{t}\bar{u}}}
 \cancel{\bracket{\bar{t}\bar{u}}{\bar{d}c}}}
 {\eps{c} +\eps{\bar{d}} -\eps{\bar{t}} -\eps{\bar{u}}}
 + \sum\_{\bar{c}d}^{N/2}\sum\_{\bar{t}\bar{u}}^M 
 \frac{\cancel{\bracket{\bar{c}d}{\bar{t}\bar{u}}}
 \cancel{\bracket{\bar{t}\bar{u}}{d\bar{c}}}}
 {\eps{c} +\eps{\bar{d}} -\eps{\bar{t}} -\eps{\bar{u}}}
\\&\phantom{=-\frac{1}{2}\Bigg(}
 + \sum\_{\bar{c}\bar{d}}^{N/2}\sum\_{t\bar{u}}^M 
 \frac{\cancel{\bracket{\bar{c}\bar{d}}{t\bar{u}}}
 \cancel{\bracket{t\bar{u}}{\bar{d}\bar{c}}}}
 {\eps{\bar{c}} +\eps{\bar{d}} -\eps{t} -\eps{\bar{u}}}
 + \sum\_{\bar{c}\bar{d}}^{N/2}\sum\_{\bar{t}u}^M 
 \frac{\cancel{\bracket{\bar{c}\bar{d}}{\bar{t}u}}
 \cancel{\bracket{\bar{t}u}{\bar{d}\bar{c}}}}
 {\eps{\bar{c}} +\eps{\bar{d}} -\eps{\bar{t}} -\eps{u}}
\\&\phantom{=-\frac{1}{2}\Bigg(}
%all beta
 + \sum\_{\bar{c}\bar{d}}^{N/2}\sum\_{\bar{t}\bar{u}}^M 
 \frac{\bracket{\bar{c}\bar{d}}{\bar{t}\bar{u}}
 \bracket{\bar{t}\bar{u}}{\bar{d}\bar{c}}}
 {\eps{\bar{c}} +\eps{\bar{d}} -\eps{\bar{t}} -\eps{\bar{u}}}
\Bigg)\tag{6}
\end{align}$$


I indicated the vanishing elements with red. 


If there are any remaining questions, don't hesitate and visit the associated [chat](http://chat.stackexchange.com/rooms/32492/discussion-on-question-by-mszep-how-to-convert-from-spin-orbitals-to-spatial-orb). *(If this chat is no longer available, go to the main chat and ask there, please.)*


And because that was quite tedious, have a coffee stain to go:  

![obligatory coffee stain courtesy of Roger Karlsson](https://i.stack.imgur.com/Tj8C7m.jpg)  

Image is courtesy of Roger Karlsson (<http://www.free-photo-gallery.org/photos/coffee-stain/>) obtained from [flicker](https://www.flickr.com/photos/free-photos/3375886335/).
*(I assume this is now quite close to my [longest proof](https://chemistry.stackexchange.com/q/28346/4945).)*


 18

Regarding your derivation. It should be noted that the norm-squared is not the same as the squared. $$ |f(x)|^2=|\langle x|f \rangle|^2= (\langle x|f \rangle )^\* \langle x|f \rangle =\langle f|x \rangle \langle x|f \rangle \neq \langle x|f \rangle \langle x|f \rangle $$


Therefore, I hope the following set of equations makes things clearer for anyone looking for answers.


$$E\_{0}^{(2)}=\frac{1}{4}\sum\_{a,b=1}^{n}\sum\_{r,s=n+1}^{m}\frac{|\langle ab||rs \rangle |^2}{(\epsilon\_a+\epsilon\_b)-(\epsilon\_r+\epsilon\_s)}$$


$$ E\_{0}^{(2)} =
\frac{1}{4}
\sum\_{a,b=1}^{n}\sum\_{r,s=n+1}^{m}
\frac{\langle ab||rs \rangle \langle rs||ab \rangle}
{(\epsilon\_a+\epsilon\_b)-(\epsilon\_r+\epsilon\_s)}$$


$$ E\_{0}^{(2)} =
\frac{1}{4}
\sum\_{a,b=1}^{n}\sum\_{r,s=n+1}^{m}
\frac{(\langle ab|rs \rangle - \langle ab|sr \rangle)(\langle rs|ab \rangle - \langle rs|ba \rangle)}
{(\epsilon\_a+\epsilon\_b)-(\epsilon\_r+\epsilon\_s)}$$


$$ E\_{0}^{(2)} =
\frac{1}{4}
\sum\_{a,b=1}^{n}\sum\_{r,s=n+1}^{m}
\frac
{\langle ab|rs \rangle \langle rs|ab \rangle + \langle ab|sr \rangle\langle rs|ba \rangle - \langle ab|rs \rangle\langle rs|ba \rangle - \langle ab|sr \rangle\langle rs|ab \rangle}
{(\epsilon\_a+\epsilon\_b)-(\epsilon\_r+\epsilon\_s)}$$


$$ E\_{0}^{(2)} =
\frac{1}{4}
\sum\_{a,b=1}^{n}\sum\_{r,s=n+1}^{m}
\frac
{2\langle ab|rs \rangle \langle rs|ab \rangle - 2\langle ab|rs \rangle \langle rs|ba \rangle }
{(\epsilon\_a+\epsilon\_b)-(\epsilon\_r+\epsilon\_s)}$$


The final step is the only step that requires the use of symmetry note that summation over a and b is symmetrical and that summation over r and s is symmetrical (this is seen clearly in the equations).


Rearranging the resulting equation to equation (6.73) is trivial. 


Regarding the Closed Shell variant of the equation, I won't say much, as the only real difference is that the summation changes as the spin does not need to be explicitly considered (which is why they can be considered spacial only) as all electrons are considered paired in the ground state MOs.


I hope this makes sense! Let me know if there are any mistakes!


*ADDITIONAL INFORMATION*


The answer given by @Martin and in the question has an *incorrect starting point*. 
Here I shall explain why by showing that:
$$|\langle ab||rs \rangle|^2 \neq \langle ab||rs \rangle^2 $$
$$|\langle ab||rs \rangle|^2 \neq \langle ab||rs \rangle \langle ab||rs \rangle $$
The first thing that should be apparent is that the norm squared and squared have different syntaxes - this should hint that there is a difference between the two...
Infact, they are equal if you are working exclusively with *real* numbers, however, $\Psi$ can be *real* or *complex*, therefore when working with $\Psi$ it is important to note that any derivation must be general for both *real* AND *complex* numbers.
So I shall write down the true form of the norm-squared for a function $\Psi$ that is general for both *real* and *complex* numbers:
$$ |\Psi|^2 = \int\langle \Psi |x \rangle\langle x|\Psi\rangle dx = \int \Psi^{\*}(x)\Psi(x)dx = \langle \Psi | \Psi \rangle$$
We also know that, *complex conjugates* in *Dirac* notation are related by:
$$ \langle A | = ( |A \rangle )^\* $$
$$ |A \rangle = ( \langle A | )^\* $$


Therefore,
$$ |\langle ab || rs \rangle |^2 = (\langle ab || rs \rangle )^\*\langle ab || rs \rangle = \langle rs || ab \rangle \langle ab || rs \rangle = \langle ab || rs \rangle \langle rs || ab \rangle \neq \langle ab || rs \rangle \langle ab || rs \rangle $$
The final inequality is true for *complex* numbers despite the fact it is not true for *real* numbers. However, as stated earlier if $\Psi$ can be either *complex* or *real* then $a,b,r$ and $s$ can also be *complex* or *real*. 


The same can be shown using matrices instead of *real* and *complex* numbers, when you know that:
$$\langle a | a \rangle = \bar{\mathbf{a}}^{T}\mathbf{a}$$ 
Where, $a$ can be a *real* or *complex* matrix.
This is the power of Dirac (braket) notation, it gives a general formalism that relates to matrices and integrals. If you are going to work within QM in chemistry I strongly advise using Dirac notation over the chemists notation.


 1