Now for the grand finale: how do we index a quantity that has four orbital indices? This is precisely the problem posed by the two-electron integrals, which over spatial orbitals are

Since we usually deal with real orbitals, the complex conjugations have no effect, and thus we can interchange orbitals i and j or k and l and obtain the same integral. In fact, we can also swap the orbitals associated with electron 1 with those associated with electron 2. In total, two-electron integrals over spatial orbitals have eightfold symmetry.

For the one-electron integrals, permutational symmetry meant that
only
with
were unique, so we saved memory by
storing only the lower triangle of the matrix. For two-electron
integrals, the eightfold symmetry means that only about one
in eight two-electron integrals are unique and must be stored.
The others can be accessed by permutations of the orbital labels.
Which eighth of the two-electron integrals will we store? We need
to make some restrictions on the orbital indices, just as we
did for the one-electron integrals. Since we can swap orbitals
i and j, we are free to require the unique two-electron integrals
to have
(analogous to using the lower triangle of a matrix).
Likewise, we are equally free to choose
. The final
symmetry between the i,j and k,l pairs can be accounted for by
the restriction
, with ij and kl computed as
in equation (2). With these orbital restrictions,
we have only unique two-electron integrals. Further, we can
associate a canonical index with each unique two-electron integral.
If
,
, and
, then the canonical
index ijkl is given by

One problem with storing the two-electron integrals according to this
indexing scheme is that, although we have taken full advantage of
permutational symmetry, we have taken no account of point-group
symmetry. If the order of the molecular point-group is h, then
only about
of the integrals we're storing are non-zero!
However, if we don't store the integrals which are zero by symmetry,
then how do we index them? The ijkl index just mentioned will
no longer work. It might be possible to come up with a canonical
index if instead of absolute orbital indices we use two indices
for each orbital (irrep and orbital number within the irrep).
However, I have not yet determined a good way to do this.