Confusion regarding DFT basics, i.e. the connection between Hohenberg–Kohn theorems, external potentials and the Kohn-Sham method I have a question on the basics of DFT, which bases on the Hohenberg-Kohn theorem: there exist an unique mapping between the external potential, the electronic wave function and thus also the electronic density n(r). In other words, from wikipedia, where ${\displaystyle v(\mathbf {r} )}$ is defined as an external potential,
&quot;If two systems of electrons, one trapped in a potential ${\displaystyle v_{1}(\mathbf {r} )}$ and the other in ${\displaystyle v_{2}(\mathbf {r} )}$, have the same ground-state density ${\displaystyle n(\mathbf {r} )}$, then ${\displaystyle v_{1}(\mathbf {r} )-v_{2}(\mathbf {r} )}$ is necessarily a constant.&quot;
My confusion comes from the Kohn-Sham equations, i.e.
${\displaystyle v_{\text{eff}}(\mathbf {r} )=v_{\text{ext}}(\mathbf {r} )+e^{2}\int {\frac {\rho (\mathbf {r} ')}{|\mathbf {r} -\mathbf {r} '|}}\,d\mathbf {r} '+{\frac {\delta E_{\text{xc}}[\rho ]}{\delta \rho (\mathbf {r} )}},}$
${\displaystyle \left(-{\frac {\hbar ^{2}}{2m}}\nabla ^{2}+v_{\text{eff}}(\mathbf {r} )\right)\varphi _{i}(\mathbf {r} )=\varepsilon _{i}\varphi _{i}(\mathbf {r} ).}$
which was derived by decomposing the energy functional of the interacting-electron system into solvable energy functionals of a non-interacting electron system affected by an alternative external potential ${\displaystyle v_\mathrm{eff}(\mathbf {r} )}$, plus an exchange-correlation functional that attempts to account for the difference between the two systems. The optimal orbitals are obtained through this iterative scheme.
My question is, since the HK theorem states the unique mapping between between an external potential and the electron density / wavefunction, why would we obtain a common electronic state when ${\displaystyle v_\mathrm{eff}(\mathbf {r} )}$ - ${\displaystyle v_\mathrm{ext}(\mathbf {r} )}$ is not necessarily a constant?
${\displaystyle v_\mathrm{eff}(\mathbf {r} )}$ in this case is the external potential experienced by a single non-interacting electron defined by the first Kohn-Sham equation, while ${\displaystyle v_\mathrm{ext}(\mathbf {r} )}$ is the external potential exerted by the stationary nuclei to the electrons, in the electron-interacting picture.

I guess more specifically, I assumed that the KS method meant that we can solve a simpler system of non-interacting electrons affected by a specific ${\displaystyle v_\mathrm{eff}(\mathbf {r} )}$ that would give the same electron density of the same system but with interacting electrons.
However, the &quot;external potential&quot; governed by the interacting and non-interacting systems are different, so how come they will yield the same ground state, when we minimize their respective energy expressions?
Its a tricky question but anyway when you go through the HK theorem you'll see that there is a part where you have $v_{\mathrm{ext}} - v_{\mathrm{ext}}' = H - H'$ as the electron-electron and other operators are the same for both systems and will therefore cancel. The only important part is the external (nuclear-electron) potential and you get that mapping.
Now with KS essentially what you do is take the DFT functional and switch out the kinetic energy functional to the kinetic energy operator from QM and move some other stuff around. This functional now depends on orbitals and we now want to optimise these for the lowest energies. Using some mathematical methods you can get a set of equations to do this known as the KS equations.
With the KS equations you get a set of orbital equations which you solve collectively. If you run the HK theorems with one of the KS equations the mapping between that orbital densities would be with $v_{\mathrm{eff}}$. All this is now saying is that the total electron density which maps with $v_{\mathrm{ext}}$ will be different to your orbital densities which maps to $v_{\mathrm{eff}}$ which is reasonable. You only get the total electron density when you sum all the orbital densities up.