# Accuracy trade-off between energy and density in DFT calculations

Consider the following situation that the exchange-correlation term (e.g., B3LYP) overestimates the energy in a system (i.e., a simpler one (e.g., LDA) is sufficient in the system). In this case, my question is that, will the obtained density be incorrect, that is, will the parameters in LCAO (i.e., orbital superposition) be incorrect even if the energy accuracy calculated by B3LYP is very good?

In other words, does good accurate energy calculated using a complex energy functional always guarantee the correct density? I am wondering that an overestimated energy functional can output the accurate energy even if the LCAO parameters (i.e., coefficient in orbital superposition) are incorrect and this will lead to the incorrect density.

I also found the discussion and in the Science paper ("Density functional theory is straying from the path toward the exact functional" and its comment). Especially in recent years in machine learning research, very complicated deep learning models with over ten million parameters have been developed and successfully predicted the energy of various molecules (e.g., molecular graph message passing model and neural network potential) However, such deep models seem to completely ignore the density. I am wondering that such overparameterized models are good or not for both energy and density.

If a functional always gives the exact energy for arbitrary external potentials, then it is easy to see that the functional must always give the exact density. Consider two DFT calculations, one with an external potential $$V(\mathbf{r})$$, and another with the potential $$V(\mathbf{r}) + \epsilon\delta(\mathbf{r}_0)$$, where $$\epsilon$$ is infinitesimal. By perturbation theory, the energy difference between the two systems is $$-\epsilon\rho(\mathbf{r}_0) + O(\epsilon^2)$$. So if the functional gives exact energies, it must give exact $$\rho(\mathbf{r}_0)$$ at an arbitrary point $$\mathbf{r}_0$$.

That being said, there may well exist functionals that give good (but not exact) energies but bad densities, e.g. as mentioned in the Science paper you cited. Or there may even exist functionals that give exact energies for systems composed of integer-charge atomic nuclei, but bad densities; since the functionals are not required to be exact for external potentials that cannot be expressed as a sum of integer-charge Coulomb attraction potentials, my proof doesn't work. It is especially the possible presence of the latter class of functionals that suggests that fitting a functional against only energies does not necessarily improve the density, even if the training set approaches completeness. Including properties that directly reflect the density distribution, e.g. dipole moments, in the parameterization, may ease this problem to some extent, although the best remedy is to explicitly include densities in the fitting. Another possible way is to fit the functional against non-Coulomb external potentials, but I doubt if this has ever been done, except for the trivial cases where the external potential is a sum of atomic pseudopotentials, or where the external potential is a jellium etc.