First principles simulations
When simulating chemicals or materials with quantum mechanical methods, it is common to require at least FP64 precision in order to get reliable results. One reason for this is the requirement that electronic states (or any fermionic states) are strictly orthonormal, which usually involves the calculation and inversion of matrices which can be ill-conditioned. Similarly, the diagonalisation of a Hamiltonian can also be an ill-conditioned problem, for example when states are nearly degenerate.
Ill-conditioning
The term "ill-conditioned" refers to problems where small errors in the input to an operation can give large errors in the output. For example, suppose that we wish to invert the matrix $\mathrm{M}$, where
$$
\mathrm{M}=\left(\begin{array}{cc}
1 & 2\\
\frac{9}{8} & 2
\end{array}\right)
$$
First, let's write the matrix in decimal form to four significant figures, so that our matrix is
$$
\mathrm{M}_\mathrm{4sf}=\left(\begin{array}{cc}
1.000 & 2.000\\
1.125 & 2.000
\end{array}\right).
$$
In this case, our decimal representation is exact. If we also assume that our inversion operation is perfect, i.e. that it works internally in infinite precision, we will obtain the inverse as
$$
\mathrm{M}_\mathrm{4sf}^{-1}=\left(\begin{array}{cc}
-8.000 & 8.000\\
4.500 & -4.000
\end{array}\right),
$$
which is easily shown to be the correct answer.
Now let us try the same calculation with only two significant figures of accuracy for $\mathrm{M}$. We have
$$
\mathrm{M}_\mathrm{2sf}=\left(\begin{array}{cc}
1.0 & 2.0\\
1.1 & 2.0
\end{array}\right),
$$
which is an exact representation of $\mathrm{M}$ except for $\mathrm{M}_{21}$, which has an error of 0.025 (approximately 2.3%). Giving this matrix to our infinitely-precise inversion algorithm, we obtain
$$
\mathrm{M}_\mathrm{2sf}^{-1}=\left(\begin{array}{cc}
-10 & 10\\
5.5 & 5.0
\end{array}\right).
$$
Comparing this to $\mathrm{M}_\mathrm{4sf}^{-1}$ we see that our $\sim 2\%$ error in a single element of $\mathrm{M}$ has led to errors of over 20% in every element of $\mathrm{M}_\mathrm{2sf}^{-1}$.
Sloshing instabilities
One well-known example in materials modelling is the problem of "charge-sloshing" instabilities in self-consistent field (SCF) methods. In a simple SCF method for a density functional theory calculation, we might start with a guess for the electronic charge density $\rho(r)$, and then:
- Compute the potential $V[\rho]$
- Solve the Kohn-Sham equations with this $V[\rho]$
- Use the Kohn-Sham states to construct a new density $\rho_\mathrm{new}(r)$
- If $\vert\rho_\mathrm{new}-\rho|$ is small, stop; else set $\rho = \rho_\mathrm{new}$ and go to step 1.
This simple method fails (diverges) for all but the smallest materials simulations, because it is ill-conditioned. The ill-conditioning arises primarily from the Hartree contribution to the potential, $V_\mathrm{H}[\rho]$. In reciprocal-space, this has the form
$$
V_\mathrm{H}(G) = \frac{\rho(G)}{\vert G \vert^2}
$$
where $G\neq 0$ is a reciprocal lattice vector, and we've used Hartree atomic units.
During the calculation, the density has some error $\delta\rho$, and so the calculated Hartree potential also has an error
$$
\delta V_\mathrm{H}(G) = \frac{\delta\rho(G)}{\vert G \vert^2}.
$$
The trouble is, as we increase the simulation size in real-space, we decrease the size of the smallest reciprocal vectors, and so there are some wavevectors for which $|G|^2$ is very small indeed. Any error in the density for these wavevectors will be amplified enormously in the Hartree potential. Thus, even a small error in the density can lead to a large error in the potential.
Since the potential is used to construct the Kohn-Sham equations in the next iteration, the new Kohn-Sham states will also have a large error - and these states are used to construct the new density. In this way, a small error in the density in one iteration leads to a large error in the density for the next iteration - not a good idea for a stable algorithm!