# How to define the initial guess for the electron density?

This is a technical question. If I have a one-dimensional box of length L, and an electron density existing in the box and integrating to N electrons. And if I want to determine the electron density that minimizes the energy of the system, assuming the following:

• electron density is zero at the boundary

• a fixed external potential of any kind and form

• the Thomas-Fermi kinetic energy functional is used. $v_{TF}(x)=C^{TF}*\rho^{2/3}(x)$

• absence of electron-electron interaction, $v_{HXC}(x)=0$

the question is related to the initial guess for the electron density. I've been trying the following definition for the initial $\rho(x)$

$g = \frac{l}{(gp-1.0)}$

$\rho(x)= \frac{N}{(l-g)}$

where

$g$ is the grid gap,

$gp$ is the number of grid points,

$l$ the length of the box, and

$N$ the number of electrons.

with this density, the minimized density does not preserved the number of electrons. Do you guys have any suggestion to define a suitable initial guess?

Also I am including a figure where the density at each grid point is plotted. I assumed two electrons and 200 grid points. Thank you

• Assumming an iterative process: I admit I never tried it, but I would think that after the first iteration, the number of electrons should be correct, and that any problems in that direction point to a problem with the iterative process, not the initial guess. In my DFT experience, I have come across qualitatively wrong solutions due to a bad guess, but never wrong electron numbers. – TAR86 Jun 23 '17 at 5:19
• It's not clear to me what system are you modelling. No electron-electron interaction includes no electrostatics? What about exchange interactions which are inherent to fermions? – user41033 Jun 23 '17 at 13:08
• This is a a simple training problem where you can applied any potential. For simplicity both exchange and coulomb are assumed to be zero. Also I added the resulting density at each grid point, it is no clear for me why the plot gets that concavity. Or maybe is correct but I am not seeing it. Thanks for your comments. – Pablor Jun 23 '17 at 17:16
• Have you tried various values of l? It seems to me that the density in one dimension is trying to escape the boundaries for being in a confined box. – Joaquin Barroso-Flores Jun 30 '17 at 1:45
• Is your plot of your initial guess? Then your definition of $\rho(x)$ looks strange to me: $$\rho(x) = \frac{N}{l - g}\text{.}$$ If $N$, $l$ and $g$ are constants, where is the dependency on $x$? Your graph must be wrong. Or is it your final density that's plotted there? – Felipe S. S. Schneider Jul 13 '17 at 12:52