How to add spin-polarization to an atomic DFT calculation? I wrote a simple program to calculate the ground state total energy of isolated atoms with a density-functional theory approach. I took a similar approach as can be found here:


*

*certik/dftatom

*Theoretical Physics Reference

*Lecture on DFT for atoms (Rutgers)
The following assumptions were made:


*

*Born-Oppenheimer approximation for the nuclear charge

*The electron are considered as non-interacting fermion subjected to an effective Kohn-Sham potential

*The potential and also the charge has spherical symmetry, therefore I can reduce it to a radial problem

*The system is non-relativistic

*Exchange-correlation is included with LDA

*There is not spin-orbit coupling

*The equation that is solved for the eigenstates and eigenenergies is the Kohn-Sham equation:


$$\left( \nabla^2 -  V_{KS}(r) \right)\, \psi(r) = E \,\psi(r) $$
with an $V_{eff}(r)$ being the spherical symmetric effective Kohn-Sham potential including the exchange-correlation potential, Hartree potential and the interaction with the nuclear charge. The ground-state charge density is then obtained by performing self-consistent calculations.
Due to my assumptions I can only treat light closed-shell atoms quite accurately, i.e. He, Ne. Now I want to extend my program that I can also take into account the that atomic orbitals can be half occupied, like Bor and Aluminium.
Now my question? How to I incorporate this symmetry breaking between spin up and spin down in the Kohn-Sham Hamiltonian? Do I just have to edit the Exchange-Correlation potential or are there other parts that are effected too?
 A: You will need to have a spin up and a spin down XC potential. Other than this, the formalism remains the same.
A: Some more details are required to formulate a complete answer, but I will assume that you're modeling after Kohn-Sham DFT, which is the most widely used for these calculations.
A spin polarized calculation isn't much different from your regular calculation. 
First off, you would need to start with an initial 'guess' value for the magnetic moment of the atoms. Typical packages like Quantum Espresso and VASP will calculate the magnetic moment as long as your initial guess is right in 'nature' - what I mean to say is, if you have an intralayer ferromagnetic system, you could start with positive guess values for the magnetic atoms. If you wanted an intralayer antiferromagnetic system, you could provide values alternating in sign. (To tell the system - 'Spin up', 'Spin down' , ...)
Since you mentioned there is no spin orbit coupling, the rest of the way is very simple. If you are familiar with the self iterative process involved in ground-state KS-DFT, it is very similar with one exception: Since you have two spins, the self iterative cycle is solved simultaneously i.e. for spin up and spin down and this process is self iterative till convergence is achieved. This is simply because the electron density is still a function of both carriers. 
Remember that in any of the DFT packages, you don't need to tinker the XC functional, the system takes care of it when you specify spin-polarized calculation.
