Kwonsnow
by Kwonsnow

Categories

Tags

1D DFT code

\Desktop\Study\1D_DFT_code\1D_DFT.ipynb
http://dcwww.camd.dtu.dk/~askhl/files/python-dft-exercises.pdf
https://github.com/tamuhey/python_1d_dft

  1. grid 정의 in real space, Ng = the number of grid points in 1D
  2. External potential, Vext 정의 from neuclues position
  3. Guess the initial electron density
  4. initialize the Hartree (Coulomb) potential (vhartree_g) and the exchange potential (vx_g) as 0 on all grid → 첫 SCF loop에서는 no vhartree_g and vx_g

SCF loop

  1. effective potential, veff_g = vext_g + vhartree_g + vx_g # for the first loop, vhartree_g and vx_g are zero. # np.shape for all potential is (Ng,0)
  2. Hamiltonian, H_gg = T_gg + np.diag(veff_g) # np.diag: construct diagonal array to make np.shape(veff_g)=(Ng,Ng)
  3. Solve Kohn-Sham equation: eps_n, psi_gn = np.linalg.eigh(H_gg) # grid points (Ng) 만큼의 states가 계산됨.
    • eps_n = eigenvalues, psi_gn = Kohn-Sham orbitals
    • dimension: eps_n : (200,0), psi_gn = (200,200)
    • ith eigenvalue = eps_n[i], ith orbital = psi_gn[i]
  4. 기존의 ρ_old와, 새로운 ρ_new = 2.0 * sum(ψoccupied^2) 간의 차이가
  5. density change integral의 convergence criteria (<1e-6) 를 만족하는지 확인: sum(abs(ρ_new(x) - ρ_old(x))) * dx
  6. 전체 charge가 2 * Nn인지 확인 sum(ρ_new(x)) * dx - 2 * Nn < 1e-14
  7. ρ_new(x)를 이용하여새로운 Hartree potential (for next loop) 만들기
  8. ρ_new(x)를 이용하여 Hartree energy 계산
  9. ρ_new(x)를 이용하여 새로운 Exchange potential (for next loop) 만들기
  10. ρ_new(x)를 이용하여 Exchange energy 계산
  11. 왜 Total energy랑 Band structure energy가 다르지?? correlation이 없어서인가?

the kinetic energy of the noninteracting particles is equal to the sum of eigenvalues minus the potential energy coming from the total effective potential
The total energy is the sum of eigenvalues (energies of the individual independent particles)
https://www.theoretical-physics.net/dev/quantum/dft.html

VASP 에너지 contribution 분석하기. https://www.vasp.at/forum/viewtopic.php?t=273
MP 3x3x1 -> 5 k-points (/work/06472/tg857719/stampede2/CORR_Hcover/H_1ML/HCO/n0.0)
sum (band energy*occupancy) vs EBANDS
PAW double counting?

other DFT codes
https://mattermodeling.stackexchange.com/questions/1056/how-to-write-my-own-density-functional-theory-dft-code-in-python
Schrodinger Equation: https://jakevdp.github.io/blog/2012/09/05/quantum-python/