Suppose that we have a set of trial vectors
which have been generated during the iterative solution of a
problem. Now let us form a set of ``residual'' vectors defined as

(1)

The DIIS method assumes that a good approximation to the final solution
pf can be obtained as a linear combination of the
previous guess vectors

(2)

where m is the number of previous vectors (in practice, only the
most recent few vectors are used). The coefficients ci are
obtained by requiring that the associated residual vector

(3)

approximates the zero vector in a least-squares sense. Furthermore,
the coefficients are required to add to one,

(4)

The motivation for the latter requirement can be seen as follows.
Each of our trial solutions
pi can be written
as the exact solution plus an error term,
pf + ei. Then, the DIIS approximate solution is given by

p

=

(5)

=

Hence, we wish to minimize the actual error, which is
the second term in the equation above (of course, in practice, we
don't know
ei, only
); doing so
would make the second term vanish, leaving only the first term. For
p = pf, we must have
.

Thus, we wish to minimize the norm of the residuum vector

(6)

subject to the constraint (4). These requirements can be
satisfied by minimizing the following function with Lagrangian
multiplier

(7)

where
B is the matrix of overlaps

(8)

We can minimize
with respect
to a coefficient ck to obtain (assuming real quantities)

=

(9)

=

We can absorb the factor of 2 into
to obtain the following
matrix equation, which is eq. (6) of Pulay [3]: