  It is often claimed that error cancellation plays an essential role in
quantum chemistry and first-principle simulation for condensed matter physics
and materials science. Indeed, while the energy of a large, or even
medium-size, molecular system cannot be estimated numerically within chemical
accuracy (typically 1 kcal/mol or 1 mHa), it is considered that the energy
difference between two configurations of the same system can be computed in
practice within the desired accuracy.
  The purpose of this paper is to provide a quantitative study of
discretization error cancellation. The latter is the error component due to the
fact that the model used in the calculation (e.g. Kohn-Sham LDA) must be
discretized in a finite basis set to be solved by a computer. We first report
comprehensive numerical simulations performed with Abinit on two simple
chemical systems, the hydrogen molecule on the one hand, and a system
consisting of two oxygen atoms and four hydrogen atoms on the other hand. We
observe that errors on energy differences are indeed significantly smaller than
errors on energies, but that these two quantities asymptotically converge at
the same rate when the energy cut-off goes to infinity. We then analyze a
simple one-dimensional periodic Schr\"odinger equation with Dirac potentials,
for which analytic solutions are available. This allows us to explain the
discretization error cancellation phenomenon on this test case with
quantitative mathematical arguments.
