├── slides ├── .gitignore └── ks_dft_1d │ └── .gitignore ├── codes ├── .gitignore ├── qdot_2d │ ├── .gitignore │ ├── plot_harmonic_pot.jl │ ├── test_LDA_2d.jl │ ├── INC_qdot_2d.jl │ └── calc_rhoe.jl ├── KSDFT1d │ ├── README.md │ ├── tests │ │ ├── test_Fd1dGrid.jl │ │ └── test_Atoms1d.jl │ ├── emin_smearing │ │ ├── test_Urot_01.jl │ │ ├── setup_path.jl │ │ └── test_Lfunc_03.jl │ ├── Poisson_solve_sum.jl │ ├── calc_energies.jl │ ├── XCCalculator.jl │ └── INC_sch_1d.jl ├── hartree_scf │ ├── .gitignore │ └── calc_rhoe.jl ├── ks_dft_02 │ ├── .gitignore │ ├── op_K.jl │ ├── center_mol.py │ ├── test_PsPot_GTH.jl │ ├── calc_E_kin.jl │ ├── test_norm_betaNL.jl │ ├── calc_rhoe.jl │ ├── calc_energies.jl │ └── op_V_loc.jl ├── ks_dft_03 │ ├── .gitignore │ ├── op_K.jl │ ├── calc_E_kin.jl │ ├── mix_adaptive.jl │ ├── calc_rhoe.jl │ ├── calc_energies.jl │ ├── op_V_loc.jl │ └── gen_gaussian_density.jl ├── pseudopotentials │ ├── pbe_gth │ │ ├── H-q1.gth │ │ ├── He-q2.gth │ │ ├── Li-q3.gth │ │ ├── Be-q4.gth │ │ ├── B-q3.gth │ │ ├── C-q4.gth │ │ ├── F-q7.gth │ │ ├── N-q5.gth │ │ ├── O-q6.gth │ │ ├── Mg-q10.gth │ │ ├── Na-q9.gth │ │ ├── Al-q3.gth │ │ ├── Mg-q2.gth │ │ ├── P-q5.gth │ │ ├── S-q6.gth │ │ ├── Si-q4.gth │ │ ├── Ar-q8.gth │ │ ├── Cl-q7.gth │ │ ├── Ne-q8.gth │ │ ├── K-q9.gth │ │ ├── Ca-q10.gth │ │ ├── Co-q17.gth │ │ ├── Cr-q14.gth │ │ ├── Fe-q16.gth │ │ ├── Mn-q15.gth │ │ ├── Rb-q9.gth │ │ ├── Sc-q11.gth │ │ ├── Sr-q10.gth │ │ ├── Ti-q12.gth │ │ ├── V-q13.gth │ │ ├── Cu-q19.gth │ │ ├── Ni-q18.gth │ │ ├── Zn-q20.gth │ │ ├── As-q5.gth │ │ ├── Br-q7.gth │ │ ├── Ga-q3.gth │ │ ├── Ge-q4.gth │ │ ├── Kr-q8.gth │ │ ├── Se-q6.gth │ │ ├── Cu-q11.gth │ │ ├── Ga-q13.gth │ │ ├── W-q6.gth │ │ ├── Zn-q12.gth │ │ ├── At-q7.gth │ │ ├── Au-q11.gth │ │ ├── Bi-q15.gth │ │ ├── Bi-q5.gth │ │ ├── Hg-q12.gth │ │ ├── I-q7.gth │ │ ├── In-q3.gth │ │ ├── Ir-q9.gth │ │ ├── Os-q8.gth │ │ ├── Pb-q14.gth │ │ ├── Pb-q4.gth │ │ ├── Pd-q10.gth │ │ ├── Po-q6.gth │ │ ├── Pt-q10.gth │ │ ├── Re-q7.gth │ │ ├── Rh-q9.gth │ │ ├── Rn-q8.gth │ │ ├── Ru-q8.gth │ │ ├── Sb-q5.gth │ │ ├── Sn-q4.gth │ │ ├── Ta-q5.gth │ │ ├── Te-q6.gth │ │ ├── Tl-q13.gth │ │ ├── Tl-q3.gth │ │ ├── Xe-q8.gth │ │ ├── Y-q11.gth │ │ ├── Ag-q19.gth │ │ ├── Ba-q10.gth │ │ ├── Cs-q9.gth │ │ ├── Mo-q14.gth │ │ ├── Nb-q13.gth │ │ ├── Pd-q18.gth │ │ ├── Rh-q17.gth │ │ ├── Ru-q16.gth │ │ ├── Tc-q15.gth │ │ ├── Zr-q12.gth │ │ ├── La-q11.gth │ │ ├── Ce-q12.gth │ │ ├── Dy-q20.gth │ │ ├── Er-q22.gth │ │ ├── Eu-q17.gth │ │ ├── Gd-q18.gth │ │ ├── Ho-q21.gth │ │ ├── Lu-q25.gth │ │ ├── Nd-q14.gth │ │ ├── Pm-q15.gth │ │ ├── Pr-q13.gth │ │ ├── Sm-q16.gth │ │ ├── Tb-q19.gth │ │ ├── Tm-q23.gth │ │ ├── Yb-q24.gth │ │ ├── Ag-q11.gth │ │ ├── Cd-q12.gth │ │ ├── In-q13.gth │ │ ├── Os-q16.gth │ │ ├── Re-q15.gth │ │ ├── W-q14.gth │ │ ├── Ir-q17.gth │ │ ├── Ta-q13.gth │ │ ├── Hf-q12.gth │ │ ├── Ce-q30.gth │ │ ├── Au-q19.gth │ │ └── Pt-q18.gth │ ├── pade_gth │ │ ├── H-q1.gth │ │ ├── He-q2.gth │ │ ├── Be-q4.gth │ │ ├── Li-q3.gth │ │ ├── B-q3.gth │ │ ├── C-q4.gth │ │ ├── F-q7.gth │ │ ├── N-q5.gth │ │ ├── O-q6.gth │ │ ├── Be-q2.gth │ │ ├── Li-q1.gth │ │ ├── Na-q9.gth │ │ ├── Mg-q10.gth │ │ ├── Al-q3.gth │ │ ├── Ar-q8.gth │ │ ├── Cl-q7.gth │ │ ├── Mg-q2.gth │ │ ├── Na-q1.gth │ │ ├── P-q5.gth │ │ ├── S-q6.gth │ │ ├── Si-q4.gth │ │ ├── Ne-q8.gth │ │ ├── K-q9.gth │ │ ├── Rb-q9.gth │ │ ├── Sc-q11.gth │ │ ├── Sr-q10.gth │ │ ├── Ti-q12.gth │ │ ├── V-q13.gth │ │ ├── Ca-q10.gth │ │ ├── Co-q17.gth │ │ ├── Cr-q14.gth │ │ ├── Fe-q16.gth │ │ ├── Mn-q15.gth │ │ ├── Ni-q18.gth │ │ ├── Zn-q20.gth │ │ ├── Cu-q19.gth │ │ ├── As-q5.gth │ │ ├── Br-q7.gth │ │ ├── Ca-q2.gth │ │ ├── Cr-q6.gth │ │ ├── Fe-q8.gth │ │ ├── Ga-q3.gth │ │ ├── Ge-q4.gth │ │ ├── K-q1.gth │ │ ├── Kr-q8.gth │ │ ├── Mn-q7.gth │ │ ├── Sc-q3.gth │ │ ├── Se-q6.gth │ │ ├── Ti-q4.gth │ │ ├── V-q5.gth │ │ ├── Zn-q2.gth │ │ ├── Ba-q2.gth │ │ ├── Co-q9.gth │ │ ├── Cs-q1.gth │ │ ├── Cu-q1.gth │ │ ├── Cu-q11.gth │ │ ├── Ni-q10.gth │ │ ├── Zn-q12.gth │ │ ├── Ga-q13.gth │ │ ├── Ir-q9.gth │ │ ├── Mo-q6.gth │ │ ├── Nb-q5.gth │ │ ├── Os-q8.gth │ │ ├── Re-q7.gth │ │ ├── Rh-q9.gth │ │ ├── Ru-q8.gth │ │ ├── Ta-q5.gth │ │ ├── Tc-q7.gth │ │ ├── W-q6.gth │ │ ├── Ag-q1.gth │ │ ├── At-q7.gth │ │ ├── Au-q11.gth │ │ ├── Bi-q5.gth │ │ ├── Cd-q2.gth │ │ ├── Hg-q12.gth │ │ ├── Hg-q2.gth │ │ ├── I-q7.gth │ │ ├── In-q3.gth │ │ ├── Pb-q4.gth │ │ ├── Pd-q10.gth │ │ ├── Po-q6.gth │ │ ├── Pt-q10.gth │ │ ├── Rn-q8.gth │ │ ├── Sb-q5.gth │ │ ├── Sn-q4.gth │ │ ├── Te-q6.gth │ │ ├── Tl-q13.gth │ │ ├── Tl-q3.gth │ │ ├── Xe-q8.gth │ │ ├── Ag-q19.gth │ │ ├── Mo-q14.gth │ │ ├── Nb-q13.gth │ │ ├── Rh-q17.gth │ │ ├── Ru-q16.gth │ │ ├── Tc-q15.gth │ │ ├── Y-q11.gth │ │ ├── Zr-q12.gth │ │ ├── Au-q1.gth │ │ ├── Ba-q10.gth │ │ ├── Cs-q9.gth │ │ ├── Pd-q18.gth │ │ ├── Rb-q1.gth │ │ ├── Sr-q2.gth │ │ ├── Dy-q20.gth │ │ ├── Er-q22.gth │ │ ├── Eu-q17.gth │ │ ├── Ho-q21.gth │ │ ├── Nd-q14.gth │ │ ├── Pm-q15.gth │ │ ├── Pr-q13.gth │ │ ├── Tb-q19.gth │ │ ├── Ce-q12.gth │ │ ├── Gd-q18.gth │ │ ├── Lu-q25.gth │ │ ├── Sm-q16.gth │ │ ├── Tm-q23.gth │ │ ├── Yb-q24.gth │ │ ├── Ag-q11.gth │ │ ├── Cd-q12.gth │ │ ├── In-q13.gth │ │ ├── Y-q3.gth │ │ ├── Zr-q4.gth │ │ ├── W-q14.gth │ │ ├── Hf-q12.gth │ │ ├── Ir-q17.gth │ │ ├── Os-q16.gth │ │ ├── Pt-q18.gth │ │ ├── Re-q15.gth │ │ ├── Ta-q13.gth │ │ ├── La-q11.gth │ │ └── Au-q19.gth │ └── README.md ├── structures │ ├── HCl.xyz │ ├── O2.xyz │ ├── NH3_cell.xyz │ ├── CO.xyz │ ├── LiH.xyz │ ├── HCl_cell.xyz │ ├── LiH_cell.xyz │ ├── H2O.xyz │ ├── H2O_cell.xyz │ ├── center_mol_default.py │ ├── center_mol_about0.py │ ├── NH3.xyz │ ├── CH4.xyz │ ├── CH4_cell.xyz │ ├── SiH4.xyz │ └── SiH4_cell.xyz ├── xc_works │ ├── integer_numeric.py │ ├── integer_symbols.py │ ├── LDA_x_v2.py │ └── LDA_notes.md ├── FD1d │ ├── calc_deriv.py │ ├── build_D1_matrix_3pt.jl │ ├── init_FD1d_grid.jl │ ├── init_FD1d_p_grid.jl │ ├── build_D1_matrix_p_3pt.jl │ ├── build_D1_matrix_5pt.jl │ ├── build_D2_matrix_3pt.jl │ ├── build_D2_matrix_p_3pt.jl │ ├── build_D1_matrix_p_5pt.jl │ ├── build_D1_matrix_7pt.jl │ └── build_D2_matrix_5pt.jl ├── modelscf1d │ ├── reference_impl │ │ ├── README.md │ │ ├── op_Vtot.jl │ │ ├── test_hartree_pot_bc.jl │ │ └── OrigModelSCF1d.jl │ ├── test_Atoms1d.jl │ ├── ModelSCF1d.jl │ ├── Atoms1d.jl │ └── Electrons.jl ├── common │ ├── NoPreconditioner.jl │ ├── XCCalculator.jl │ ├── constants.jl │ ├── XC_funcs │ │ ├── XC_x_slater.jl │ │ ├── XC_x_slater_spin_E.jl │ │ ├── XC_c_pw_E.jl │ │ ├── XC_x_pbe_E.jl │ │ ├── XC_x_slater_spin.jl │ │ ├── XC_c_pbe_E.jl │ │ └── XC_c_pw.jl │ ├── ortho_sqrt.jl │ ├── supporting_functions.jl │ ├── calc_dr_periodic.jl │ └── XC_functionals_internal.jl ├── sch_2d │ ├── INC_sch_2d_LF.jl │ └── INC_sch_2d.jl ├── LF1d │ ├── init_LF1d_c_grid.jl │ ├── init_LF1d_p_grid.jl │ ├── build_D2_matrix_LF1d_sinc.jl │ ├── build_D1_matrix_LF1d_p.jl │ ├── init_LF1d_sinc_grid.jl │ └── build_D2_matrix_LF1d_p.jl ├── sch_3d │ ├── INC_sch_3d.jl │ └── INC_sch_3d_LF.jl ├── poisson_3d │ ├── INC_poisson_3d.jl │ └── test_GVectors.jl ├── Project.toml ├── ks_dft_04 │ ├── calc_E_kin.jl │ ├── mix_linear.jl │ └── calc_rhoe.jl ├── sparse │ ├── test_02.jl │ └── test_ILU0Preconditioner.jl ├── ks_dft_1d │ ├── main_gaussian_integ_01.jl │ └── INC_sch_1d.jl ├── FD2d │ └── main_FD2dGrid.jl ├── LF2d │ └── build_nabla2_matrix.jl ├── ks_dft_01 │ └── calc_rhoe.jl └── sch_1d │ └── INC_sch_1d.jl ├── book ├── .gitignore ├── run_tex.sh ├── clean.sh ├── build.sh ├── dedication.tex ├── Epilogue.tex └── acknowledgement.tex ├── codes_old ├── .gitignore ├── 1d_adaptive │ └── deformation_func_sech.jl ├── ortho_sqrt.jl ├── 2d │ ├── test_FD2dGrid.jl │ └── build_nabla2_matrix.jl ├── 1d_per │ ├── test_init_FD1d_grid_per.jl │ ├── init_FD1d_grid_per.jl │ ├── build_D2_matrix_3pt_per.jl │ └── test_D2_matrix.jl ├── 1d │ ├── init_FD1d_grid.jl │ ├── build_D2_matrix_3pt.jl │ ├── test_D2_matrix.jl │ ├── build_D2_matrix_5pt.jl │ ├── test_init_FD1d_grid.jl │ └── test_harmonic_1d.jl ├── ks_part1 │ ├── old_v01 │ │ └── calc_rhoe.jl │ ├── hartree_scf │ │ └── calc_rhoe.jl │ └── ks_scf │ │ └── calc_rhoe.jl ├── supporting_functions.jl └── 3d │ ├── visualize_wavefunc.jl │ └── build_nabla2_matrix.jl ├── octopus_works ├── H_atom │ ├── H.xyz │ └── inp ├── Ar_atom │ ├── Ar.xyz │ └── inp ├── Ne_atom │ ├── Ne.xyz │ └── inp ├── clean.sh ├── H_atom_periodic │ ├── H.xyz │ └── inp ├── 3d_gauss │ ├── clean.sh │ └── inp ├── 3d_harm │ ├── clean.sh │ └── inp ├── Ne_atom_periodic │ ├── Ne.xyz │ └── inp ├── 3d_harm_HF │ ├── clean.sh │ └── inp ├── 3d_harm_hartree │ ├── clean.sh │ └── inp ├── .gitignore ├── HCl │ ├── HCl.xyz │ └── inp ├── LiH │ ├── LiH.xyz │ └── inp ├── LiH_periodic │ ├── LiH.xyz │ └── inp ├── H2O │ ├── H2O.xyz │ └── inp ├── NH3 │ ├── NH3.xyz │ └── inp ├── CH4 │ ├── CH4.xyz │ └── inp ├── SiH4 │ ├── SiH4.xyz │ └── inp ├── CH4_periodic │ ├── CH4_cell.xyz │ └── inp ├── H2 │ └── inp ├── H_atom_ps │ └── inp └── H2_atom_ps │ └── inp ├── release └── ImplementingDFT.pdf └── expl_julia ├── modify_array1.jl ├── modify_kwarg.jl ├── test_structArray.jl └── test_2struct.jl /slides/.gitignore: -------------------------------------------------------------------------------- 1 | Slides*.pdf 2 | -------------------------------------------------------------------------------- /codes/.gitignore: -------------------------------------------------------------------------------- 1 | Manifest.toml 2 | -------------------------------------------------------------------------------- /codes/qdot_2d/.gitignore: -------------------------------------------------------------------------------- 1 | works 2 | -------------------------------------------------------------------------------- /book/.gitignore: -------------------------------------------------------------------------------- 1 | ImplementingDFT.pdf 2 | -------------------------------------------------------------------------------- /codes/KSDFT1d/README.md: -------------------------------------------------------------------------------- 1 | Using module. 2 | -------------------------------------------------------------------------------- /slides/ks_dft_1d/.gitignore: -------------------------------------------------------------------------------- 1 | Slides*.pdf 2 | -------------------------------------------------------------------------------- /codes/hartree_scf/.gitignore: -------------------------------------------------------------------------------- 1 | test_conv_* 2 | -------------------------------------------------------------------------------- /codes/ks_dft_02/.gitignore: -------------------------------------------------------------------------------- 1 | test_conv*.jl 2 | -------------------------------------------------------------------------------- /codes/ks_dft_03/.gitignore: -------------------------------------------------------------------------------- 1 | test_conv*.jl 2 | -------------------------------------------------------------------------------- /codes_old/.gitignore: -------------------------------------------------------------------------------- 1 | *.data 2 | IMG_* 3 | *.xsf 4 | -------------------------------------------------------------------------------- /octopus_works/H_atom/H.xyz: -------------------------------------------------------------------------------- 1 | 1 2 | 3 | H 0.0 0.0 0.0 -------------------------------------------------------------------------------- /octopus_works/Ar_atom/Ar.xyz: -------------------------------------------------------------------------------- 1 | 1 2 | 3 | Ar 0.0 0.0 0.0 -------------------------------------------------------------------------------- /octopus_works/Ne_atom/Ne.xyz: -------------------------------------------------------------------------------- 1 | 1 2 | 3 | Ne 0.0 0.0 0.0 -------------------------------------------------------------------------------- /octopus_works/clean.sh: -------------------------------------------------------------------------------- 1 | rm -rv "exec/" restart/ static/ 2 | -------------------------------------------------------------------------------- /octopus_works/H_atom_periodic/H.xyz: -------------------------------------------------------------------------------- 1 | 1 2 | 3 | H 0.0 0.0 0.0 -------------------------------------------------------------------------------- /book/run_tex.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | lualatex -shell-escape $1 4 | -------------------------------------------------------------------------------- /octopus_works/3d_gauss/clean.sh: -------------------------------------------------------------------------------- 1 | rm -rv "exec/" restart/ static/ 2 | -------------------------------------------------------------------------------- /octopus_works/3d_harm/clean.sh: -------------------------------------------------------------------------------- 1 | rm -rv "exec/" restart/ static/ 2 | -------------------------------------------------------------------------------- /octopus_works/Ne_atom_periodic/Ne.xyz: -------------------------------------------------------------------------------- 1 | 1 2 | 3 | Ne 0.0 0.0 0.0 -------------------------------------------------------------------------------- /octopus_works/3d_harm_HF/clean.sh: -------------------------------------------------------------------------------- 1 | rm -rv "exec/" restart/ static/ 2 | -------------------------------------------------------------------------------- /octopus_works/3d_harm_hartree/clean.sh: -------------------------------------------------------------------------------- 1 | rm -rv "exec/" restart/ static/ 2 | -------------------------------------------------------------------------------- /octopus_works/.gitignore: -------------------------------------------------------------------------------- 1 | restart 2 | exec 3 | static 4 | info* 5 | CONVTEST 6 | EGGBOX 7 | -------------------------------------------------------------------------------- /codes_old/1d_adaptive/deformation_func_sech.jl: -------------------------------------------------------------------------------- 1 | function deformation_func(r, A, a) 2 | return A*sech(r/a) 3 | end -------------------------------------------------------------------------------- /book/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm -vf *.aux *.log *.synctex.gz *.fdb_latexmk *.fls *.idx *.idg *.out *.thm *.ilg *.toc 3 | -------------------------------------------------------------------------------- /release/ImplementingDFT.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f-fathurrahman/ImplementingDFT/HEAD/release/ImplementingDFT.pdf -------------------------------------------------------------------------------- /codes/ks_dft_02/op_K.jl: -------------------------------------------------------------------------------- 1 | # Kinetic operator 2 | function op_K( Ham::Hamiltonian, psi ) 3 | return -0.5*Ham.∇2 * psi 4 | end -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/H-q1.gth: -------------------------------------------------------------------------------- 1 | H GTH-PBE-q1 2 | 1 0 0 0 3 | 0.20000000 2 4 | -4.17890044 0.72446331 5 | 0 6 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/He-q2.gth: -------------------------------------------------------------------------------- 1 | He GTH-PBE-q2 2 | 2 0 0 0 3 | 0.20000000 2 4 | -9.12214383 1.70270770 5 | 0 6 | -------------------------------------------------------------------------------- /codes/ks_dft_03/op_K.jl: -------------------------------------------------------------------------------- 1 | # Kinetic operator 2 | function op_K( Ham::Hamiltonian, psi ) 3 | return -0.5*Ham.Laplacian * psi 4 | end -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/H-q1.gth: -------------------------------------------------------------------------------- 1 | H GTH-PADE-q1 GTH-LDA-q1 2 | 1 0 0 0 3 | 0.20000000 2 4 | -4.18023680 0.72507482 5 | 0 6 | -------------------------------------------------------------------------------- /codes/structures/HCl.xyz: -------------------------------------------------------------------------------- 1 | 2 2 | 3 | Cl -1.14810 1.09309 0.00000 4 | H 0.18190 1.09309 0.00000 -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/He-q2.gth: -------------------------------------------------------------------------------- 1 | He GTH-PADE-q2 GTH-LDA-q2 2 | 2 0 0 0 3 | 0.20000000 2 4 | -9.11202340 1.69836797 5 | 0 6 | -------------------------------------------------------------------------------- /octopus_works/HCl/HCl.xyz: -------------------------------------------------------------------------------- 1 | 2 2 | 3 | Cl -1.14810 1.09309 0.00000 4 | H 0.18190 1.09309 0.00000 -------------------------------------------------------------------------------- /codes/structures/O2.xyz: -------------------------------------------------------------------------------- 1 | 2 2 | 3 | O 0.622978 0.00000000 0.00000000 4 | O -0.622978 0.00000000 0.00000000 5 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Li-q3.gth: -------------------------------------------------------------------------------- 1 | Li GTH-PBE-q3 2 | 3 0 0 0 3 | 0.40000000 4 4 | -14.08115455 9.62621962 -1.78361605 0.08515207 5 | 0 6 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Be-q4.gth: -------------------------------------------------------------------------------- 1 | Be GTH-PBE-q4 2 | 4 0 0 0 3 | 0.32500000 4 4 | -24.06746684 17.27902186 -3.33910629 0.16554912 5 | 0 6 | -------------------------------------------------------------------------------- /codes/xc_works/integer_numeric.py: -------------------------------------------------------------------------------- 1 | from sympy import N, pi 2 | 3 | ONE = 1 4 | TWO = 2 5 | THREE = 3 6 | FOUR = 4 7 | EIGHT = 8 8 | NINE = 9 9 | #pi = N(pi) -------------------------------------------------------------------------------- /codes/pseudopotentials/README.md: -------------------------------------------------------------------------------- 1 | The parameters are taken from CP2K's `GTH_POTENTIALS` file. 2 | The coupling matrix elements (h11,...,h33) are given explicitly. 3 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Be-q4.gth: -------------------------------------------------------------------------------- 1 | Be GTH-PADE-q4 GTH-LDA-q4 2 | 4 0 0 0 3 | 0.32500000 4 4 | -24.01504092 17.20401444 -3.32639018 0.16541943 5 | 0 6 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Li-q3.gth: -------------------------------------------------------------------------------- 1 | Li GTH-PADE-q3 GTH-LDA-q3 2 | 3 0 0 0 3 | 0.40000000 4 4 | -14.03486849 9.55347627 -1.76648817 0.08436998 5 | 0 6 | -------------------------------------------------------------------------------- /codes/FD1d/calc_deriv.py: -------------------------------------------------------------------------------- 1 | from sympy import * 2 | 3 | x = Symbol("x", real=True) 4 | ω = Symbol("omega", real=True) 5 | 6 | f = exp( -10*sin(ω*x)**2 ) 7 | print( diff(f,x,2) ) -------------------------------------------------------------------------------- /codes/modelscf1d/reference_impl/README.md: -------------------------------------------------------------------------------- 1 | Original: https://github.com/lin-lin/modelscf 2 | 3 | The files in this directory are slightly modified (function renames, etc). 4 | -------------------------------------------------------------------------------- /book/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | lualatex -shell-escape ImplementingDFT.tex 4 | bibtex ImplementingDFT 5 | makeindex ImplementingDFT 6 | lualatex -shell-escape ImplementingDFT.tex 7 | -------------------------------------------------------------------------------- /book/dedication.tex: -------------------------------------------------------------------------------- 1 | \begin{dedication} 2 | 3 | Untuk Mariya Al Qibtiya Nasution, istriku tercinta {\color{red}$\heartsuit$} 4 | 5 | \end{dedication} 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /codes/xc_works/integer_symbols.py: -------------------------------------------------------------------------------- 1 | from sympy import Integer 2 | 3 | ONE = Integer(1) 4 | TWO = Integer(2) 5 | THREE = Integer(3) 6 | FOUR = Integer(4) 7 | EIGHT = Integer(8) 8 | NINE = Integer(9) -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/B-q3.gth: -------------------------------------------------------------------------------- 1 | B GTH-PBE-q3 2 | 2 1 0 0 3 | 0.41899145 2 4 | -5.85946171 0.90375643 5 | 2 6 | 0.37132046 1 7 | 6.29728018 8 | 0.36456308 0 9 | 10 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/C-q4.gth: -------------------------------------------------------------------------------- 1 | C GTH-PBE-q4 2 | 2 2 0 0 3 | 0.33847124 2 4 | -8.80367398 1.33921085 5 | 2 6 | 0.30257575 1 7 | 9.62248665 8 | 0.29150694 0 9 | 10 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/F-q7.gth: -------------------------------------------------------------------------------- 1 | F GTH-PBE-q7 2 | 2 5 0 0 3 | 0.21492959 2 4 | -21.57302836 3.19977615 5 | 2 6 | 0.19468402 1 7 | 23.74354045 8 | 0.18615608 0 9 | 10 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/N-q5.gth: -------------------------------------------------------------------------------- 1 | N GTH-PBE-q5 2 | 2 3 0 0 3 | 0.28379051 2 4 | -12.41522559 1.86809592 5 | 2 6 | 0.25540500 1 7 | 13.63026257 8 | 0.24549453 0 9 | 10 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/O-q6.gth: -------------------------------------------------------------------------------- 1 | O GTH-PBE-q6 2 | 2 4 0 0 3 | 0.24455430 2 4 | -16.66721480 2.48731132 5 | 2 6 | 0.22095592 1 7 | 18.33745811 8 | 0.21133247 0 9 | 10 | -------------------------------------------------------------------------------- /codes/KSDFT1d/tests/test_Fd1dGrid.jl: -------------------------------------------------------------------------------- 1 | push!(LOAD_PATH, "../") 2 | 3 | using KSDFT1d 4 | 5 | function test_isolated() 6 | grid = FD1dGrid( (-5.0, 5.0), 51 ) 7 | println(grid) 8 | end 9 | 10 | test_isolated() -------------------------------------------------------------------------------- /book/Epilogue.tex: -------------------------------------------------------------------------------- 1 | \chapter{Epilogue} 2 | 3 | Pointers to more advanced study materials, softwares. 4 | 5 | 6 | \section{Test Citation} 7 | 8 | Test citation \cite{MichaudRioux2016}, \cite{VanMourik2014}, 9 | \cite{Banerjee2016} -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/B-q3.gth: -------------------------------------------------------------------------------- 1 | B GTH-PADE-q3 GTH-LDA-q3 2 | 2 1 0 0 3 | 0.43392956 2 4 | -5.57864173 0.80425145 5 | 2 6 | 0.37384326 1 7 | 6.23392822 8 | 0.36039317 0 9 | 10 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/C-q4.gth: -------------------------------------------------------------------------------- 1 | C GTH-PADE-q4 GTH-LDA-q4 2 | 2 2 0 0 3 | 0.34883045 2 4 | -8.51377110 1.22843203 5 | 2 6 | 0.30455321 1 7 | 9.52284179 8 | 0.23267730 0 9 | 10 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/F-q7.gth: -------------------------------------------------------------------------------- 1 | F GTH-PADE-q7 GTH-LDA-q7 2 | 2 5 0 0 3 | 0.21852465 2 4 | -21.30736112 3.07286942 5 | 2 6 | 0.19556721 1 7 | 23.58494211 8 | 0.17426832 0 9 | 10 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/N-q5.gth: -------------------------------------------------------------------------------- 1 | N GTH-PADE-q5 GTH-LDA-q5 2 | 2 3 0 0 3 | 0.28917923 2 4 | -12.23481988 1.76640728 5 | 2 6 | 0.25660487 1 7 | 13.55224272 8 | 0.27013369 0 9 | 10 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/O-q6.gth: -------------------------------------------------------------------------------- 1 | O GTH-PADE-q6 GTH-LDA-q6 2 | 2 4 0 0 3 | 0.24762086 2 4 | -16.58031797 2.39570092 5 | 2 6 | 0.22178614 1 7 | 18.26691718 8 | 0.25682890 0 9 | 10 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Mg-q10.gth: -------------------------------------------------------------------------------- 1 | Mg GTH-PBE-q10 2 | 4 6 0 0 3 | 0.19275787 2 4 | -20.57539077 3.04016732 5 | 2 6 | 0.14140682 1 7 | 41.04729209 8 | 0.10293187 1 9 | -9.98562566 10 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Na-q9.gth: -------------------------------------------------------------------------------- 1 | Na GTH-PBE-q9 2 | 3 6 0 0 3 | 0.23652322 2 4 | 0.29510499 -0.91388488 5 | 2 6 | 0.14356046 1 7 | 34.60149228 8 | 0.12993224 1 9 | -14.27746168 10 | -------------------------------------------------------------------------------- /codes_old/ortho_sqrt.jl: -------------------------------------------------------------------------------- 1 | function ortho_sqrt( psi ) 2 | Udagger = inv(sqrt(psi'*psi)) 3 | return psi*Udagger 4 | end 5 | 6 | function ortho_sqrt!( psi ) 7 | Udagger = inv(sqrt(psi'*psi)) 8 | psi[:,:] = psi*Udagger 9 | end -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Be-q2.gth: -------------------------------------------------------------------------------- 1 | Be GTH-PADE-q2 GTH-LDA-q2 2 | 2 0 0 0 3 | 0.73900865 2 4 | -2.59295078 0.35483893 5 | 2 6 | 0.52879656 1 7 | 3.06166591 8 | 0.65815348 1 9 | 0.09246196 10 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Li-q1.gth: -------------------------------------------------------------------------------- 1 | Li GTH-PADE-q1 GTH-LDA-q1 2 | 1 0 0 0 3 | 0.78755305 2 4 | -1.89261247 0.28605968 5 | 2 6 | 0.66637518 1 7 | 1.85881111 8 | 1.07930561 1 9 | -0.00589504 10 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Na-q9.gth: -------------------------------------------------------------------------------- 1 | Na GTH-PADE-q9 GTH-LDA-q9 2 | 3 6 0 0 3 | 0.24631780 2 4 | -7.54559253 1.12599671 5 | 2 6 | 0.14125125 1 7 | 36.55698653 8 | 0.13966840 1 9 | -10.39208332 10 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Mg-q10.gth: -------------------------------------------------------------------------------- 1 | Mg GTH-PADE-q10 GTH-LDA-q10 2 | 4 6 0 0 3 | 0.21094954 2 4 | -19.41900751 2.87133099 5 | 2 6 | 0.14154696 1 7 | 40.31662629 8 | 0.10546902 1 9 | -10.89111329 10 | -------------------------------------------------------------------------------- /codes_old/2d/test_FD2dGrid.jl: -------------------------------------------------------------------------------- 1 | using Printf 2 | 3 | include("FD2dGrid.jl") 4 | 5 | function main() 6 | Nx = 50 7 | Ny = 50 8 | fdgrid = FD2dGrid( (-5.0,5.0), Nx, (-5.0,5.0), Ny ) 9 | println(fdgrid) 10 | end 11 | 12 | main() -------------------------------------------------------------------------------- /codes/common/NoPreconditioner.jl: -------------------------------------------------------------------------------- 1 | struct NoPreconditioner end 2 | 3 | function NoPreconditioner(M) 4 | return NoPreconditioner() 5 | end 6 | 7 | import LinearAlgebra: ldiv! 8 | function ldiv!( prec::NoPreconditioner, v ) 9 | return 10 | end -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Al-q3.gth: -------------------------------------------------------------------------------- 1 | Al GTH-PBE-q3 2 | 2 1 0 0 3 | 0.45000000 1 4 | -7.55476126 5 | 2 6 | 0.48743529 2 7 | 6.95993832 -1.88883584 8 | 2.43847659 9 | 0.56218949 1 10 | 1.86529857 11 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Mg-q2.gth: -------------------------------------------------------------------------------- 1 | Mg GTH-PBE-q2 2 | 2 0 0 0 3 | 0.57696017 1 4 | -2.69040744 5 | 2 6 | 0.59392350 2 7 | 3.50321099 -0.71677167 8 | 0.92534825 9 | 0.70715728 1 10 | 0.83115848 11 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/P-q5.gth: -------------------------------------------------------------------------------- 1 | P GTH-PBE-q5 2 | 2 3 0 0 3 | 0.43000000 1 4 | -5.87594327 5 | 2 6 | 0.39637742 2 7 | 11.00886207 -3.47035607 8 | 4.48021042 9 | 0.44829838 1 10 | 3.05606416 11 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/S-q6.gth: -------------------------------------------------------------------------------- 1 | S GTH-PBE-q6 2 | 2 4 0 0 3 | 0.42000000 1 4 | -5.98626038 5 | 2 6 | 0.36482035 2 7 | 13.14354448 -4.24183045 8 | 5.47617957 9 | 0.40948048 1 10 | 3.70089057 11 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Si-q4.gth: -------------------------------------------------------------------------------- 1 | Si GTH-PBE-q4 2 | 2 2 0 0 3 | 0.44000000 1 4 | -6.26928833 5 | 2 6 | 0.43563383 2 7 | 8.95174150 -2.70627082 8 | 3.49378060 9 | 0.49794218 1 10 | 2.43127673 11 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ar-q8.gth: -------------------------------------------------------------------------------- 1 | Ar GTH-PBE-q8 2 | 2 6 0 0 3 | 0.40000000 1 4 | -7.10000000 5 | 2 6 | 0.31881468 2 7 | 17.25203807 -5.58548836 8 | 7.21083447 9 | 0.35337019 1 10 | 4.97421551 11 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Cl-q7.gth: -------------------------------------------------------------------------------- 1 | Cl GTH-PBE-q7 2 | 2 5 0 0 3 | 0.41000000 1 4 | -6.39208181 5 | 2 6 | 0.33953864 2 7 | 15.21898983 -4.93452321 8 | 6.37044208 9 | 0.37847416 1 10 | 4.33877527 11 | -------------------------------------------------------------------------------- /codes/structures/NH3_cell.xyz: -------------------------------------------------------------------------------- 1 | 4 2 | 3 | N 4.09146768 4.32366768 3.89321768 4 | H 3.64976768 4.61426768 4.76431768 5 | H 4.81706768 5.01326768 3.70251768 6 | H 4.57896768 3.45356768 4.10211768 7 | -------------------------------------------------------------------------------- /codes/structures/CO.xyz: -------------------------------------------------------------------------------- 1 | 2 2 | Lattice="10.0 0.0 0.0 0.0 10.0 0.0 0.0 0.0 11.15034" Properties=species:S:1:pos:R:3:Z:I:1 pbc="T T T" 3 | O 5.00000000 5.00000000 6.15034000 8 4 | C 5.00000000 5.00000000 5.00000000 6 5 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Al-q3.gth: -------------------------------------------------------------------------------- 1 | Al GTH-PADE-q3 GTH-LDA-q3 2 | 2 1 0 0 3 | 0.45000000 1 4 | -8.49135116 5 | 2 6 | 0.46010427 2 7 | 5.08833953 -1.03784325 8 | 2.67969975 9 | 0.53674439 1 10 | 2.19343827 11 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ar-q8.gth: -------------------------------------------------------------------------------- 1 | Ar GTH-PADE-q8 GTH-LDA-q8 2 | 2 6 0 0 3 | 0.40000000 1 4 | -7.10000000 5 | 2 6 | 0.31738081 2 7 | 10.24948699 -2.16984522 8 | 5.60251627 9 | 0.35161921 1 10 | 4.97880101 11 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Cl-q7.gth: -------------------------------------------------------------------------------- 1 | Cl GTH-PADE-q7 GTH-LDA-q7 2 | 2 5 0 0 3 | 0.41000000 1 4 | -6.86475431 5 | 2 6 | 0.33820832 2 7 | 9.06223968 -1.96193036 8 | 5.06568240 9 | 0.37613709 1 10 | 4.46587640 11 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Mg-q2.gth: -------------------------------------------------------------------------------- 1 | Mg GTH-PADE-q2 GTH-LDA-q2 2 | 2 0 0 0 3 | 0.65181169 1 4 | -2.86429746 5 | 2 6 | 0.55647814 2 7 | 2.97095712 -0.51508390 8 | 1.32994091 9 | 0.67756881 1 10 | 1.04988101 11 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Na-q1.gth: -------------------------------------------------------------------------------- 1 | Na GTH-PADE-q1 GTH-LDA-q1 2 | 1 0 0 0 3 | 0.88550938 1 4 | -1.23886713 5 | 2 6 | 0.66110390 2 7 | 1.84727135 -0.22540903 8 | 0.58200362 9 | 0.85711928 1 10 | 0.47113258 11 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/P-q5.gth: -------------------------------------------------------------------------------- 1 | P GTH-PADE-q5 GTH-LDA-q5 2 | 2 3 0 0 3 | 0.43000000 1 4 | -6.65421981 5 | 2 6 | 0.38980284 2 7 | 6.84213556 -1.49369090 8 | 3.85669332 9 | 0.44079585 1 10 | 3.28260592 11 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/S-q6.gth: -------------------------------------------------------------------------------- 1 | S GTH-PADE-q6 GTH-LDA-q6 2 | 2 4 0 0 3 | 0.42000000 1 4 | -6.55449184 5 | 2 6 | 0.36175665 2 7 | 7.90530250 -1.73188130 8 | 4.47169830 9 | 0.40528502 1 10 | 3.86657900 11 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Si-q4.gth: -------------------------------------------------------------------------------- 1 | Si GTH-PADE-q4 GTH-LDA-q4 2 | 2 2 0 0 3 | 0.44000000 1 4 | -7.33610297 5 | 2 6 | 0.42273813 2 7 | 5.90692831 -1.26189397 8 | 3.25819622 9 | 0.48427842 1 10 | 2.72701346 11 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ne-q8.gth: -------------------------------------------------------------------------------- 1 | Ne GTH-PBE-q8 2 | 2 6 0 0 3 | 0.19000000 2 4 | -27.12015973 4.36044962 5 | 2 6 | 0.17605938 2 7 | 28.17737082 0.83365601 8 | -1.07624528 9 | 0.19547452 1 10 | -0.23629360 11 | -------------------------------------------------------------------------------- /codes_old/1d_per/test_init_FD1d_grid_per.jl: -------------------------------------------------------------------------------- 1 | include("init_FD1d_grid_per.jl") 2 | 3 | function main() 4 | A = -5.0 5 | B = 5.0 6 | Npoints = 8 7 | x, h = init_FD1d_grid_per( A, B, Npoints ) 8 | println(x) 9 | println(h) 10 | end 11 | 12 | main() -------------------------------------------------------------------------------- /codes/structures/LiH.xyz: -------------------------------------------------------------------------------- 1 | 2 2 | Lattice="8.466835369021458 0.0 0.0 0.0 8.466835369021458 0.0 0.0 0.0 8.466835369021458" Properties=species:S:1:pos:R:3 =T pbc="T T T" 3 | H -0.75000000 0.00000000 0.00000000 4 | Li 0.75000000 0.00000000 0.00000000 5 | -------------------------------------------------------------------------------- /octopus_works/LiH/LiH.xyz: -------------------------------------------------------------------------------- 1 | 2 2 | Lattice="8.466835369021458 0.0 0.0 0.0 8.466835369021458 0.0 0.0 0.0 8.466835369021458" Properties=species:S:1:pos:R:3 =T pbc="T T T" 3 | H -0.75000000 0.00000000 0.00000000 4 | Li 0.75000000 0.00000000 0.00000000 5 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ne-q8.gth: -------------------------------------------------------------------------------- 1 | Ne GTH-PADE-q8 GTH-LDA-q8 2 | 2 6 0 0 3 | 0.19000000 2 4 | -27.69285182 4.00590585 5 | 2 6 | 0.17948804 2 7 | 28.50609828 0.41682800 8 | -1.07624528 9 | 0.21491271 1 10 | -0.00008991 11 | -------------------------------------------------------------------------------- /codes/qdot_2d/plot_harmonic_pot.jl: -------------------------------------------------------------------------------- 1 | import PyPlot 2 | const plt = PyPlot 3 | 4 | function main() 5 | ω = 0.22 6 | x = range(-25.0, stop=25.0, length=51) 7 | V = 0.5 * ω^2 * x.^2 8 | 9 | plt.plot(x, V) 10 | plt.savefig("IMG_harm_pot.pdf") 11 | end 12 | 13 | main() -------------------------------------------------------------------------------- /codes/structures/HCl_cell.xyz: -------------------------------------------------------------------------------- 1 | 2 2 | Lattice="8.466835369021458 0.0 0.0 0.0 8.466835369021458 0.0 0.0 0.0 8.466835369021458" Properties=species:S:1:pos:R:3 =T pbc="T T T" 3 | Cl 3.56841768 4.23341768 4.23341768 4 | H 4.89841768 4.23341768 4.23341768 5 | -------------------------------------------------------------------------------- /codes/structures/LiH_cell.xyz: -------------------------------------------------------------------------------- 1 | 2 2 | Lattice="8.466835369021458 0.0 0.0 0.0 8.466835369021458 0.0 0.0 0.0 8.466835369021458" Properties=species:S:1:pos:R:3 =T pbc="T T T" 3 | H 3.48341768 4.23341768 4.23341768 4 | Li 4.98341768 4.23341768 4.23341768 5 | -------------------------------------------------------------------------------- /octopus_works/LiH_periodic/LiH.xyz: -------------------------------------------------------------------------------- 1 | 2 2 | Lattice="8.466835369021458 0.0 0.0 0.0 8.466835369021458 0.0 0.0 0.0 8.466835369021458" Properties=species:S:1:pos:R:3 =T pbc="T T T" 3 | H -0.75000000 0.00000000 0.00000000 4 | Li 0.75000000 0.00000000 0.00000000 5 | -------------------------------------------------------------------------------- /codes/common/XCCalculator.jl: -------------------------------------------------------------------------------- 1 | abstract type AbstractXCCalculator 2 | end 3 | 4 | # Use internal XC 5 | struct XCCalculator <: AbstractXCCalculator 6 | end 7 | 8 | # Use Libxc 9 | struct LibxcXCCalculator <: AbstractXCCalculator 10 | end 11 | 12 | # These types should contain xcfunc field 13 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/K-q9.gth: -------------------------------------------------------------------------------- 1 | K GTH-PBE-q9 2 | 3 6 0 0 3 | 0.40000000 2 4 | -3.36355184 -1.08652975 5 | 2 6 | 0.30531772 2 7 | 17.85062321 -5.62264870 8 | 7.25880826 9 | 0.31648432 2 10 | 7.33378021 -2.46094505 11 | 2.91182945 12 | -------------------------------------------------------------------------------- /codes/sch_2d/INC_sch_2d_LF.jl: -------------------------------------------------------------------------------- 1 | include("../LF2d/LF2dGrid.jl") 2 | include("../LF2d/build_nabla2_matrix.jl") 3 | include("../common/supporting_functions.jl") 4 | include("../common/diag_Emin_PCG.jl") 5 | include("../common/diag_LOBPCG.jl") 6 | include("../common/ortho_sqrt.jl") 7 | include("../common/ortho_gram_schmidt.jl") -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/K-q9.gth: -------------------------------------------------------------------------------- 1 | K GTH-PADE-q9 GTH-LDA-q9 2 | 3 6 0 0 3 | 0.40000000 2 4 | -4.98934751 -0.75604821 5 | 2 6 | 0.29482550 2 7 | 11.23870466 -2.73733893 8 | 7.06777871 9 | 0.32235865 2 10 | 5.25670239 -0.39677748 11 | 0.93894690 12 | -------------------------------------------------------------------------------- /codes/FD1d/build_D1_matrix_3pt.jl: -------------------------------------------------------------------------------- 1 | """ 2 | f_x = (-1*f[i-1] + 0*f[i+0] + 1*f[i+1])/(2*h**1) 3 | """ 4 | function build_D1_matrix_3pt( N::Int64, h::Float64 ) 5 | mat = zeros(Float64,N,N) 6 | for i = 1:N-1 7 | mat[i,i+1] = 1.0 8 | mat[i+1,i] = -1.0 9 | end 10 | 11 | return mat/(2*h) 12 | 13 | end -------------------------------------------------------------------------------- /codes/FD1d/init_FD1d_grid.jl: -------------------------------------------------------------------------------- 1 | function init_FD1d_grid( x_min::Float64, x_max::Float64, N::Int64 ) 2 | L = x_max - x_min 3 | h = L/(N-1) 4 | x = zeros(Float64,N) 5 | for i = 1:N 6 | x[i] = x_min + (i-1)*h 7 | end 8 | return x, h 9 | end 10 | 11 | init_FD1d_grid( X, N ) = init_FD1d_grid( X[1], X[2], N ) -------------------------------------------------------------------------------- /codes/KSDFT1d/emin_smearing/test_Urot_01.jl: -------------------------------------------------------------------------------- 1 | using LinearAlgebra 2 | 3 | Haux = rand(5,5) 4 | Haux = 0.5*(Haux + Haux') 5 | 6 | # Eigenvalue decomposition 7 | λ, Urot = eigen(Haux) 8 | 9 | # Check 10 | D = diagm(0 => λ) 11 | # Urot' should be equal to Urot^(-1) or inv(Urot) 12 | display(Urot * D * Urot' - Haux); println() 13 | -------------------------------------------------------------------------------- /codes/structures/H2O.xyz: -------------------------------------------------------------------------------- 1 | 3 2 | Lattice="8.466835369021458 0.0 0.0 0.0 8.466835369021458 0.0 0.0 0.0 8.466835369021458" Properties=species:S:1:pos:R:3 =T pbc="T T T" 3 | O -0.32333500 0.38498000 0.24674000 4 | H 0.64666500 0.38498000 0.24674000 5 | H -0.64666500 -0.38498000 -0.24674000 6 | -------------------------------------------------------------------------------- /octopus_works/H2O/H2O.xyz: -------------------------------------------------------------------------------- 1 | 3 2 | Lattice="8.466835369021458 0.0 0.0 0.0 8.466835369021458 0.0 0.0 0.0 8.466835369021458" Properties=species:S:1:pos:R:3 =T pbc="T T T" 3 | O -0.32333500 0.38498000 0.24674000 4 | H 0.64666500 0.38498000 0.24674000 5 | H -0.64666500 -0.38498000 -0.24674000 6 | -------------------------------------------------------------------------------- /codes/FD1d/init_FD1d_p_grid.jl: -------------------------------------------------------------------------------- 1 | function init_FD1d_p_grid( x_min::Float64, x_max::Float64, N::Int64 ) 2 | L = x_max - x_min 3 | h = L/N 4 | x = zeros(Float64,N) 5 | for i = 1:N 6 | x[i] = x_min + (i-1)*h 7 | end 8 | return x, h 9 | end 10 | 11 | init_FD1d_p_grid( X, N ) = init_FD1d_p_grid( X[1], X[2], N ) -------------------------------------------------------------------------------- /codes/structures/H2O_cell.xyz: -------------------------------------------------------------------------------- 1 | 3 2 | Lattice="8.466835369021458 0.0 0.0 0.0 8.466835369021458 0.0 0.0 0.0 8.466835369021458" Properties=species:S:1:pos:R:3 =T pbc="T T T" 3 | O 3.91008268 4.61839768 4.48015768 4 | H 4.88008268 4.61839768 4.48015768 5 | H 3.58675268 3.84843768 3.98667768 6 | -------------------------------------------------------------------------------- /codes_old/1d/init_FD1d_grid.jl: -------------------------------------------------------------------------------- 1 | function init_FD1d_grid( x_min::Float64, x_max::Float64, N::Int64 ) 2 | L = x_max - x_min 3 | h = L/(N-1) 4 | x = zeros(Float64,N) 5 | for i = 1:N 6 | x[i] = x_min + (i-1)*h 7 | end 8 | return x, h 9 | end 10 | 11 | init_FD1d_grid( X, N ) = init_FD1d_grid( X[1], X[2], N ) -------------------------------------------------------------------------------- /codes/LF1d/init_LF1d_c_grid.jl: -------------------------------------------------------------------------------- 1 | function init_LF1d_c_grid( x_min::Float64, x_max::Float64, N::Int64 ) 2 | L = x_max - x_min 3 | h = L/(N + 1) 4 | x = zeros(Float64,N) 5 | for i = 1:N 6 | x[i] = x_min + i*L/(N+1) 7 | end 8 | return x, h 9 | end 10 | 11 | init_LF1d_c_grid( X, N ) = init_LF1d_c_grid( X[1], X[2], N ) -------------------------------------------------------------------------------- /codes/ks_dft_02/center_mol.py: -------------------------------------------------------------------------------- 1 | #!/home/efefer/miniconda3/bin/python 2 | import sys 3 | import ase.io 4 | from ase.units import Bohr 5 | 6 | assert(len(sys.argv) == 2) 7 | 8 | atoms = ase.io.read(sys.argv[1]) 9 | atoms.set_pbc([True,True,True]) 10 | A = 16.0*Bohr 11 | atoms.set_cell([A,A,A]) 12 | atoms.center(about=0.0) 13 | atoms.write(sys.argv[1]) -------------------------------------------------------------------------------- /codes/ks_dft_02/test_PsPot_GTH.jl: -------------------------------------------------------------------------------- 1 | push!(LOAD_PATH, pwd()) 2 | 3 | using Printf 4 | 5 | using KSDFT02Module 6 | 7 | function main() 8 | psp1 = PsPot_GTH("../pseudopotentials/pade_gth/Ar-q8.gth") 9 | psp2 = PsPot_GTH_octopus("../pseudopotentials/pade_gth/Ar-q8.gth") 10 | 11 | println(psp1) 12 | println(psp2) 13 | end 14 | 15 | main() -------------------------------------------------------------------------------- /codes/sch_2d/INC_sch_2d.jl: -------------------------------------------------------------------------------- 1 | include("../FD2d/FD2dGrid.jl") 2 | include("../FD2d/build_nabla2_matrix.jl") 3 | include("../common/supporting_functions.jl") 4 | include("../common/diag_Emin_PCG.jl") 5 | include("../common/diag_davidson.jl") 6 | include("../common/diag_LOBPCG.jl") 7 | include("../common/ortho_sqrt.jl") 8 | include("../common/ortho_gram_schmidt.jl") -------------------------------------------------------------------------------- /codes/sch_3d/INC_sch_3d.jl: -------------------------------------------------------------------------------- 1 | include("../FD3d/FD3dGrid.jl") 2 | include("../FD3d/build_nabla2_matrix.jl") 3 | include("../common/ILU0Preconditioner.jl") 4 | include("../common/diag_Emin_PCG.jl") 5 | include("../common/diag_davidson.jl") 6 | include("../common/diag_LOBPCG.jl") 7 | include("../common/ortho_sqrt.jl") 8 | include("../common/supporting_functions.jl") -------------------------------------------------------------------------------- /codes/structures/center_mol_default.py: -------------------------------------------------------------------------------- 1 | #!/home/efefer/miniconda3/bin/python 2 | import sys 3 | import ase.io 4 | from ase.units import Bohr 5 | 6 | assert(len(sys.argv) == 2) 7 | 8 | atoms = ase.io.read(sys.argv[1]) 9 | atoms.set_pbc([True,True,True]) 10 | A = 16.0*Bohr 11 | atoms.set_cell([A,A,A]) 12 | atoms.center() 13 | atoms.write(sys.argv[1]) -------------------------------------------------------------------------------- /codes/sch_3d/INC_sch_3d_LF.jl: -------------------------------------------------------------------------------- 1 | include("../LF3d/LF3dGrid.jl") 2 | include("../LF3d/build_nabla2_matrix.jl") 3 | include("../common/ILU0Preconditioner.jl") 4 | include("../common/diag_Emin_PCG.jl") 5 | include("../common/diag_davidson.jl") 6 | include("../common/diag_LOBPCG.jl") 7 | include("../common/ortho_sqrt.jl") 8 | include("../common/supporting_functions.jl") -------------------------------------------------------------------------------- /codes/structures/center_mol_about0.py: -------------------------------------------------------------------------------- 1 | #!/home/efefer/miniconda3/bin/python 2 | import sys 3 | import ase.io 4 | from ase.units import Bohr 5 | 6 | assert(len(sys.argv) == 2) 7 | 8 | atoms = ase.io.read(sys.argv[1]) 9 | atoms.set_pbc([True,True,True]) 10 | A = 16.0*Bohr 11 | atoms.set_cell([A,A,A]) 12 | atoms.center(about=0.0) 13 | atoms.write(sys.argv[1]) -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ca-q10.gth: -------------------------------------------------------------------------------- 1 | Ca GTH-PBE-q10 2 | 4 6 0 0 3 | 0.39000000 2 4 | -4.16707222 -1.58379781 5 | 3 6 | 0.28935572 2 7 | 20.53187635 -7.12978578 8 | 9.20451387 9 | 0.32788206 2 10 | 5.80560513 -0.42875336 11 | 0.50730782 12 | 0.67961713 1 13 | 0.05806826 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Co-q17.gth: -------------------------------------------------------------------------------- 1 | Co GTH-PBE-q17 2 | 4 6 7 0 3 | 0.35500000 2 4 | 4.82819736 0.36814301 5 | 3 6 | 0.27680076 2 7 | -0.58449582 9.28629277 8 | -11.98855242 9 | 0.26815783 2 10 | -6.85195349 5.68013280 11 | -6.72082376 12 | 0.22258414 1 13 | -12.33315019 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Cr-q14.gth: -------------------------------------------------------------------------------- 1 | Cr GTH-PBE-q14 2 | 3 6 5 0 3 | 0.37000000 2 4 | 5.69965764 -0.69548599 5 | 3 6 | 0.31393442 2 7 | 2.86995474 4.97445648 8 | -6.42199570 9 | 0.24086624 2 10 | -4.47620867 7.33141440 11 | -8.67464650 12 | 0.22028633 1 13 | -11.19711641 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Fe-q16.gth: -------------------------------------------------------------------------------- 1 | Fe GTH-PBE-q16 2 | 4 6 6 0 3 | 0.36000000 2 4 | 6.75678916 -0.22883251 5 | 3 6 | 0.27826303 2 7 | 0.62950570 7.91313242 8 | -10.21581002 9 | 0.25138338 2 10 | -7.93213293 7.69707888 11 | -9.10730654 12 | 0.22285578 1 13 | -12.38579937 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Mn-q15.gth: -------------------------------------------------------------------------------- 1 | Mn GTH-PBE-q15 2 | 4 6 5 0 3 | 0.36500000 2 4 | 6.09304649 -0.44646948 5 | 3 6 | 0.29568592 2 7 | 1.88711984 6.35683658 8 | -8.20664074 9 | 0.24561261 2 10 | -6.57002452 7.98335983 11 | -9.44603874 12 | 0.22252279 1 13 | -11.61205092 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Rb-q9.gth: -------------------------------------------------------------------------------- 1 | Rb GTH-PBE-q9 2 | 3 6 0 0 3 | 0.49000000 2 4 | 5.66908644 -0.81162703 5 | 3 6 | 0.28180292 2 7 | 21.39073240 -8.07866676 8 | 10.42951394 9 | 0.28570828 2 10 | 12.25634859 -12.19854075 11 | 14.43350807 12 | 0.54179651 1 13 | 0.34566626 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Sc-q11.gth: -------------------------------------------------------------------------------- 1 | Sc GTH-PBE-q11 2 | 4 6 1 0 3 | 0.38500000 2 4 | 8.21490030 -0.55705910 5 | 3 6 | 0.36361108 2 7 | 2.64653339 3.02108393 8 | -3.90020259 9 | 0.24389778 2 10 | -2.63482265 7.99213715 11 | -9.45642421 12 | 0.25320575 1 13 | -8.16594769 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Sr-q10.gth: -------------------------------------------------------------------------------- 1 | Sr GTH-PBE-q10 2 | 4 6 0 0 3 | 0.48000000 2 4 | 6.81095035 -1.19610979 5 | 3 6 | 0.27588581 2 7 | 21.28971943 -7.89903416 8 | 10.19760926 9 | 0.28174086 2 10 | 11.70905135 -10.96577673 11 | 12.97488200 12 | 0.52108911 1 13 | 0.36053906 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ti-q12.gth: -------------------------------------------------------------------------------- 1 | Ti GTH-PBE-q12 2 | 4 6 2 0 3 | 0.38000000 2 4 | 8.71144218 -0.70028677 5 | 3 6 | 0.33777078 2 7 | 2.57526386 3.69297065 8 | -4.76760461 9 | 0.24253135 2 10 | -4.63054123 8.87087502 11 | -10.49616087 12 | 0.24331694 1 13 | -9.40665268 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/V-q13.gth: -------------------------------------------------------------------------------- 1 | V GTH-PBE-q13 2 | 4 6 3 0 3 | 0.37500000 2 4 | 7.47470354 -0.37026363 5 | 3 6 | 0.32779544 2 7 | 1.94087762 4.72568824 8 | -6.10083728 9 | 0.24476590 2 10 | -5.97816705 9.35863915 11 | -11.07329118 12 | 0.24173879 1 13 | -9.49989110 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Cu-q19.gth: -------------------------------------------------------------------------------- 1 | Cu GTH-PBE-q19 2 | 3 6 10 0 3 | 0.34500000 2 4 | 0.05196970 1.24904337 5 | 3 6 | 0.25002849 2 7 | 0.75019332 10.73582127 8 | -13.85988567 9 | 0.22202454 2 10 | -13.05959885 14.74763830 11 | -17.44964096 12 | 0.21556837 1 13 | -12.45672374 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ni-q18.gth: -------------------------------------------------------------------------------- 1 | Ni GTH-PBE-q18 2 | 4 6 8 0 3 | 0.35000000 2 4 | 2.10216598 0.64848387 5 | 3 6 | 0.26129530 2 7 | 0.62265847 9.97022667 8 | -12.87150729 9 | 0.22425346 2 10 | -11.14270822 12.42956644 11 | -14.70686134 12 | 0.21534825 1 13 | -12.62814550 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Zn-q20.gth: -------------------------------------------------------------------------------- 1 | Zn GTH-PBE-q20 2 | 4 6 10 0 3 | 0.34000000 2 4 | 0.55188462 1.24394356 5 | 3 6 | 0.24394890 2 7 | -1.34762699 12.79313122 8 | -16.51586139 9 | 0.23975357 2 10 | -9.72145777 8.07114357 11 | -9.54990586 12 | 0.20855195 1 13 | -14.19380873 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Rb-q9.gth: -------------------------------------------------------------------------------- 1 | Rb GTH-PADE-q9 GTH-LDA-q9 2 | 3 6 0 0 3 | 0.49000000 2 4 | 4.50415106 -0.74101810 5 | 3 6 | 0.28230077 2 7 | 9.53632920 -3.67415744 8 | 9.48663373 9 | 0.30188614 2 10 | 2.20959243 -2.31371511 11 | 5.47524928 12 | 0.51489528 1 13 | 0.44937574 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Sc-q11.gth: -------------------------------------------------------------------------------- 1 | Sc GTH-PADE-q11 GTH-LDA-q11 2 | 4 6 1 0 3 | 0.38500000 2 4 | 7.42503638 -0.48985155 5 | 3 6 | 0.35970653 2 7 | 6.11958455 0.99282105 8 | -2.56345293 9 | 0.24323416 2 10 | 6.37661838 2.54239924 11 | -6.01641469 12 | 0.25294463 1 13 | -8.02089177 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Sr-q10.gth: -------------------------------------------------------------------------------- 1 | Sr GTH-PADE-q10 GTH-LDA-q10 2 | 4 6 0 0 3 | 0.48000000 2 4 | 5.57145509 -1.07996304 5 | 3 6 | 0.27544056 2 7 | 9.99513531 -3.61608019 8 | 9.33667892 9 | 0.30224313 2 10 | 3.16912572 -1.71111259 11 | 4.04923144 12 | 0.50204544 1 13 | 0.43872821 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ti-q12.gth: -------------------------------------------------------------------------------- 1 | Ti GTH-PADE-q12 GTH-LDA-q12 2 | 4 6 2 0 3 | 0.38000000 2 4 | 7.54878947 -0.58837666 5 | 3 6 | 0.33423466 2 7 | 6.92573970 1.21689330 8 | -3.14200499 9 | 0.24241582 2 10 | 5.07908650 2.65559321 11 | -6.28428053 12 | 0.24294750 1 13 | -9.12589591 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/V-q13.gth: -------------------------------------------------------------------------------- 1 | V GTH-PADE-q13 GTH-LDA-q13 2 | 4 6 3 0 3 | 0.37500000 2 4 | 4.94129058 -0.09644336 5 | 3 6 | 0.32665112 2 7 | 7.65939048 1.50745391 8 | -3.89222925 9 | 0.24640748 2 10 | 4.25623049 2.51062024 11 | -5.94121187 12 | 0.24079150 1 13 | -8.82851757 14 | -------------------------------------------------------------------------------- /codes_old/ks_part1/old_v01/calc_rhoe.jl: -------------------------------------------------------------------------------- 1 | function calc_rhoe( psi::Array{Float64,2} ) 2 | Nbasis = size(psi,1) 3 | Nstates = size(psi,2) 4 | 5 | Rhoe = zeros(Float64,Nbasis) 6 | 7 | for ist in 1:Nstates 8 | for ip in 1:Nbasis 9 | Rhoe[ip] = Rhoe[ip] + 2.0*psi[ip,ist]*psi[ip,ist] 10 | end 11 | end 12 | return Rhoe 13 | end -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ca-q10.gth: -------------------------------------------------------------------------------- 1 | Ca GTH-PADE-q10 GTH-LDA-q10 2 | 4 6 0 0 3 | 0.39000000 2 4 | -4.92814602 -1.23285409 5 | 3 6 | 0.28190948 2 7 | 12.35233956 -2.96571964 8 | 7.65745518 9 | 0.31034528 2 10 | 5.72242348 -0.39028860 11 | 0.92359141 12 | 0.90433011 1 13 | 0.01680633 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Co-q17.gth: -------------------------------------------------------------------------------- 1 | Co GTH-PADE-q17 GTH-LDA-q17 2 | 4 6 7 0 3 | 0.35500000 2 4 | 3.41839094 0.48207820 5 | 3 6 | 0.25914047 2 7 | 11.19522589 3.03867482 8 | -7.84582466 9 | 0.25142451 2 10 | -0.55146375 1.96043558 11 | -4.63923731 12 | 0.22166454 1 13 | -12.07535366 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Cr-q14.gth: -------------------------------------------------------------------------------- 1 | Cr GTH-PADE-q14 GTH-LDA-q14 2 | 3 6 5 0 3 | 0.37000000 2 4 | 5.11336166 -0.64681932 5 | 3 6 | 0.30601140 2 7 | 8.61783515 1.60252229 8 | -4.13769475 9 | 0.24108964 2 10 | 3.16158758 2.12679104 11 | -5.03290619 12 | 0.21957702 1 13 | -11.15786828 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Fe-q16.gth: -------------------------------------------------------------------------------- 1 | Fe GTH-PADE-q16 GTH-LDA-q16 2 | 4 6 6 0 3 | 0.36000000 2 4 | 5.39250667 -0.03006638 5 | 3 6 | 0.26926810 2 7 | 10.19372276 2.64717717 8 | -6.83498206 9 | 0.24768563 2 10 | 0.14561261 2.21217195 11 | -5.23495429 12 | 0.22302105 1 13 | -12.02694100 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Mn-q15.gth: -------------------------------------------------------------------------------- 1 | Mn GTH-PADE-q15 GTH-LDA-q15 2 | 4 6 5 0 3 | 0.36500000 2 4 | 6.74868332 -0.57656900 5 | 3 6 | 0.28075266 2 7 | 9.37953150 2.15929667 8 | -5.57528002 9 | 0.25453567 2 10 | 0.37117568 1.78710271 11 | -4.22905690 12 | 0.22142210 1 13 | -12.11538453 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ni-q18.gth: -------------------------------------------------------------------------------- 1 | Ni GTH-PADE-q18 GTH-LDA-q18 2 | 4 6 8 0 3 | 0.35000000 2 4 | 3.61031072 0.44963832 5 | 3 6 | 0.24510489 2 7 | 12.16113071 3.51625420 8 | -9.07892931 9 | 0.23474136 2 10 | -0.82062357 2.54774737 11 | -6.02907069 12 | 0.21494950 1 13 | -13.39506212 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Zn-q20.gth: -------------------------------------------------------------------------------- 1 | Zn GTH-PADE-q20 GTH-LDA-q20 2 | 4 6 10 0 3 | 0.34000000 2 4 | -0.62164886 1.27422289 5 | 3 6 | 0.23892824 2 7 | 0.30844368 12.35877752 8 | -15.95511318 9 | 0.23960139 2 10 | -9.43744220 8.39596370 11 | -9.93423822 12 | 0.20656246 1 13 | -14.03217427 14 | -------------------------------------------------------------------------------- /codes_old/ks_part1/hartree_scf/calc_rhoe.jl: -------------------------------------------------------------------------------- 1 | function calc_rhoe( psi::Array{Float64,2} ) 2 | Nbasis = size(psi,1) 3 | Nstates = size(psi,2) 4 | 5 | Rhoe = zeros(Float64,Nbasis) 6 | 7 | for ist in 1:Nstates 8 | for ip in 1:Nbasis 9 | Rhoe[ip] = Rhoe[ip] + 2.0*psi[ip,ist]*psi[ip,ist] 10 | end 11 | end 12 | return Rhoe 13 | end -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Cu-q19.gth: -------------------------------------------------------------------------------- 1 | Cu GTH-PADE-q19 GTH-LDA-q19 2 | 3 6 10 0 3 | 0.34500000 2 4 | 0.38158866 1.38680111 5 | 3 6 | 0.25131927 2 7 | 0.03400360 11.19862293 8 | -14.45736004 9 | 0.22038147 2 10 | -14.27160096 16.04403507 11 | -18.98355830 12 | 0.21773897 1 13 | -12.50830997 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/As-q5.gth: -------------------------------------------------------------------------------- 1 | As GTH-PBE-q5 2 | 2 3 0 0 3 | 0.52000000 0 4 | 5 | 3 6 | 0.45554957 3 7 | 5.52067327 0.03512220 -1.06108239 8 | -1.77119320 2.73970295 9 | -2.17457180 10 | 0.55460557 2 11 | 1.02179156 0.62920826 12 | -0.74448925 13 | 0.70368872 1 14 | 0.31479504 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Br-q7.gth: -------------------------------------------------------------------------------- 1 | Br GTH-PBE-q7 2 | 2 5 0 0 3 | 0.50000000 0 4 | 5 | 3 6 | 0.43803892 3 7 | 6.07855632 0.33049817 -1.23838226 8 | -2.44090020 3.19748924 9 | -2.53792841 10 | 0.45313561 2 11 | 2.45930381 0.52275313 12 | -0.61852985 13 | 0.56771383 1 14 | 0.55926645 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ga-q3.gth: -------------------------------------------------------------------------------- 1 | Ga GTH-PBE-q3 2 | 2 1 0 0 3 | 0.56000000 0 4 | 5 | 3 6 | 0.56586645 3 7 | 2.21575051 1.03244793 -0.76062946 8 | -2.57004845 1.96393682 9 | -1.55882652 10 | 0.64671613 2 11 | 0.31122394 0.61341605 12 | -0.72580366 13 | 0.99942484 1 14 | 0.08951951 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ge-q4.gth: -------------------------------------------------------------------------------- 1 | Ge GTH-PBE-q4 2 | 2 2 0 0 3 | 0.54000000 0 4 | 5 | 3 6 | 0.42186518 3 7 | 7.51024121 -0.58810836 -1.44797580 8 | -1.59588819 3.73865744 9 | -2.96746735 10 | 0.56752887 2 11 | 0.91385969 0.54687534 12 | -0.64707163 13 | 0.81391394 1 14 | 0.19717731 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Kr-q8.gth: -------------------------------------------------------------------------------- 1 | Kr GTH-PBE-q8 2 | 2 6 0 0 3 | 0.50000000 0 4 | 5 | 3 6 | 0.42165717 3 7 | 6.46530358 0.53866049 -1.50260118 8 | -3.13938870 3.87969957 9 | -3.07941607 10 | 0.43374437 2 11 | 2.60116535 0.70510978 12 | -0.83429715 13 | 0.52469073 1 14 | 0.63559472 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Se-q6.gth: -------------------------------------------------------------------------------- 1 | Se GTH-PBE-q6 2 | 2 4 0 0 3 | 0.51000000 0 4 | 5 | 3 6 | 0.43246005 3 7 | 6.51810990 -0.22271639 -1.19612899 8 | -1.65797833 3.08839178 9 | -2.45133498 10 | 0.47049162 2 11 | 2.28126223 0.36533529 12 | -0.43227055 13 | 0.62560034 1 14 | 0.43979948 15 | -------------------------------------------------------------------------------- /codes_old/1d_per/init_FD1d_grid_per.jl: -------------------------------------------------------------------------------- 1 | function init_FD1d_grid_per( x_min::Float64, x_max::Float64, N::Int64 ) 2 | L = x_max - x_min 3 | h = L/N 4 | x = zeros(Float64,N) 5 | for i = 1:N 6 | x[i] = x_min + (i-1)*h 7 | end 8 | return x, h 9 | end 10 | 11 | init_FD1d_grid_per( X::Tuple{Float64,Float64}, N::Int64) = init_FD1d_grid_per( X[1], X[2], N ) -------------------------------------------------------------------------------- /codes/common/constants.jl: -------------------------------------------------------------------------------- 1 | # constants 2 | # 3 | # CODATA: https://physics.nist.gov/cgi-bin/cuu/Value?rydhcev 4 | const Ry2eV = 13.605693009 # Ry to eV 5 | const Ha2eV = 2*Ry2eV 6 | const eV2Ha = 1/Ha2eV 7 | 8 | # 9 | # CODATA: https://physics.nist.gov/cgi-bin/cuu/Value?bohrrada0 10 | # 1/bohr 11 | const ANG2BOHR = 1.8897261254578281 # angstrom to bohr 12 | const BOHR2ANG = 1/ANG2BOHR -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Cu-q11.gth: -------------------------------------------------------------------------------- 1 | Cu GTH-PBE-q11 2 | 1 0 10 0 3 | 0.53000000 0 4 | 5 | 3 6 | 0.43135505 3 7 | 9.69380507 -6.47016535 1.93595215 8 | 11.50177396 -4.99860696 9 | 3.96752127 10 | 0.56139155 2 11 | 2.54547330 -0.78463573 12 | 0.92839352 13 | 0.26455485 1 14 | -12.82861406 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ga-q13.gth: -------------------------------------------------------------------------------- 1 | Ga GTH-PBE-q13 2 | 2 1 10 0 3 | 0.49000000 0 4 | 5 | 3 6 | 0.41677723 3 7 | 10.47568975 -4.92176814 0.87070559 8 | 7.77017809 -2.24815216 9 | 1.78441545 10 | 0.56962652 2 11 | 1.77798534 0.19585976 12 | -0.23174439 13 | 0.23812650 1 14 | -16.24868022 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/W-q6.gth: -------------------------------------------------------------------------------- 1 | W GTH-PBE-q6 2 | 2 0 4 0 3 | 0.71900000 1 4 | 10.69989013 5 | 3 6 | 0.46755372 2 7 | 5.80350289 -2.07063257 8 | 2.67317516 9 | 0.72666463 2 10 | 1.78871915 -2.55415819 11 | 3.02212073 12 | 0.49929065 2 13 | -10.59832562 6.44789319 14 | -7.31122365 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Zn-q12.gth: -------------------------------------------------------------------------------- 1 | Zn GTH-PBE-q12 2 | 2 0 10 0 3 | 0.51000000 0 4 | 5 | 3 6 | 0.40031644 3 7 | 11.53004133 -8.79189815 3.14508644 8 | 16.46577518 -8.12057827 9 | 6.44550918 10 | 0.54318233 2 11 | 2.59719512 -0.59426275 12 | 0.70314117 13 | 0.25095885 1 14 | -14.46695795 15 | -------------------------------------------------------------------------------- /codes/FD1d/build_D1_matrix_p_3pt.jl: -------------------------------------------------------------------------------- 1 | """ 2 | f_x = (-1*f[i-1] + 0*f[i+0] + 1*f[i+1])/(2*h**1) 3 | """ 4 | function build_D1_matrix_p_3pt( N::Int64, h::Float64 ) 5 | mat = zeros(Float64,N,N) 6 | for i = 1:N-1 7 | mat[i,i+1] = 1.0 8 | mat[i+1,i] = -1.0 9 | end 10 | 11 | mat[1,N] = -1.0 12 | mat[N,1] = 1.0 13 | 14 | return mat/(2*h) 15 | 16 | end -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/As-q5.gth: -------------------------------------------------------------------------------- 1 | As GTH-PADE-q5 GTH-LDA-q5 2 | 2 3 0 0 3 | 0.52000000 0 4 | 5 | 3 6 | 0.45640025 3 7 | 4.56076106 -0.65545935 -0.33517391 8 | 1.69238876 0.86541531 9 | -1.37380421 10 | 0.55056168 2 11 | 1.81224664 0.27329186 12 | -0.64672658 13 | 0.68528272 1 14 | 0.31237276 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Br-q7.gth: -------------------------------------------------------------------------------- 1 | Br GTH-PADE-q7 GTH-LDA-q7 2 | 2 5 0 0 3 | 0.50000000 0 4 | 5 | 3 6 | 0.42820734 3 7 | 5.39883713 -0.70499608 -0.32301656 8 | 1.82029205 0.83402517 9 | -1.32397392 10 | 0.45532308 2 11 | 3.10882269 0.26715405 12 | -0.63220188 13 | 0.55784727 1 14 | 0.55590294 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ca-q2.gth: -------------------------------------------------------------------------------- 1 | Ca GTH-PADE-q2 GTH-LDA-q2 2 | 2 0 0 0 3 | 0.80000000 0 4 | 5 | 3 6 | 0.66973721 3 7 | 1.64501442 -0.59004546 0.07221571 8 | 1.52349082 -0.18646017 9 | 0.29599634 10 | 0.94647402 2 11 | 0.58547893 -0.05338365 12 | 0.12632878 13 | 0.52654998 1 14 | -3.03232095 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Cr-q6.gth: -------------------------------------------------------------------------------- 1 | Cr GTH-PADE-q6 GTH-LDA-q6 2 | 1 0 5 0 3 | 0.66000000 0 4 | 5 | 3 6 | 0.49857767 3 7 | 2.40075556 -0.80261251 0.72025801 8 | 2.07233658 -1.85969818 9 | 2.95217934 10 | 0.71976824 2 11 | 1.14555658 -0.11757619 12 | 0.27823604 13 | 0.35434060 1 14 | -6.61587832 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Fe-q8.gth: -------------------------------------------------------------------------------- 1 | Fe GTH-PADE-q8 GTH-LDA-q8 2 | 2 0 6 0 3 | 0.61000000 0 4 | 5 | 3 6 | 0.45448200 3 7 | 3.01664046 -1.00040646 0.79478164 8 | 2.58303836 -2.05211737 9 | 3.25763534 10 | 0.63890282 2 11 | 1.49964199 -0.13812935 12 | 0.32687369 13 | 0.30873177 1 14 | -9.14535371 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ga-q3.gth: -------------------------------------------------------------------------------- 1 | Ga GTH-PADE-q3 GTH-LDA-q3 2 | 2 1 0 0 3 | 0.56000000 0 4 | 5 | 3 6 | 0.61079074 3 7 | 2.36932516 0.09644314 -0.13462450 8 | -0.24901512 0.34759896 9 | -0.55179624 10 | 0.70459583 2 11 | 0.74630529 0.21683799 12 | -0.51313234 13 | 0.98257967 1 14 | 0.07543656 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ge-q4.gth: -------------------------------------------------------------------------------- 1 | Ge GTH-PADE-q4 GTH-LDA-q4 2 | 2 2 0 0 3 | 0.54000000 0 4 | 5 | 3 6 | 0.49374254 3 7 | 3.82689099 -0.42611775 -0.32795553 8 | 1.10023129 0.84677753 9 | -1.34421765 10 | 0.60106438 2 11 | 1.36251781 0.26511216 12 | -0.62736987 13 | 0.78836851 1 14 | 0.19120485 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/K-q1.gth: -------------------------------------------------------------------------------- 1 | K GTH-PADE-q1 GTH-LDA-q1 2 | 1 0 0 0 3 | 0.95000000 0 4 | 5 | 3 6 | 0.95536395 3 7 | 0.91461200 -0.11136800 -0.07324712 8 | 0.28755094 0.18912326 9 | -0.30022386 10 | 1.08641063 2 11 | 0.31546177 -0.02881726 12 | 0.06819410 13 | 0.72060608 1 14 | -1.52951361 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Kr-q8.gth: -------------------------------------------------------------------------------- 1 | Kr GTH-PADE-q8 GTH-LDA-q8 2 | 2 6 0 0 3 | 0.50000000 0 4 | 5 | 3 6 | 0.41075893 3 7 | 5.91119429 -0.76196004 -0.35573234 8 | 1.96737236 0.91849694 9 | -1.45806869 10 | 0.43025641 2 11 | 3.52435692 0.29208431 12 | -0.69119763 13 | 0.51712005 1 14 | 0.62922850 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Mn-q7.gth: -------------------------------------------------------------------------------- 1 | Mn GTH-PADE-q7 GTH-LDA-q7 2 | 2 0 5 0 3 | 0.64000000 0 4 | 5 | 3 6 | 0.48124608 3 7 | 2.79903057 -0.96286281 0.62594958 8 | 2.48610107 -1.61619487 9 | 2.56562982 10 | 0.66930432 2 11 | 1.36877564 -0.13385695 12 | 0.31676337 13 | 0.32776314 1 14 | -7.99541784 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Sc-q3.gth: -------------------------------------------------------------------------------- 1 | Sc GTH-PADE-q3 GTH-LDA-q3 2 | 2 0 1 0 3 | 0.75000000 0 4 | 5 | 3 6 | 0.59707941 3 7 | 1.83576833 -0.67169514 0.34607449 8 | 1.73430939 -0.89356049 9 | 1.41848330 10 | 0.84799438 2 11 | 0.78412669 -0.10426371 12 | 0.24673297 13 | 0.45465318 1 14 | -3.85924078 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Se-q6.gth: -------------------------------------------------------------------------------- 1 | Se GTH-PADE-q6 GTH-LDA-q6 2 | 2 4 0 0 3 | 0.51000000 0 4 | 5 | 3 6 | 0.43253108 3 7 | 5.14513084 -0.79473967 -0.33405137 8 | 2.05200900 0.86251693 9 | -1.36920317 10 | 0.47247252 2 11 | 2.85880607 0.24960384 12 | -0.59067050 13 | 0.61342013 1 14 | 0.43482888 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ti-q4.gth: -------------------------------------------------------------------------------- 1 | Ti GTH-PADE-q4 GTH-LDA-q4 2 | 2 0 2 0 3 | 0.72000000 0 4 | 5 | 3 6 | 0.52841076 3 7 | 1.86661330 -0.55779994 0.89250253 8 | 1.44023325 -2.30443161 9 | 3.65817177 10 | 0.79114554 2 11 | 0.96791577 -0.11016023 12 | 0.26068669 13 | 0.40871178 1 14 | -4.82645635 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/V-q5.gth: -------------------------------------------------------------------------------- 1 | V GTH-PADE-q5 GTH-LDA-q5 2 | 2 0 3 0 3 | 0.69000000 0 4 | 5 | 3 6 | 0.51470421 3 7 | 2.20866978 -0.73461318 0.75055919 8 | 1.89676307 -1.93793550 9 | 3.07637723 10 | 0.74350381 2 11 | 1.11575121 -0.12113126 12 | 0.28664887 13 | 0.37488959 1 14 | -5.84163317 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Zn-q2.gth: -------------------------------------------------------------------------------- 1 | Zn GTH-PADE-q2 GTH-LDA-q2 2 | 2 0 0 0 3 | 0.57000000 0 4 | 5 | 3 6 | 0.64071219 3 7 | 2.08855724 0.08453570 -0.22965773 8 | -0.21827024 0.59297371 9 | -0.94131659 10 | 0.96760483 2 11 | 0.16354600 0.09596150 12 | -0.22708635 13 | 1.33035200 1 14 | 0.01048578 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/At-q7.gth: -------------------------------------------------------------------------------- 1 | At GTH-PBE-q7 2 | 2 5 0 0 3 | 0.58000000 1 4 | 14.21716853 5 | 3 6 | 0.66580683 3 7 | -0.37891203 0.66112626 0.27884944 8 | -0.39996168 -0.71998616 9 | 0.57147130 10 | 0.65241195 2 11 | 0.26704745 0.32622823 12 | -0.38599845 13 | 0.85406059 1 14 | 0.45259467 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Au-q11.gth: -------------------------------------------------------------------------------- 1 | Au GTH-PBE-q11 2 | 1 0 10 0 3 | 0.59000000 1 4 | 10.51717881 5 | 3 6 | 0.54384733 2 7 | 5.78681103 -2.25067966 8 | 2.90561495 9 | 0.60917298 2 10 | 4.28404873 -4.07128520 11 | 4.81720962 12 | 0.43730922 2 13 | -7.40328124 3.01019307 14 | -3.41323811 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Bi-q15.gth: -------------------------------------------------------------------------------- 1 | Bi GTH-PBE-q15 2 | 2 3 10 0 3 | 0.51000000 1 4 | 13.39622231 5 | 3 6 | 0.48120446 2 7 | 9.54548100 -3.94511418 8 | 5.09312050 9 | 0.54894636 2 10 | 5.63359371 -3.17713769 11 | 3.75924002 12 | 0.39730251 2 13 | -6.03753705 0.92523553 14 | -1.04911848 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Bi-q5.gth: -------------------------------------------------------------------------------- 1 | Bi GTH-PBE-q5 2 | 2 3 0 0 3 | 0.60500000 1 4 | 7.94575692 5 | 3 6 | 0.58223216 3 7 | 0.64373527 2.24761617 -1.44060063 8 | -5.24479711 3.71961484 9 | -2.95235275 10 | 0.76639400 2 11 | 0.21253292 0.37983417 12 | -0.44942585 13 | 0.96565479 1 14 | 0.34729822 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Hg-q12.gth: -------------------------------------------------------------------------------- 1 | Hg GTH-PBE-q12 2 | 2 0 10 0 3 | 0.57000000 1 4 | 8.46784734 5 | 3 6 | 0.52978669 2 7 | 7.37124306 -2.96994403 8 | 3.83418126 9 | 0.63516596 2 10 | 3.55116141 -1.72290935 11 | 2.03857383 12 | 0.40798543 2 13 | -8.61398015 5.00756120 14 | -5.67804069 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/I-q7.gth: -------------------------------------------------------------------------------- 1 | I GTH-PBE-q7 2 | 2 5 0 0 3 | 0.56000000 1 4 | 8.20710157 5 | 3 6 | 0.53192813 3 7 | 2.30814581 1.00390933 -0.95915606 8 | -2.85610882 2.47653030 9 | -1.96568498 10 | 0.58918244 2 11 | 0.90648219 0.42507060 12 | -0.50295032 13 | 0.73972147 1 14 | 0.47919458 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/In-q3.gth: -------------------------------------------------------------------------------- 1 | In GTH-PBE-q3 2 | 2 1 0 0 3 | 0.61000000 1 4 | 5.08622849 5 | 3 6 | 0.68888318 3 7 | 0.56228376 0.99900413 -0.48093816 8 | -2.07195476 1.24177699 9 | -0.98562993 10 | 0.76370974 2 11 | 0.10892299 0.42327835 12 | -0.50082970 13 | 1.14391192 1 14 | 0.11683948 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ir-q9.gth: -------------------------------------------------------------------------------- 1 | Ir GTH-PBE-q9 2 | 2 0 7 0 3 | 0.64100000 1 4 | 14.58181397 5 | 3 6 | 0.51010474 2 7 | 3.71524999 -1.26263745 8 | 1.63005794 9 | 0.68489160 2 10 | 1.91910152 -1.89619458 11 | 2.24360769 12 | 0.47173508 2 13 | -8.85603130 3.17025312 14 | -3.59472915 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Os-q8.gth: -------------------------------------------------------------------------------- 1 | Os GTH-PBE-q8 2 | 2 0 6 0 3 | 0.66700000 1 4 | 13.07904899 5 | 3 6 | 0.49576015 2 7 | 4.35033878 -1.49680274 8 | 1.93236403 9 | 0.70116140 2 10 | 1.81669550 -1.99815917 11 | 2.36425382 12 | 0.47117333 2 13 | -10.99598697 5.97918090 14 | -6.77975387 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Pb-q14.gth: -------------------------------------------------------------------------------- 1 | Pb GTH-PBE-q14 2 | 2 2 10 0 3 | 0.53000000 1 4 | 12.57214281 5 | 3 6 | 0.49554891 2 7 | 8.42980665 -3.44005610 8 | 4.44109332 9 | 0.56934785 2 10 | 4.98150638 -2.89639920 11 | 3.42706575 12 | 0.40422413 2 13 | -6.81491262 1.83782673 14 | -2.08389964 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Pb-q4.gth: -------------------------------------------------------------------------------- 1 | Pb GTH-PBE-q4 2 | 2 2 0 0 3 | 0.61750000 1 4 | 4.67238428 5 | 3 6 | 0.62235881 3 7 | 0.87991768 2.08114784 -1.43125710 8 | -5.01469016 3.69548994 9 | -2.93320421 10 | 0.81200202 2 11 | 0.15345679 0.47889785 12 | -0.56663958 13 | 1.02501525 1 14 | 0.30170206 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Pd-q10.gth: -------------------------------------------------------------------------------- 1 | Pd GTH-PBE-q10 2 | 0 0 10 0 3 | 0.59600000 1 4 | 5.29987401 5 | 3 6 | 0.59194990 2 7 | 5.30819456 -2.06237933 8 | 2.66252027 9 | 0.66628526 2 10 | 2.73458446 -1.46697005 11 | 1.73574237 12 | 0.43851839 2 13 | -3.71978832 -0.80738825 14 | 0.91549223 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Po-q6.gth: -------------------------------------------------------------------------------- 1 | Po GTH-PBE-q6 2 | 2 4 0 0 3 | 0.59250000 1 4 | 8.13432566 5 | 3 6 | 0.80422357 3 7 | 0.32633408 0.10539986 0.52809414 8 | 0.72287456 -1.36353322 9 | 1.08227094 10 | 0.81703652 2 11 | 0.15801481 0.37530247 12 | -0.44406387 13 | 0.89014943 1 14 | 0.46253238 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Pt-q10.gth: -------------------------------------------------------------------------------- 1 | Pt GTH-PBE-q10 2 | 1 0 9 0 3 | 0.61600000 1 4 | 11.31363525 5 | 3 6 | 0.55090426 2 7 | 4.73349110 -1.78459401 8 | 2.30390096 9 | 0.67413781 2 10 | 2.53479850 -1.77806555 11 | 2.10383553 12 | 0.45739243 2 13 | -7.26401101 2.55866480 14 | -2.90125318 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Re-q7.gth: -------------------------------------------------------------------------------- 1 | Re GTH-PBE-q7 2 | 2 0 5 0 3 | 0.69300000 1 4 | 11.96194160 5 | 3 6 | 0.46331539 2 7 | 6.08700876 -2.19137969 8 | 2.82905901 9 | 0.70964824 2 10 | 1.81506156 -2.35412193 11 | 2.78543463 12 | 0.47606454 2 13 | -12.39371002 8.00629664 14 | -9.07828707 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Rh-q9.gth: -------------------------------------------------------------------------------- 1 | Rh GTH-PBE-q9 2 | 1 0 8 0 3 | 0.61900948 1 4 | 4.70454397 5 | 3 6 | 0.61332681 2 7 | 4.99320515 -1.92978191 8 | 2.49133773 9 | 0.69365000 2 10 | 2.53237506 -1.28086042 11 | 1.51553449 12 | 0.37003772 2 13 | -16.88260377 14.71821684 14 | -16.68888922 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Rn-q8.gth: -------------------------------------------------------------------------------- 1 | Rn GTH-PBE-q8 2 | 2 6 0 0 3 | 0.57000000 1 4 | 16.20061781 5 | 3 6 | 0.63480802 3 7 | -0.58199405 0.80312797 0.29738605 8 | -0.55313531 -0.76784748 9 | 0.60946004 10 | 0.64710877 2 11 | 0.16927880 0.30517348 12 | -0.36108613 13 | 0.80634271 1 14 | 0.51103874 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ru-q8.gth: -------------------------------------------------------------------------------- 1 | Ru GTH-PBE-q8 2 | 1 0 7 0 3 | 0.61211332 1 4 | 5.04489332 5 | 3 6 | 0.64215040 2 7 | 4.62556355 -1.80334903 8 | 2.32811359 9 | 0.67936654 2 10 | 3.23395238 -2.42101064 11 | 2.86457842 12 | 0.38059720 2 13 | -15.53165455 13.58045054 14 | -15.39878349 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Sb-q5.gth: -------------------------------------------------------------------------------- 1 | Sb GTH-PBE-q5 2 | 2 3 0 0 3 | 0.59000000 1 4 | 7.92852084 5 | 3 6 | 0.55613636 3 7 | 1.43047790 1.26142599 -0.92323353 8 | -3.13013340 2.38377872 9 | -1.89206570 10 | 0.62275507 2 11 | 0.56147233 0.30484522 12 | -0.36069773 13 | 0.88948576 1 14 | 0.27086864 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Sn-q4.gth: -------------------------------------------------------------------------------- 1 | Sn GTH-PBE-q4 2 | 2 2 0 0 3 | 0.60500000 1 4 | 6.26678230 5 | 3 6 | 0.56643732 3 7 | 1.57118124 1.47004118 -1.17857669 8 | -3.81477013 3.04307193 9 | -2.41536347 10 | 0.64184959 2 11 | 0.52689769 0.40325781 12 | -0.47714107 13 | 0.99087302 1 14 | 0.19876639 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ta-q5.gth: -------------------------------------------------------------------------------- 1 | Ta GTH-PBE-q5 2 | 2 0 3 0 3 | 0.74400000 1 4 | 9.83934257 5 | 3 6 | 0.45239666 2 7 | 6.12338066 -2.16890335 8 | 2.80004218 9 | 0.75164390 2 10 | 1.64970103 -2.51481038 11 | 2.97556377 12 | 0.50114181 2 13 | -12.42334477 9.01473381 14 | -10.22174735 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Te-q6.gth: -------------------------------------------------------------------------------- 1 | Te GTH-PBE-q6 2 | 2 4 0 0 3 | 0.57500000 1 4 | 8.71364868 5 | 3 6 | 0.57492240 3 7 | 1.40181273 0.97877992 -0.48630602 8 | -2.05457624 1.25563675 9 | -0.99663078 10 | 0.58989076 2 11 | 0.76478865 0.32398623 12 | -0.38334568 13 | 0.81338925 1 14 | 0.34485820 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Tl-q13.gth: -------------------------------------------------------------------------------- 1 | Tl GTH-PBE-q13 2 | 2 1 10 0 3 | 0.55000000 1 4 | 12.29058515 5 | 3 6 | 0.51280306 2 7 | 7.19017017 -2.86301073 8 | 3.69613096 9 | 0.57711505 2 10 | 4.76094580 -3.67332496 11 | 4.34633671 12 | 0.39323001 2 13 | -11.01268700 6.42159202 14 | -7.28140093 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Tl-q3.gth: -------------------------------------------------------------------------------- 1 | Tl GTH-PBE-q3 2 | 2 1 0 0 3 | 0.63000000 1 4 | 1.45272083 5 | 3 6 | 0.78076788 3 7 | 0.37973043 1.20912802 -0.45856792 8 | -2.30683834 1.18401727 9 | -0.93978457 10 | 0.89705009 2 11 | -0.02423596 0.58235582 12 | -0.68905269 13 | 1.09379194 1 14 | 0.22764152 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Xe-q8.gth: -------------------------------------------------------------------------------- 1 | Xe GTH-PBE-q8 2 | 2 6 0 0 3 | 0.56000000 1 4 | 8.03636262 5 | 3 6 | 0.53049420 3 7 | 2.23202148 1.20035836 -0.99849824 8 | -3.17371348 2.57811136 9 | -2.04631245 10 | 0.58177483 2 11 | 0.79698181 0.59123264 12 | -0.69955590 13 | 0.68554509 1 14 | 0.56018900 15 | -------------------------------------------------------------------------------- /codes/structures/NH3.xyz: -------------------------------------------------------------------------------- 1 | 4 2 | Lattice="8.466835369021458 0.0 0.0 0.0 8.466835369021458 0.0 0.0 0.0 8.466835369021458" Properties=species:S:1:pos:R:3 =T pbc="T T T" 3 | N -0.14195000 0.09025000 -0.34020000 4 | H -0.58365000 0.38085000 0.53090000 5 | H 0.58365000 0.77985000 -0.53090000 6 | H 0.34555000 -0.77985000 -0.13130000 7 | -------------------------------------------------------------------------------- /octopus_works/NH3/NH3.xyz: -------------------------------------------------------------------------------- 1 | 4 2 | Lattice="8.466835369021458 0.0 0.0 0.0 8.466835369021458 0.0 0.0 0.0 8.466835369021458" Properties=species:S:1:pos:R:3 =T pbc="T T T" 3 | N -0.14195000 0.09025000 -0.34020000 4 | H -0.58365000 0.38085000 0.53090000 5 | H 0.58365000 0.77985000 -0.53090000 6 | H 0.34555000 -0.77985000 -0.13130000 7 | -------------------------------------------------------------------------------- /codes/LF1d/init_LF1d_p_grid.jl: -------------------------------------------------------------------------------- 1 | function init_LF1d_p_grid( x_min::Float64, x_max::Float64, N::Int64 ) 2 | 3 | @assert !iseven(N) 4 | 5 | L = x_max - x_min 6 | x = zeros(Float64,N) 7 | for i in 1:N 8 | x[i] = x_min + 0.5*L*(2*i-1)/N 9 | end 10 | h = x[2] - x[1] 11 | return x, h 12 | end 13 | 14 | init_LF1d_p_grid( X, N ) = init_LF1d_p_grid( X[1], X[2], N ) -------------------------------------------------------------------------------- /codes/modelscf1d/reference_impl/op_Vtot.jl: -------------------------------------------------------------------------------- 1 | function op_Vtot(H::Hamiltonian, x::Array{Float64,1}) 2 | # application of the potential part of the Hamiltonian to a vector 3 | return (H.Vtot).*x 4 | end 5 | 6 | function op_Vtot(H::Hamiltonian, X::Array{Float64,2}) 7 | # application of the potential part of the Hamiltonian to a matric 8 | return broadcast(*,H.Vtot, X) 9 | end 10 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ba-q2.gth: -------------------------------------------------------------------------------- 1 | Ba GTH-PADE-q2 GTH-LDA-q2 2 | 2 0 0 0 3 | 1.20000000 0 4 | 5 | 3 6 | 1.01618684 3 7 | 0.92259259 -0.29570030 -0.08135711 8 | 0.76349489 0.21006316 9 | -0.33346493 10 | 1.24987991 2 11 | 0.44716820 -0.06384326 12 | 0.15108073 13 | 0.93715823 1 14 | -0.71893382 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Co-q9.gth: -------------------------------------------------------------------------------- 1 | Co GTH-PADE-q9 GTH-LDA-q9 2 | 2 0 7 0 3 | 0.58000000 0 4 | 5 | 3 6 | 0.44045735 3 7 | 3.33497825 -1.11276628 0.75413362 8 | 2.87315017 -1.94716465 9 | 3.09102805 10 | 0.61004847 2 11 | 1.63400481 -0.15047260 12 | 0.35608316 13 | 0.29166058 1 14 | -10.35880017 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Cs-q1.gth: -------------------------------------------------------------------------------- 1 | Cs GTH-PADE-q1 GTH-LDA-q1 2 | 1 0 0 0 3 | 1.20000000 0 4 | 5 | 3 6 | 1.22473727 3 7 | 0.61152657 -0.09288578 -0.07173455 8 | 0.23983005 0.18521782 9 | -0.29402418 10 | 1.28047759 2 11 | 0.24489277 -0.09604275 12 | 0.22727863 13 | 1.10752212 1 14 | -0.54216260 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Cu-q1.gth: -------------------------------------------------------------------------------- 1 | Cu GTH-PADE-q1 GTH-LDA-q1 2 | 1 0 0 0 3 | 0.58000000 0 4 | 5 | 3 6 | 0.84328288 3 7 | 0.97578662 0.31838619 -0.03250652 8 | -0.82206962 0.08393147 9 | -0.13323707 10 | 1.08954266 2 11 | 0.02457986 0.10522210 12 | -0.24900093 13 | 1.29160225 1 14 | -0.06529209 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Cu-q11.gth: -------------------------------------------------------------------------------- 1 | Cu GTH-PADE-q11 GTH-LDA-q11 2 | 1 0 10 0 3 | 0.53000000 0 4 | 5 | 3 6 | 0.42373431 3 7 | 3.88805001 -1.26901549 0.55872509 8 | 3.27658391 -1.44262198 9 | 2.29009139 10 | 0.57217697 2 11 | 1.75127242 -0.15844220 12 | 0.37494269 13 | 0.26614275 1 14 | -12.67695749 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ni-q10.gth: -------------------------------------------------------------------------------- 1 | Ni GTH-PADE-q10 GTH-LDA-q10 2 | 2 0 8 0 3 | 0.56000000 0 4 | 5 | 3 6 | 0.42539870 3 7 | 3.61965071 -1.19635099 0.74622158 8 | 3.08896496 -1.92673583 9 | 3.05859831 10 | 0.58408076 2 11 | 1.74222007 -0.16325873 12 | 0.38634067 13 | 0.27811348 1 14 | -11.60842823 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Zn-q12.gth: -------------------------------------------------------------------------------- 1 | Zn GTH-PADE-q12 GTH-LDA-q12 2 | 2 0 10 0 3 | 0.51000000 0 4 | 5 | 3 6 | 0.40086620 3 7 | 4.27870973 -1.40486350 0.69522313 8 | 3.62734196 -1.79505840 9 | 2.84956686 10 | 0.53961806 2 11 | 2.02388400 -0.18244417 12 | 0.43174171 13 | 0.25215059 1 14 | -14.33836841 15 | -------------------------------------------------------------------------------- /codes/xc_works/LDA_x_v2.py: -------------------------------------------------------------------------------- 1 | from sympy import * 2 | #from integer_numeric import * 3 | from integer_symbols import * 4 | 5 | Rhoe = symbols("ρ") 6 | 7 | third = ONE/THREE 8 | pi34 = (THREE/(FOUR*pi))**(ONE/THREE) 9 | f = -NINE/EIGHT*(THREE/TWO/pi)**(TWO/THREE) 10 | alpha = TWO/THREE 11 | 12 | r_s = pi34/Rhoe**third 13 | #r_s = symbols("r_s") 14 | 15 | ex = f * alpha / r_s 16 | 17 | pprint(ex) -------------------------------------------------------------------------------- /codes/common/XC_funcs/XC_x_slater.jl: -------------------------------------------------------------------------------- 1 | function XC_x_slater( Rhoe::Float64 ) 2 | third = 1.0/3.0 3 | pi34 = 0.6203504908994 # pi34=(3/4pi)^(1/3) 4 | rs = pi34/Rhoe^third 5 | f = -0.687247939924714 # -9/8*(3/2pi)^(2/3) 6 | alpha = 2.0/3.0 7 | # f*alpha = -3/4*(3/2pi)^(2/3) 8 | ex = f * alpha / rs 9 | vx = 4.0 / 3.0 * f * alpha / rs 10 | return ex, vx 11 | end 12 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ga-q13.gth: -------------------------------------------------------------------------------- 1 | Ga GTH-PADE-q13 GTH-LDA-q13 2 | 2 1 10 0 3 | 0.49000000 0 4 | 5 | 3 6 | 0.39530156 3 7 | 12.45703651 -7.08541671 1.84712738 8 | 12.15158654 -4.76926238 9 | 3.78548466 10 | 0.58085441 2 11 | 1.57898606 0.32869270 12 | -0.38891444 13 | 0.23908100 1 14 | -16.13575103 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ir-q9.gth: -------------------------------------------------------------------------------- 1 | Ir GTH-PADE-q9 GTH-LDA-q9 2 | 2 0 7 0 3 | 0.64100000 1 4 | 10.72001591 5 | 3 6 | 0.50996044 2 7 | 2.44599887 -1.08871009 8 | 2.81103736 9 | 0.68497052 2 10 | 0.46179182 -0.55134721 11 | 1.30472563 12 | 0.47174528 2 13 | -4.54548411 0.72115617 14 | -1.63542847 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Mo-q6.gth: -------------------------------------------------------------------------------- 1 | Mo GTH-PADE-q6 GTH-LDA-q6 2 | 1 0 5 0 3 | 0.69900000 1 4 | 7.99586821 5 | 3 6 | 0.67812595 2 7 | 1.28960728 -0.38656751 8 | 0.99811301 9 | 0.80077140 2 10 | 0.30141226 -0.31338933 11 | 0.74161451 12 | 0.45338393 2 13 | -2.80970771 3.00775463 14 | -6.82094635 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Nb-q5.gth: -------------------------------------------------------------------------------- 1 | Nb GTH-PADE-q5 GTH-LDA-q5 2 | 1 0 4 0 3 | 0.72400000 1 4 | 4.02105754 5 | 3 6 | 0.69970828 2 7 | 1.53265135 -0.55316427 8 | 1.42826399 9 | 0.84667164 2 10 | 0.60967518 -0.25218878 11 | 0.59678759 12 | 0.51607226 2 13 | -2.69682993 0.74741000 14 | -1.69496657 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Os-q8.gth: -------------------------------------------------------------------------------- 1 | Os GTH-PADE-q8 GTH-LDA-q8 2 | 2 0 6 0 3 | 0.66700000 1 4 | 9.44045936 5 | 3 6 | 0.51030708 2 7 | 2.40236688 -1.17998407 8 | 3.04670577 9 | 0.71755329 2 10 | 0.49952321 -0.44509384 11 | 1.05328427 12 | 0.48758605 2 13 | -4.14203471 0.73468110 14 | -1.66610013 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Re-q7.gth: -------------------------------------------------------------------------------- 1 | Re GTH-PADE-q7 GTH-LDA-q7 2 | 2 0 5 0 3 | 0.69300000 1 4 | 8.18081618 5 | 3 6 | 0.50981621 2 7 | 2.26937936 -1.36659354 8 | 3.52852934 9 | 0.74583906 2 10 | 0.49669329 -0.39123421 11 | 0.92582911 12 | 0.50095420 2 13 | -3.68962967 0.83544051 14 | -1.89460099 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Rh-q9.gth: -------------------------------------------------------------------------------- 1 | Rh GTH-PADE-q9 GTH-LDA-q9 2 | 1 0 8 0 3 | 0.62142857 1 4 | 5.39796233 5 | 3 6 | 0.59807881 2 7 | 2.24211131 -0.83330981 8 | 2.15159669 9 | 0.70958567 2 10 | 1.15527830 -0.29785195 11 | 0.70484635 12 | 0.36920687 2 13 | -1.05305819 4.81701344 14 | -10.92395969 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ru-q8.gth: -------------------------------------------------------------------------------- 1 | Ru GTH-PADE-q8 GTH-LDA-q8 2 | 1 0 7 0 3 | 0.64721429 1 4 | 8.68772333 5 | 3 6 | 0.62565612 2 7 | 1.63786602 -0.51484914 8 | 1.32933477 9 | 0.74642487 2 10 | 0.63901157 -0.27483407 11 | 0.65037612 12 | 0.44035802 2 13 | -4.88336495 1.35098513 14 | -3.06374629 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ta-q5.gth: -------------------------------------------------------------------------------- 1 | Ta GTH-PADE-q5 GTH-LDA-q5 2 | 2 0 3 0 3 | 0.74400000 1 4 | 3.62311645 5 | 3 6 | 0.58180113 2 7 | 2.00533833 -1.17236605 8 | 3.02703613 9 | 0.77064628 2 10 | 0.51856664 -0.50091380 11 | 1.18537841 12 | 0.53436996 2 13 | -2.20220040 0.73493457 14 | -1.66667495 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Tc-q7.gth: -------------------------------------------------------------------------------- 1 | Tc GTH-PADE-q7 GTH-LDA-q7 2 | 1 0 6 0 3 | 0.67300000 1 4 | 13.31538067 5 | 3 6 | 0.67761188 2 7 | 0.81921767 -0.13495786 8 | 0.34845968 9 | 0.78427538 2 10 | 0.02867266 -0.27820911 11 | 0.65836292 12 | 0.51988975 2 13 | -5.98422427 -0.31829379 14 | 0.72182246 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/W-q6.gth: -------------------------------------------------------------------------------- 1 | W GTH-PADE-q6 GTH-LDA-q6 2 | 2 0 4 0 3 | 0.71900000 1 4 | 4.05844991 5 | 3 6 | 0.58246289 2 7 | 2.16116556 -1.06177835 8 | 2.74149991 9 | 0.74230741 2 10 | 0.60097339 -0.54932611 11 | 1.29994284 12 | 0.53495887 2 13 | -2.51706347 0.34797654 14 | -0.78913661 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Y-q11.gth: -------------------------------------------------------------------------------- 1 | Y GTH-PBE-q11 2 | 4 6 1 0 3 | 0.47500000 2 4 | 12.16776904 -2.32855103 5 | 3 6 | 0.24674070 2 7 | 23.45027195 -8.32535748 8 | 10.74799029 9 | 0.29656397 2 10 | 5.97863401 -5.85234964 11 | 6.92459348 12 | 0.45045569 2 13 | 1.18749048 -1.31867331 14 | 1.49523499 15 | -------------------------------------------------------------------------------- /codes/hartree_scf/calc_rhoe.jl: -------------------------------------------------------------------------------- 1 | function calc_rhoe( Ham, psi::Array{Float64,2} ) 2 | Nbasis = size(psi,1) 3 | Nstates = size(psi,2) 4 | 5 | Rhoe = zeros(Float64,Nbasis) 6 | 7 | for ist in 1:Nstates 8 | f = Ham.electrons.Focc[ist] 9 | for ip in 1:Nbasis 10 | Rhoe[ip] = Rhoe[ip] + f*psi[ip,ist]*psi[ip,ist] 11 | end 12 | end 13 | return Rhoe 14 | end -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ag-q1.gth: -------------------------------------------------------------------------------- 1 | Ag GTH-PADE-q1 GTH-LDA-q1 2 | 1 0 0 0 3 | 0.65000000 1 4 | -2.37606096 5 | 3 6 | 1.01270456 3 7 | 0.89793134 0.28982424 0.00726736 8 | -0.74832297 -0.01876424 9 | 0.02978730 10 | 1.23584202 2 11 | 0.13008068 0.11726324 12 | -0.27749548 13 | 1.01615913 1 14 | -0.03884235 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/At-q7.gth: -------------------------------------------------------------------------------- 1 | At GTH-PADE-q7 GTH-LDA-q7 2 | 2 5 0 0 3 | 0.58000000 1 4 | 13.52041116 5 | 3 6 | 0.62782694 3 7 | 0.94555652 0.37409257 -0.04645981 8 | -0.96590285 0.11995872 9 | -0.19042856 10 | 0.70982320 2 11 | 0.52707805 0.13472635 12 | -0.31882073 13 | 0.83836499 1 14 | 0.46894787 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Au-q11.gth: -------------------------------------------------------------------------------- 1 | Au GTH-PADE-q11 GTH-LDA-q11 2 | 1 0 10 0 3 | 0.59000000 1 4 | 11.60442790 5 | 3 6 | 0.52117975 2 7 | 2.53861359 -1.04613664 8 | 2.70111320 9 | 0.63061306 2 10 | 0.39485270 -0.86959213 11 | 2.05783056 12 | 0.44070643 2 13 | -4.71906966 0.72777081 14 | -1.65042907 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Bi-q5.gth: -------------------------------------------------------------------------------- 1 | Bi GTH-PADE-q5 GTH-LDA-q5 2 | 2 3 0 0 3 | 0.60500000 1 4 | 6.67943714 5 | 3 6 | 0.67885795 3 7 | 1.37763378 0.19895396 -0.11491910 8 | -0.51369691 0.29671983 9 | -0.47102813 10 | 0.79867267 2 11 | 0.65557809 0.17026993 12 | -0.40293219 13 | 0.93468255 1 14 | 0.37847579 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Cd-q2.gth: -------------------------------------------------------------------------------- 1 | Cd GTH-PADE-q2 GTH-LDA-q2 2 | 2 0 0 0 3 | 0.62500000 1 4 | -1.79683799 5 | 3 6 | 0.82846467 3 7 | 1.48529241 0.16450606 -0.09953846 8 | -0.42475283 0.25700719 9 | -0.40798627 10 | 0.97287254 2 11 | 0.46920843 0.18936149 12 | -0.44811107 13 | 1.24094900 1 14 | 0.06541164 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Hg-q12.gth: -------------------------------------------------------------------------------- 1 | Hg GTH-PADE-q12 GTH-LDA-q12 2 | 2 0 10 0 3 | 0.57000000 1 4 | 2.13457183 5 | 3 6 | 0.52180188 2 7 | 3.29392021 -1.80519780 8 | 4.66100069 9 | 0.62164790 2 10 | 2.10096040 -0.71415047 11 | 1.68998846 12 | 0.40189401 2 13 | -1.66988578 1.09060737 14 | -2.47326503 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Hg-q2.gth: -------------------------------------------------------------------------------- 1 | Hg GTH-PADE-q2 GTH-LDA-q2 2 | 2 0 0 0 3 | 0.64000000 1 4 | -3.29632880 5 | 3 6 | 0.81210780 3 7 | 1.76504143 0.18053035 -0.19516558 8 | -0.46612737 0.50391537 9 | -0.79994085 10 | 1.05371378 2 11 | 0.47405588 0.22473320 12 | -0.53181582 13 | 1.10000000 1 14 | 0.12063831 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/I-q7.gth: -------------------------------------------------------------------------------- 1 | I GTH-PADE-q7 GTH-LDA-q7 2 | 2 5 0 0 3 | 0.56000000 1 4 | 14.66182521 5 | 3 6 | 0.55283008 3 7 | 1.33805374 0.32333643 -0.11404312 8 | -0.83485108 0.29445806 9 | -0.46743768 10 | 0.56225147 2 11 | 0.67449617 0.24415947 12 | -0.57778676 13 | 0.79432495 1 14 | 0.22434543 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/In-q3.gth: -------------------------------------------------------------------------------- 1 | In GTH-PADE-q3 GTH-LDA-q3 2 | 2 1 0 0 3 | 0.61000000 1 4 | 2.86577676 5 | 3 6 | 0.77060197 3 7 | 1.25619360 0.15385620 -0.06790534 8 | -0.39725499 0.17533083 9 | -0.27832906 10 | 0.85813160 2 11 | 0.49445864 0.16091263 12 | -0.38078878 13 | 1.08869090 1 14 | 0.12920778 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Pb-q4.gth: -------------------------------------------------------------------------------- 1 | Pb GTH-PADE-q4 GTH-LDA-q4 2 | 2 2 0 0 3 | 0.61750000 1 4 | 0.75314257 5 | 3 6 | 0.70525860 3 7 | 1.97992741 0.06388872 -0.19665860 8 | -0.16495996 0.50777033 9 | -0.80606040 10 | 0.84664106 2 11 | 0.86442030 0.22860106 12 | -0.54096885 13 | 0.97193857 1 14 | 0.37496708 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Pd-q10.gth: -------------------------------------------------------------------------------- 1 | Pd GTH-PADE-q10 GTH-LDA-q10 2 | 0 0 10 0 3 | 0.59600000 1 4 | 5.20966476 5 | 3 6 | 0.58220422 2 7 | 2.41107608 -0.89811395 8 | 2.31892024 9 | 0.68878713 2 10 | 1.22725330 -0.32032214 11 | 0.75802053 12 | 0.44283523 2 13 | -4.37713124 -0.18223540 14 | 0.41327105 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Po-q6.gth: -------------------------------------------------------------------------------- 1 | Po GTH-PADE-q6 GTH-LDA-q6 2 | 2 4 0 0 3 | 0.59250000 1 4 | 10.41173070 5 | 3 6 | 0.64794961 3 7 | 1.14420296 0.28499406 -0.08280174 8 | -0.73585149 0.21379318 9 | -0.33938616 10 | 0.74894708 2 11 | 0.59456184 0.14942108 12 | -0.35359482 13 | 0.88046840 1 14 | 0.43323228 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Pt-q10.gth: -------------------------------------------------------------------------------- 1 | Pt GTH-PADE-q10 GTH-LDA-q10 2 | 1 0 9 0 3 | 0.61600000 1 4 | 11.02741707 5 | 3 6 | 0.52013211 2 7 | 2.44743006 -1.02260695 8 | 2.64035978 9 | 0.65897566 2 10 | 0.40845297 -0.69628711 11 | 1.64771604 12 | 0.45124318 2 13 | -4.55229454 0.92706936 14 | -2.10239568 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Rn-q8.gth: -------------------------------------------------------------------------------- 1 | Rn GTH-PADE-q8 GTH-LDA-q8 2 | 2 6 0 0 3 | 0.57000000 1 4 | 14.62918461 5 | 3 6 | 0.61518195 3 7 | 0.98183224 0.40238854 -0.02938821 8 | -1.03896274 0.07588004 9 | -0.12045584 10 | 0.67669721 2 11 | 0.61227859 0.14541822 12 | -0.34412231 13 | 0.78833715 1 14 | 0.55774596 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Sb-q5.gth: -------------------------------------------------------------------------------- 1 | Sb GTH-PADE-q5 GTH-LDA-q5 2 | 2 3 0 0 3 | 0.59000000 1 4 | 6.68022783 5 | 3 6 | 0.59768356 3 7 | 1.95147672 -0.01453812 -0.19191821 8 | 0.03753727 0.49553069 9 | -0.78663058 10 | 0.67212205 2 11 | 0.97031285 0.19722998 12 | -0.46673132 13 | 0.85655729 1 14 | 0.30010262 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Sn-q4.gth: -------------------------------------------------------------------------------- 1 | Sn GTH-PADE-q4 GTH-LDA-q4 2 | 2 2 0 0 3 | 0.60500000 1 4 | 4.61091234 5 | 3 6 | 0.66354369 3 7 | 1.64879146 0.05498623 -0.14066273 8 | -0.14197384 0.36318961 9 | -0.57654563 10 | 0.74586492 2 11 | 0.76935544 0.18807652 12 | -0.44507028 13 | 0.94445897 1 14 | 0.22511508 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Te-q6.gth: -------------------------------------------------------------------------------- 1 | Te GTH-PADE-q6 GTH-LDA-q6 2 | 2 4 0 0 3 | 0.57500000 1 4 | 9.38708481 5 | 3 6 | 0.55645602 3 7 | 2.04689031 0.01136047 -0.21497109 8 | -0.02933260 0.55505297 9 | -0.88111927 10 | 0.61526187 2 11 | 1.03347754 0.20333245 12 | -0.48117240 13 | 0.80510072 1 14 | 0.31741073 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Tl-q13.gth: -------------------------------------------------------------------------------- 1 | Tl GTH-PADE-q13 GTH-LDA-q13 2 | 2 1 10 0 3 | 0.55000000 1 4 | 7.30188582 5 | 3 6 | 0.50242266 2 7 | 3.32656022 -1.68141322 8 | 4.34139027 9 | 0.57201594 2 10 | 1.27280729 -1.26443781 11 | 2.99220598 12 | 0.39318504 2 13 | -3.20065227 1.32653373 14 | -3.00829573 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Tl-q3.gth: -------------------------------------------------------------------------------- 1 | Tl GTH-PADE-q3 GTH-LDA-q3 2 | 2 1 0 0 3 | 0.63000000 1 4 | -1.23584552 5 | 3 6 | 0.75400547 3 7 | 1.87576571 0.11761462 -0.19062668 8 | -0.30367964 0.49219597 9 | -0.78133689 10 | 0.90374170 2 11 | 0.75966830 0.24793467 12 | -0.58672051 13 | 1.06351212 1 14 | 0.24761396 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Xe-q8.gth: -------------------------------------------------------------------------------- 1 | Xe GTH-PADE-q8 GTH-LDA-q8 2 | 2 6 0 0 3 | 0.56000000 1 4 | 12.73427972 5 | 3 6 | 0.50737118 3 7 | 2.23645069 0.15629453 -0.27630331 8 | -0.40355073 0.71341207 9 | -1.13250655 10 | 0.54102371 2 11 | 1.13004299 0.31810091 12 | -0.75276413 13 | 0.72982111 1 14 | 0.28013078 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ag-q19.gth: -------------------------------------------------------------------------------- 1 | Ag GTH-PBE-q19 2 | 3 6 10 0 3 | 0.40000000 2 4 | 24.53317558 -4.21395181 5 | 3 6 | 0.31760029 2 7 | 0.62551338 4.28490995 8 | -5.53179495 9 | 0.41962178 2 10 | -0.19050165 -0.61441835 11 | 0.72698960 12 | 0.45640092 2 13 | 1.75125916 -3.09368795 14 | 3.50791241 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ba-q10.gth: -------------------------------------------------------------------------------- 1 | Ba GTH-PBE-q10 2 | 4 6 0 0 3 | 0.54000000 2 4 | 24.52678070 -2.46867001 5 | 4 6 | 0.49206839 2 7 | 0.09515093 1.16931840 8 | -1.50958357 9 | 0.39148930 2 10 | 0.80018261 -1.61683907 11 | 1.91306979 12 | 0.67217348 1 13 | 0.38853100 14 | 0.30049773 1 15 | -19.65379452 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Cs-q9.gth: -------------------------------------------------------------------------------- 1 | Cs GTH-PBE-q9 2 | 3 6 0 0 3 | 0.54000000 2 4 | 33.31331676 -2.92121670 5 | 4 6 | 0.46189568 2 7 | -3.32292700 2.45565338 8 | -3.17023488 9 | 0.36635860 2 10 | -4.95076405 0.84038977 11 | -0.99436259 12 | 0.76150193 1 13 | 0.19840723 14 | 0.59701503 1 15 | -1.55056693 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Mo-q14.gth: -------------------------------------------------------------------------------- 1 | Mo GTH-PBE-q14 2 | 3 6 5 0 3 | 0.43000000 2 4 | 28.60936832 -4.72180336 5 | 3 6 | 0.34521579 2 7 | 0.14630305 2.76200500 8 | -3.56573312 9 | 0.41688762 2 10 | -0.19078495 -0.72874402 11 | 0.86226156 12 | 0.42050785 2 13 | 1.21681419 -2.68646267 14 | 3.04616234 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Nb-q13.gth: -------------------------------------------------------------------------------- 1 | Nb GTH-PBE-q13 2 | 3 6 4 0 3 | 0.46000000 2 4 | 26.27526252 -4.57803146 5 | 3 6 | 0.35116942 2 7 | -1.04371870 3.27790404 8 | -4.23175592 9 | 0.40546040 2 10 | -0.66246647 -0.90782868 11 | 1.07415738 12 | 0.42212155 2 13 | 1.49409323 -3.43003953 14 | 3.88929925 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Pd-q18.gth: -------------------------------------------------------------------------------- 1 | Pd GTH-PBE-q18 2 | 2 6 10 0 3 | 0.41000000 2 4 | 26.78365917 -4.93130594 5 | 3 6 | 0.33797077 2 7 | -0.71872875 4.38486657 8 | -5.66083840 9 | 0.41519591 2 10 | -0.04624449 -1.07795233 11 | 1.27545040 12 | 0.44027049 2 13 | 1.63916358 -3.09368795 14 | 3.50791241 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Rh-q17.gth: -------------------------------------------------------------------------------- 1 | Rh GTH-PBE-q17 2 | 3 6 8 0 3 | 0.42000000 2 4 | 26.20679340 -4.93738335 5 | 3 6 | 0.34544622 2 7 | -0.45248232 3.89280438 8 | -5.02558885 9 | 0.37838014 2 10 | -0.94111242 -0.00569931 11 | 0.00674351 12 | 0.43374725 2 13 | 1.57423622 -3.01217170 14 | 3.41548166 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ru-q16.gth: -------------------------------------------------------------------------------- 1 | Ru GTH-PBE-q16 2 | 3 6 7 0 3 | 0.43000000 2 4 | 26.83239104 -5.05049720 5 | 3 6 | 0.34135508 2 7 | -0.55504091 3.71548964 8 | -4.79667650 9 | 0.42827085 2 10 | 0.10677508 -1.27757181 11 | 1.51164335 12 | 0.43814779 2 13 | 1.50921742 -2.94305440 14 | 3.33711002 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Tc-q15.gth: -------------------------------------------------------------------------------- 1 | Tc GTH-PBE-q15 2 | 3 6 6 0 3 | 0.43000000 2 4 | 27.30199947 -4.64715709 5 | 3 6 | 0.34617499 2 7 | -0.37921852 3.34056578 8 | -4.31265188 9 | 0.42346840 2 10 | -0.24151639 -0.82215042 11 | 0.97278149 12 | 0.43186468 2 13 | 1.21878473 -2.67400954 14 | 3.03204182 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Zr-q12.gth: -------------------------------------------------------------------------------- 1 | Zr GTH-PBE-q12 2 | 4 6 2 0 3 | 0.47000000 2 4 | 7.79605677 -1.89321030 5 | 3 6 | 0.25982885 2 7 | 23.38087417 -8.57193933 8 | 11.06632609 9 | 0.28896899 2 10 | 8.59276581 -5.37735808 11 | 6.36257589 12 | 0.58124504 2 13 | 0.02781064 0.27686186 14 | -0.31393184 15 | -------------------------------------------------------------------------------- /codes/modelscf1d/reference_impl/test_hartree_pot_bc.jl: -------------------------------------------------------------------------------- 1 | function test_hartree_pot_bc(Ham) 2 | # 3 | Ns = Ham.Ns 4 | rho_in = zeros(Float64, Ns, 1) 5 | fill!( rho_in, 1.0 ) 6 | rho_in[2] = 2.0 7 | VHartree = hartree_pot_bc(rho_in, Ham) 8 | 9 | println("Test hartree_pot_bc, Ns = ", Ns) 10 | for ip in 1:10 11 | @printf("%3d %18.10f\n", ip, VHartree[ip]) 12 | end 13 | end -------------------------------------------------------------------------------- /codes/poisson_3d/INC_poisson_3d.jl: -------------------------------------------------------------------------------- 1 | include("../FD3d/FD3dGrid.jl") 2 | include("../FD3d/build_nabla2_matrix.jl") 3 | 4 | include("../LF3d/LF3dGrid.jl") 5 | include("../LF3d/build_nabla2_matrix.jl") 6 | 7 | include("../common/supporting_functions.jl") 8 | 9 | include("Poisson_solve_CG.jl") 10 | include("Poisson_solve_PCG.jl") 11 | include("Poisson_solve_DAGE.jl") 12 | include("Poisson_solve_CG_multipole.jl") -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/La-q11.gth: -------------------------------------------------------------------------------- 1 | La GTH-PBE-q11 2 | 4 6 1 0 3 | 0.53500000 2 4 | 20.68980469 -1.70327035 5 | 4 6 | 0.56144723 2 7 | -0.02823977 1.07859821 8 | -1.39246430 9 | 0.47517309 2 10 | 0.26802268 0.67328503 11 | -0.79664160 12 | 0.62908399 1 13 | 0.38022718 14 | 0.29911708 1 15 | -18.44354886 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ag-q19.gth: -------------------------------------------------------------------------------- 1 | Ag GTH-PADE-q19 GTH-LDA-q19 2 | 3 6 10 0 3 | 0.40000000 2 4 | 26.10213544 -5.21734352 5 | 3 6 | 0.30814467 2 7 | 1.55692822 3.68811443 8 | -4.76133525 9 | 0.42100419 2 10 | 0.24550848 -0.89060050 11 | 1.05377272 12 | 0.44722234 2 13 | 1.87011922 -3.09368795 14 | 3.50791241 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Mo-q14.gth: -------------------------------------------------------------------------------- 1 | Mo GTH-PADE-q14 GTH-LDA-q14 2 | 3 6 5 0 3 | 0.43000000 2 4 | 16.23745228 1.49653613 5 | 3 6 | 0.37625527 2 7 | 3.36242551 2.04852792 8 | -5.28927635 9 | 0.36173435 2 10 | -0.37957075 1.71892268 11 | -4.06771350 12 | 0.52582812 2 13 | -1.54321130 -0.47376044 14 | 1.07438769 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Nb-q13.gth: -------------------------------------------------------------------------------- 1 | Nb GTH-PADE-q13 GTH-LDA-q13 2 | 3 6 4 0 3 | 0.46000000 2 4 | 13.50539360 0.75243372 5 | 3 6 | 0.39370802 2 7 | 3.22202457 1.78131738 8 | -4.59934171 9 | 0.40362557 2 10 | -0.82203677 0.94968536 11 | -2.24736575 12 | 0.51364405 2 13 | -1.48984771 -0.36326930 14 | 0.82381733 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Rh-q17.gth: -------------------------------------------------------------------------------- 1 | Rh GTH-PADE-q17 GTH-LDA-q17 2 | 3 6 8 0 3 | 0.42000000 2 4 | 15.22501231 0.41591145 5 | 3 6 | 0.35005185 2 7 | 4.71529244 2.24847003 8 | -5.80552464 9 | 0.35025339 2 10 | -0.50469386 1.42536937 11 | -3.37303956 12 | 0.49694980 2 13 | -1.68559431 -0.61192127 14 | 1.38770701 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ru-q16.gth: -------------------------------------------------------------------------------- 1 | Ru GTH-PADE-q16 GTH-LDA-q16 2 | 3 6 7 0 3 | 0.43000000 2 4 | 13.58257130 0.59622675 5 | 3 6 | 0.36408374 2 7 | 4.48063220 2.04055059 8 | -5.26867898 9 | 0.36405317 2 10 | -0.32037214 1.29296495 11 | -3.05971353 12 | 0.49585036 2 13 | -1.59787017 -0.51393501 14 | 1.16549505 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Tc-q15.gth: -------------------------------------------------------------------------------- 1 | Tc GTH-PADE-q15 GTH-LDA-q15 2 | 3 6 6 0 3 | 0.43000001 2 4 | 14.91001129 1.04638147 5 | 3 6 | 0.36972111 2 7 | 3.91740844 2.04044213 8 | -5.26839892 9 | 0.35777235 2 10 | -0.27000007 1.57949660 11 | -3.73777116 12 | 0.51048733 2 13 | -1.58670910 -0.49930056 14 | 1.13230724 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Y-q11.gth: -------------------------------------------------------------------------------- 1 | Y GTH-PADE-q11 GTH-LDA-q11 2 | 4 6 1 0 3 | 0.47500000 2 4 | 6.89262113 -1.44841137 5 | 3 6 | 0.25929613 2 7 | 11.06849407 -4.05874563 8 | 10.47963616 9 | 0.28851147 2 10 | 3.01907548 -1.80967899 11 | 4.28248210 12 | 0.50364209 2 13 | 0.33991901 -0.00795600 14 | 0.01804251 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Zr-q12.gth: -------------------------------------------------------------------------------- 1 | Zr GTH-PADE-q12 GTH-LDA-q12 2 | 4 6 2 0 3 | 0.47000000 2 4 | 6.34261837 -1.73217100 5 | 3 6 | 0.26250960 2 7 | 11.10177456 -3.71411720 8 | 9.58980939 9 | 0.28881376 2 10 | 3.44681955 -1.78708731 11 | 4.22902044 12 | 0.58825239 2 13 | 0.33463695 0.08621617 14 | -0.19551990 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Au-q1.gth: -------------------------------------------------------------------------------- 1 | Au GTH-PADE-q1 GTH-LDA-q1 2 | 1 0 0 0 3 | 0.65000000 2 4 | -1.96371223 -1.69812291 5 | 2 6 | 0.91930757 3 7 | 1.53959915 0.18155717 -0.19323771 8 | -0.46877861 0.49893761 9 | -0.79203890 10 | 1.14035080 3 11 | 0.47122943 0.21024829 -0.06235978 12 | -0.49753827 0.14757016 13 | -0.20975780 14 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ba-q10.gth: -------------------------------------------------------------------------------- 1 | Ba GTH-PADE-q10 GTH-LDA-q10 2 | 4 6 0 0 3 | 0.54000000 2 4 | 24.47865325 -2.50084994 5 | 4 6 | 0.51477613 2 7 | 1.04672903 0.37847454 8 | -0.97721707 9 | 0.37519011 2 10 | -0.20243912 -0.28749217 11 | 0.68033065 12 | 0.66540319 1 13 | 0.37841850 14 | 0.30492043 1 15 | -18.79520777 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Cs-q9.gth: -------------------------------------------------------------------------------- 1 | Cs GTH-PADE-q9 GTH-LDA-q9 2 | 3 6 0 0 3 | 0.54000000 2 4 | 35.23443810 -3.31807009 5 | 4 6 | 0.45682103 2 7 | -0.28237849 1.07705949 8 | -2.78095565 9 | 0.36246700 2 10 | -2.69673321 0.96809883 11 | -2.29093996 12 | 0.76146205 1 13 | 0.18375440 14 | 0.33350703 1 15 | -17.94825944 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Pd-q18.gth: -------------------------------------------------------------------------------- 1 | Pd GTH-PADE-q18 GTH-LDA-q18 2 | 2 6 10 0 3 | 0.41000000 2 4 | 15.72025922 0.14076508 5 | 3 6 | 0.34215063 2 7 | 5.17768606 2.26678707 8 | -5.85281906 9 | 0.34311064 2 10 | -0.37256076 1.37706395 11 | -3.25872809 12 | 0.49491624 2 13 | -1.60827298 -0.63789470 14 | 1.44660922 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Rb-q1.gth: -------------------------------------------------------------------------------- 1 | Rb GTH-PADE-q1 GTH-LDA-q1 2 | 1 0 0 0 3 | 1.09620685 2 4 | 0.84733274 -0.74812032 5 | 3 6 | 0.95569909 3 7 | 0.88746022 -0.34976454 -0.00164684 8 | 0.90308815 0.00425212 9 | -0.00675003 10 | 1.15668058 2 11 | 0.46173448 -0.14203355 12 | 0.33611273 13 | 0.66432256 1 14 | -1.36293829 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Sr-q2.gth: -------------------------------------------------------------------------------- 1 | Sr GTH-PADE-q2 GTH-LDA-q2 2 | 2 0 0 0 3 | 1.01000000 2 4 | 0.68474888 -0.06212465 5 | 3 6 | 0.83756431 3 7 | 1.20039504 -0.35889978 -0.07706135 8 | 0.92667525 0.19897155 9 | -0.31585755 10 | 1.17417825 2 11 | 0.43998339 -0.00771915 12 | 0.01826685 13 | 0.74317548 1 14 | -1.38699026 15 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ce-q12.gth: -------------------------------------------------------------------------------- 1 | Ce GTH-PBE-q12 2 | 4 6 1 1 3 | 0.52480035 2 4 | 18.46313266 -0.35928475 5 | 4 6 | 0.52899318 2 7 | -0.46945550 1.68519941 8 | -2.17558308 9 | 0.47758674 2 10 | -0.85915259 1.49893178 11 | -1.77356000 12 | 0.65909303 1 13 | 0.10742047 14 | 0.30186583 1 15 | -17.66735258 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Dy-q20.gth: -------------------------------------------------------------------------------- 1 | Dy GTH-PBE-q20 2 | 4 6 0 10 3 | 0.51029687 2 4 | 17.67093508 -0.86787770 5 | 4 6 | 0.44212348 2 7 | -2.71573384 4.01788426 8 | -5.18706627 9 | 0.45017230 2 10 | -2.77347535 2.20115245 11 | -2.60443870 12 | 0.47116514 1 13 | -0.75227561 14 | 0.26180741 1 15 | -24.24856414 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Er-q22.gth: -------------------------------------------------------------------------------- 1 | Er GTH-PBE-q22 2 | 4 6 0 12 3 | 0.50173422 2 4 | 17.22416099 -1.23324605 5 | 4 6 | 0.42576787 2 7 | -2.61580658 4.19913757 8 | -5.42106329 9 | 0.41793960 2 10 | -3.15341814 3.17618553 11 | -3.75811340 12 | 0.43046826 1 13 | -0.89805056 14 | 0.24914231 1 15 | -26.58720599 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Eu-q17.gth: -------------------------------------------------------------------------------- 1 | Eu GTH-PBE-q17 2 | 4 6 0 7 3 | 0.52072219 2 4 | 17.93467530 -0.57606530 5 | 4 6 | 0.46955990 2 7 | -2.07710390 3.25447577 8 | -4.20151015 9 | 0.46644592 2 10 | -2.34175427 2.29907112 11 | -2.72029763 12 | 0.47357383 1 13 | -0.59831876 14 | 0.27831058 1 15 | -21.30605878 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Gd-q18.gth: -------------------------------------------------------------------------------- 1 | Gd GTH-PBE-q18 2 | 4 6 1 7 3 | 0.52126799 2 4 | 18.10313196 -0.51440770 5 | 4 6 | 0.45805877 2 7 | -2.87481761 3.91661136 8 | -5.05632353 9 | 0.46124964 2 10 | -3.05406750 2.55197375 11 | -3.01953606 12 | 0.48332992 1 13 | -0.84348188 14 | 0.27559144 1 15 | -22.18390606 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ho-q21.gth: -------------------------------------------------------------------------------- 1 | Ho GTH-PBE-q21 2 | 4 6 0 11 3 | 0.51034519 2 4 | 17.00694728 -1.14166376 5 | 4 6 | 0.43408065 2 7 | -2.64595349 4.10374692 8 | -5.29791449 9 | 0.43159817 2 10 | -3.06100899 2.73161511 11 | -3.23209058 12 | 0.45020006 1 13 | -0.82014316 14 | 0.25514026 1 15 | -25.40966658 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Lu-q25.gth: -------------------------------------------------------------------------------- 1 | Lu GTH-PBE-q25 2 | 4 6 1 14 3 | 0.49611621 2 4 | 18.63208417 -1.51663710 5 | 4 6 | 0.39319895 2 7 | -5.65573977 6.47885270 8 | -8.36416287 9 | 0.41028936 2 10 | -4.66078088 2.84645630 11 | -3.36797252 12 | 0.43890201 1 13 | -1.52277808 14 | 0.23494399 1 15 | -32.20596727 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Nd-q14.gth: -------------------------------------------------------------------------------- 1 | Nd GTH-PBE-q14 2 | 4 6 0 4 3 | 0.52991298 2 4 | 17.80646346 -0.32095543 5 | 4 6 | 0.50114025 2 7 | -1.36443892 2.46474917 8 | -3.18197749 9 | 0.50039105 2 10 | -1.55942619 1.53939247 11 | -1.82143373 12 | 0.33431765 1 13 | -1.70064367 14 | 0.29567529 1 15 | -18.64327128 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Pm-q15.gth: -------------------------------------------------------------------------------- 1 | Pm GTH-PBE-q15 2 | 4 6 0 5 3 | 0.52793919 2 4 | 17.84482075 -0.36133182 5 | 4 6 | 0.48944396 2 7 | -1.72725500 2.81006693 8 | -3.62778081 9 | 0.49132954 2 10 | -1.87193192 1.65260118 11 | -1.95538409 12 | 0.47893079 1 13 | -0.44781450 14 | 0.29022183 1 15 | -19.51693564 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Pr-q13.gth: -------------------------------------------------------------------------------- 1 | Pr GTH-PBE-q13 2 | 4 6 0 3 3 | 0.53188976 2 4 | 16.83551414 -0.43235649 5 | 4 6 | 0.52415103 2 7 | -0.50975406 1.84037783 8 | -2.37591756 9 | 0.48546735 2 10 | -0.98189616 1.60445908 11 | -1.89842158 12 | 0.71653344 1 13 | 0.05575046 14 | 0.29937329 1 15 | -17.49550069 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Sm-q16.gth: -------------------------------------------------------------------------------- 1 | Sm GTH-PBE-q16 2 | 4 6 0 6 3 | 0.52466086 2 4 | 16.51148828 -0.24504217 5 | 4 6 | 0.48687809 2 7 | -1.59045606 2.90667135 8 | -3.75249657 9 | 0.49648709 2 10 | -1.75047341 1.54491665 11 | -1.82797004 12 | 0.49241328 1 13 | -0.41980527 14 | 0.28444353 1 15 | -19.88144667 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Tb-q19.gth: -------------------------------------------------------------------------------- 1 | Tb GTH-PBE-q19 2 | 4 6 0 9 3 | 0.51588228 2 4 | 17.15783725 -0.66955170 5 | 4 6 | 0.45376626 2 7 | -2.42821095 3.74357813 8 | -4.83293859 9 | 0.45360450 2 10 | -2.68351507 2.30311187 11 | -2.72507871 12 | 0.47258283 1 13 | -0.72646091 14 | 0.26876196 1 15 | -22.75147607 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Tm-q23.gth: -------------------------------------------------------------------------------- 1 | Tm GTH-PBE-q23 2 | 4 6 0 13 3 | 0.50234443 2 4 | 17.68675860 -1.59907075 5 | 4 6 | 0.41312714 2 7 | -3.20033933 4.64501695 8 | -5.99669110 9 | 0.41759033 2 10 | -3.17289513 2.80513657 11 | -3.31908235 12 | 0.39281519 1 13 | -1.44965467 14 | 0.24385920 1 15 | -28.31696046 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Yb-q24.gth: -------------------------------------------------------------------------------- 1 | Yb GTH-PBE-q24 2 | 4 6 0 14 3 | 0.49808783 2 4 | 17.08328394 -1.56295270 5 | 4 6 | 0.40553079 2 7 | -3.55061134 5.03314458 8 | -6.49776171 9 | 0.42489671 2 10 | -3.13538311 2.14082491 11 | -2.53305819 12 | 0.44507157 1 13 | -0.91407703 14 | 0.23857822 1 15 | -29.66528314 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Dy-q20.gth: -------------------------------------------------------------------------------- 1 | Dy GTH-PADE-q20 GTH-LDA-q20 2 | 4 6 0 10 3 | 0.51166666 2 4 | 16.99433138 -0.95529792 5 | 4 6 | 0.44059045 2 7 | 1.94031950 1.37870375 8 | -3.55979777 9 | 0.43464206 2 10 | 0.01431536 0.86469335 11 | -2.04623793 12 | 0.46722880 1 13 | -0.66892417 14 | 0.26167045 1 15 | -23.92235817 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Er-q22.gth: -------------------------------------------------------------------------------- 1 | Er GTH-PADE-q22 GTH-LDA-q22 2 | 4 6 0 12 3 | 0.50583333 2 4 | 17.10529281 -1.43095318 5 | 4 6 | 0.41994801 2 7 | 2.14450257 1.54307528 8 | -3.98420323 9 | 0.41445530 2 10 | 0.05408736 0.96959342 11 | -2.29447680 12 | 0.41838497 1 13 | -0.99900632 14 | 0.24912591 1 15 | -26.69680936 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Eu-q17.gth: -------------------------------------------------------------------------------- 1 | Eu GTH-PADE-q17 GTH-LDA-q17 2 | 4 6 0 7 3 | 0.52041668 2 4 | 17.37351625 -0.64846778 5 | 4 6 | 0.46904261 2 7 | 1.76363790 1.12972280 8 | -2.91693172 9 | 0.44590722 2 10 | 0.51804594 0.90228057 11 | -2.13518554 12 | 0.49003840 1 13 | -0.42611996 14 | 0.27840129 1 15 | -20.94652763 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ho-q21.gth: -------------------------------------------------------------------------------- 1 | Ho GTH-PADE-q21 GTH-LDA-q21 2 | 4 6 0 11 3 | 0.50875002 2 4 | 16.78157003 -1.17351448 5 | 4 6 | 0.43221176 2 7 | 2.05279689 1.42314101 8 | -3.67453429 9 | 0.42013792 2 10 | 0.25329464 0.99529117 11 | -2.35528878 12 | 0.44713057 1 13 | -0.74286267 14 | 0.25499226 1 15 | -25.19721081 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Nd-q14.gth: -------------------------------------------------------------------------------- 1 | Nd GTH-PADE-q14 GTH-LDA-q14 2 | 4 6 0 4 3 | 0.52916670 2 4 | 17.81503043 -0.59479767 5 | 4 6 | 0.50299986 2 7 | 1.52910988 0.83413680 8 | -2.15373194 9 | 0.46701290 2 10 | 0.72155346 0.69619548 11 | -1.64749920 12 | 0.32528958 1 13 | -0.54324017 14 | 0.29474281 1 15 | -18.52022760 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Pm-q15.gth: -------------------------------------------------------------------------------- 1 | Pm GTH-PADE-q15 GTH-LDA-q15 2 | 4 6 0 5 3 | 0.52625000 2 4 | 18.25172292 -0.49210744 5 | 4 6 | 0.48987856 2 7 | 1.30897757 0.97124774 8 | -2.50775088 9 | 0.47226016 2 10 | 0.16051238 0.66146221 11 | -1.56530527 12 | 0.47370914 1 13 | -0.42995241 14 | 0.29152653 1 15 | -19.30505668 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Pr-q13.gth: -------------------------------------------------------------------------------- 1 | Pr GTH-PADE-q13 GTH-LDA-q13 2 | 4 6 0 3 3 | 0.53208333 2 4 | 18.42473909 -0.65766893 5 | 4 6 | 0.52684996 2 7 | 1.01262106 0.66537143 8 | -1.71798165 9 | 0.45889736 2 10 | 1.11706004 0.78265878 11 | -1.85210872 12 | 0.74760989 1 13 | 0.01757109 14 | 0.30077296 1 15 | -17.89711891 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Tb-q19.gth: -------------------------------------------------------------------------------- 1 | Tb GTH-PADE-q19 GTH-LDA-q19 2 | 4 6 0 9 3 | 0.51458335 2 4 | 17.60361623 -0.82808004 5 | 4 6 | 0.44869439 2 7 | 1.71848088 1.33046245 8 | -3.43523929 9 | 0.42422013 2 10 | 0.56239978 1.17553634 11 | -2.78182671 12 | 0.48280866 1 13 | -0.62580219 14 | 0.26825995 1 15 | -22.91169709 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ce-q12.gth: -------------------------------------------------------------------------------- 1 | Ce GTH-PADE-q12 GTH-LDA-q12 2 | 4 6 1 1 3 | 0.53500000 2 4 | 18.26801534 -0.63048034 5 | 4 6 | 0.52642558 2 7 | -0.68453554 1.78656499 8 | -2.30644548 9 | 0.49085089 2 10 | -1.02722427 1.53667473 11 | -1.81821806 12 | 0.69222809 1 13 | 0.06340682 14 | 0.30390134 1 15 | -17.54564801 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Gd-q18.gth: -------------------------------------------------------------------------------- 1 | Gd GTH-PADE-q18 GTH-LDA-q18 2 | 4 6 0 8 3 | 0.51750004 2 4 | 17.51255640 -0.71953420 5 | 4 6 | 0.46201372 2 7 | 1.55185591 1.18850339 8 | -3.06870256 9 | 0.45695327 2 10 | -0.05834713 0.71741382 11 | -1.69771095 12 | 0.48236813 1 13 | -0.56260077 14 | 0.27338980 1 15 | -21.92349011 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Lu-q25.gth: -------------------------------------------------------------------------------- 1 | Lu GTH-PADE-q25 GTH-LDA-q25 2 | 4 6 1 14 3 | 0.49700000 2 4 | 17.03705292 -1.66161023 5 | 4 6 | 0.39120615 2 7 | 2.18467779 2.10393860 8 | -5.43234610 9 | 0.39389567 2 10 | -0.71981878 1.15101512 11 | -2.72379890 12 | 0.43651827 1 13 | -1.17324513 14 | 0.23262926 1 15 | -31.85226177 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Sm-q16.gth: -------------------------------------------------------------------------------- 1 | Sm GTH-PADE-q16 GTH-LDA-q16 2 | 4 6 0 6 3 | 0.52333337 2 4 | 17.20679172 -0.53280292 5 | 4 6 | 0.47967676 2 7 | 1.72363519 1.02996853 8 | -2.65936731 9 | 0.49059775 2 10 | -0.08240311 0.46948681 11 | -1.11100858 12 | 0.47084026 1 13 | -0.41063034 14 | 0.28404049 1 15 | -19.98429201 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Tm-q23.gth: -------------------------------------------------------------------------------- 1 | Tm GTH-PADE-q23 GTH-LDA-q23 2 | 4 6 0 13 3 | 0.50291669 2 4 | 17.24729254 -1.62769708 5 | 4 6 | 0.41337286 2 7 | 1.94719583 1.59627195 8 | -4.12155644 9 | 0.40992301 2 10 | -0.09449281 0.93984837 11 | -2.22408718 12 | 0.39287009 1 13 | -1.35330770 14 | 0.24391696 1 15 | -28.10415875 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Yb-q24.gth: -------------------------------------------------------------------------------- 1 | Yb GTH-PADE-q24 GTH-LDA-q24 2 | 4 6 0 14 3 | 0.50000000 2 4 | 17.35714421 -1.77391642 5 | 4 6 | 0.40230918 2 7 | 2.12077095 1.86019003 8 | -4.80298999 9 | 0.41435774 2 10 | -0.92321216 0.70931244 11 | -1.67853959 12 | 0.44402468 1 13 | -0.88996733 14 | 0.23829829 1 15 | -29.93285367 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ag-q11.gth: -------------------------------------------------------------------------------- 1 | Ag GTH-PBE-q11 2 | 1 0 10 0 3 | 0.57000000 1 4 | 0.03341912 5 | 3 6 | 0.52704461 3 7 | 9.58204535 -5.27424043 0.99704725 8 | 8.43071259 -2.57436494 9 | 2.04333882 10 | 0.62911218 2 11 | 3.87401904 -1.74211583 12 | 2.06129925 13 | 0.40538186 2 14 | -2.72495276 -0.43354851 15 | 0.49159781 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Cd-q12.gth: -------------------------------------------------------------------------------- 1 | Cd GTH-PBE-q12 2 | 2 0 10 0 3 | 0.55000000 1 4 | 3.63395858 5 | 3 6 | 0.49127900 3 7 | 10.11138228 -6.50695409 1.80457679 8 | 11.33558598 -4.65939724 9 | 3.69828191 10 | 0.59970999 2 11 | 4.00148729 -1.88393578 12 | 2.22910288 13 | 0.37787256 2 14 | -6.13703223 1.53571055 15 | -1.74133209 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/In-q13.gth: -------------------------------------------------------------------------------- 1 | In GTH-PBE-q13 2 | 2 1 10 0 3 | 0.53000000 1 4 | 3.32478546 5 | 3 6 | 0.47949521 3 7 | 11.11716024 -6.57350729 1.50686327 8 | 10.93727471 -3.89070422 9 | 3.08815074 10 | 0.56993285 2 11 | 4.70061419 -2.21706406 12 | 2.62326557 13 | 0.37706890 2 14 | -4.00228785 -0.84012846 15 | 0.95261614 16 | -------------------------------------------------------------------------------- /codes/structures/CH4.xyz: -------------------------------------------------------------------------------- 1 | 5 2 | Lattice="8.466835369021458 0.0 0.0 0.0 8.466835369021458 0.0 0.0 0.0 8.466835369021458" Properties=species:S:1:pos:R:3 =T pbc="T T T" 3 | C -0.36406500 0.05345000 0.20975000 4 | H 0.72813500 0.05346000 0.20975000 5 | H -0.72812500 -0.88696000 0.62926000 6 | H -0.72812500 0.16036000 -0.81442000 7 | H -0.72813500 0.88696000 0.81442000 8 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ag-q11.gth: -------------------------------------------------------------------------------- 1 | Ag GTH-PADE-q11 GTH-LDA-q11 2 | 1 0 10 0 3 | 0.57000000 1 4 | 1.01705324 5 | 3 6 | 0.49890039 3 7 | 2.99028401 -1.51526425 0.53817162 8 | 3.91239548 -1.38955314 9 | 2.20584723 10 | 0.63000853 2 11 | 1.81396786 -0.55123072 12 | 1.30444997 13 | 0.38765955 2 14 | -3.42007573 0.44975502 15 | -1.01994852 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Cd-q12.gth: -------------------------------------------------------------------------------- 1 | Cd GTH-PADE-q12 GTH-LDA-q12 2 | 2 0 10 0 3 | 0.55000000 1 4 | 2.38271306 5 | 3 6 | 0.49150479 3 7 | 3.20793247 -1.60378823 0.38651363 8 | 4.14096341 -0.99797390 9 | 1.58423446 10 | 0.59856481 2 11 | 1.94014994 -0.64058146 12 | 1.51589242 13 | 0.37787436 2 14 | -4.19007193 0.33960669 15 | -0.77015558 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/In-q13.gth: -------------------------------------------------------------------------------- 1 | In GTH-PADE-q13 GTH-LDA-q13 2 | 2 1 10 0 3 | 0.53000000 1 4 | 2.39540385 5 | 3 6 | 0.47408054 3 7 | 3.55441064 -1.84126870 0.38183068 8 | 4.75413535 -0.98588258 9 | 1.56504008 10 | 0.55981945 2 11 | 2.22366425 -0.86006177 12 | 2.03527762 13 | 0.36048751 2 14 | -4.56641372 0.34120718 15 | -0.77378515 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Y-q3.gth: -------------------------------------------------------------------------------- 1 | Y GTH-PADE-q3 GTH-LDA-q3 2 | 2 0 1 0 3 | 0.90000000 1 4 | -0.34389132 5 | 3 6 | 0.78245699 3 7 | 1.52065466 -0.57489340 -0.04611453 8 | 1.48436836 0.11906721 9 | -0.18901334 10 | 0.94986375 2 11 | 0.78095000 -0.15582064 12 | 0.36873894 13 | 0.65385060 2 14 | -1.25692979 0.03323415 15 | -0.07536797 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Zr-q4.gth: -------------------------------------------------------------------------------- 1 | Zr GTH-PADE-q4 GTH-LDA-q4 2 | 2 0 2 0 3 | 0.75000000 1 4 | -0.78261098 5 | 3 6 | 0.64999821 3 7 | 1.73987747 -0.92494916 0.29407499 8 | 2.38820846 -0.75929835 9 | 1.20534876 10 | 0.87440769 2 11 | 1.01829381 -0.22321509 12 | 0.52822332 13 | 0.63066761 2 14 | -1.17391057 -0.09356197 15 | 0.21217861 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Os-q16.gth: -------------------------------------------------------------------------------- 1 | Os GTH-PBE-q16 2 | 4 6 6 0 3 | 0.52000000 2 4 | 13.46303008 -2.24116983 5 | 3 6 | 0.39012207 3 7 | -3.27416829 2.36003137 3.61101851 8 | 2.82653464 -9.32360969 9 | 7.40038577 10 | 0.34945025 2 11 | -6.89928214 7.52931882 12 | -8.90881017 13 | 0.39284207 2 14 | -0.94268282 -1.08157042 15 | 1.22638558 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Re-q15.gth: -------------------------------------------------------------------------------- 1 | Re GTH-PBE-q15 2 | 4 6 5 0 3 | 0.53000000 2 4 | 13.46263143 -2.23492240 5 | 3 6 | 0.39380077 3 7 | -3.71748055 3.15477903 2.85593500 8 | 0.57237640 -7.37399245 9 | 5.85292506 10 | 0.35253332 2 11 | -7.05340425 7.56675835 12 | -8.95310922 13 | 0.40186765 2 14 | -0.90002359 -1.14917105 15 | 1.30303749 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/W-q14.gth: -------------------------------------------------------------------------------- 1 | W GTH-PBE-q14 2 | 4 6 4 0 3 | 0.54000000 2 4 | 13.41481123 -2.21345603 5 | 3 6 | 0.39702790 3 7 | -4.14121089 3.83542346 2.23317927 8 | -1.31924404 -5.76604408 9 | 4.57665561 10 | 0.35353069 2 11 | -7.45623626 8.11232637 12 | -9.59863401 13 | 0.41210703 2 14 | -0.95466075 -1.06744623 15 | 1.21037026 16 | -------------------------------------------------------------------------------- /codes/qdot_2d/test_LDA_2d.jl: -------------------------------------------------------------------------------- 1 | push!(LOAD_PATH, pwd()) 2 | 3 | using Printf 4 | using MyModule 5 | 6 | function main() 7 | rho = [1.0, 2.0, 3.0, 4.0] 8 | 9 | E_xc, V_xc = calc_E_xc_V_xc_2d(rho) 10 | println("E_xc = ", E_xc) 11 | println("V_xc = ", V_xc) 12 | 13 | E_xc = calc_E_xc_2d(rho) 14 | println("E_xc = ", E_xc) 15 | 16 | V_xc = calc_V_xc_2d(rho) 17 | println("V_xc = ", V_xc) 18 | 19 | end 20 | 21 | main() -------------------------------------------------------------------------------- /codes/structures/CH4_cell.xyz: -------------------------------------------------------------------------------- 1 | 5 2 | Lattice="8.466835369021458 0.0 0.0 0.0 8.466835369021458 0.0 0.0 0.0 8.466835369021458" Properties=species:S:1:pos:R:3 =T pbc="T T T" 3 | C 3.86935268 4.28686768 4.44316768 4 | H 4.96155268 4.28687768 4.44316768 5 | H 3.50529268 3.34645768 4.86267768 6 | H 3.50529268 4.39377768 3.41899768 7 | H 3.50528268 5.12037768 5.04783768 8 | -------------------------------------------------------------------------------- /codes/structures/SiH4.xyz: -------------------------------------------------------------------------------- 1 | 5 2 | Lattice="8.466835369021458 0.0 0.0 0.0 8.466835369021458 0.0 0.0 0.0 8.466835369021458" Properties=species:S:1:pos:R:3 =T pbc="T T T" 3 | Si -0.47333500 0.11924000 -0.22608000 4 | H 0.94666500 0.11924000 -0.22608000 5 | H -0.94666500 1.14088000 -1.09130000 6 | H -0.94666500 0.35771000 1.09130000 7 | H -0.94666500 -1.14088000 -0.67824000 8 | -------------------------------------------------------------------------------- /octopus_works/CH4/CH4.xyz: -------------------------------------------------------------------------------- 1 | 5 2 | Lattice="8.466835369021458 0.0 0.0 0.0 8.466835369021458 0.0 0.0 0.0 8.466835369021458" Properties=species:S:1:pos:R:3 =T pbc="T T T" 3 | C -0.36406500 0.05345000 0.20975000 4 | H 0.72813500 0.05346000 0.20975000 5 | H -0.72812500 -0.88696000 0.62926000 6 | H -0.72812500 0.16036000 -0.81442000 7 | H -0.72813500 0.88696000 0.81442000 8 | -------------------------------------------------------------------------------- /octopus_works/SiH4/SiH4.xyz: -------------------------------------------------------------------------------- 1 | 5 2 | Lattice="8.466835369021458 0.0 0.0 0.0 8.466835369021458 0.0 0.0 0.0 8.466835369021458" Properties=species:S:1:pos:R:3 =T pbc="T T T" 3 | Si -0.47333500 0.11924000 -0.22608000 4 | H 0.94666500 0.11924000 -0.22608000 5 | H -0.94666500 1.14088000 -1.09130000 6 | H -0.94666500 0.35771000 1.09130000 7 | H -0.94666500 -1.14088000 -0.67824000 8 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ir-q17.gth: -------------------------------------------------------------------------------- 1 | Ir GTH-PBE-q17 2 | 4 6 7 0 3 | 0.51000000 2 4 | 13.41080576 -2.34194822 5 | 3 6 | 0.38726411 3 7 | -2.51628491 1.05519006 4.67505628 8 | 6.24173509 -12.07094340 9 | 9.58101430 10 | 0.34608307 2 11 | -6.52615069 7.35318392 12 | -8.70040455 13 | 0.37881290 2 14 | -0.85595250 -1.17535111 15 | 1.33272289 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ta-q13.gth: -------------------------------------------------------------------------------- 1 | Ta GTH-PBE-q13 2 | 4 6 3 0 3 | 0.55000000 2 4 | 13.38520167 -2.25392008 5 | 3 6 | 0.40088312 3 7 | -4.43670899 4.17648934 1.87560787 8 | -2.34114813 -4.84279868 9 | 3.84385229 10 | 0.35654936 2 11 | -7.62442808 8.17895534 12 | -9.67747047 13 | 0.41822925 2 14 | -1.11356085 -0.87533080 15 | 0.99253183 16 | -------------------------------------------------------------------------------- /codes/qdot_2d/INC_qdot_2d.jl: -------------------------------------------------------------------------------- 1 | include("../FD2d/FD2dGrid.jl") 2 | include("../FD2d/build_nabla2_matrix.jl") 3 | include("../common/supporting_functions.jl") 4 | include("../common/diag_Emin_PCG.jl") 5 | include("../common/diag_davidson.jl") 6 | include("../common/diag_LOBPCG.jl") 7 | include("../common/ortho_sqrt.jl") 8 | include("../common/ortho_gram_schmidt.jl") 9 | include("../common/ILU0Preconditioner.jl") 10 | include("../common/NoPreconditioner.jl") -------------------------------------------------------------------------------- /codes/structures/SiH4_cell.xyz: -------------------------------------------------------------------------------- 1 | 5 2 | Lattice="8.466835369021458 0.0 0.0 0.0 8.466835369021458 0.0 0.0 0.0 8.466835369021458" Properties=species:S:1:pos:R:3 =T pbc="T T T" 3 | Si 3.76008268 4.35265768 4.00733768 4 | H 5.18008268 4.35265768 4.00733768 5 | H 3.28675268 5.37429768 3.14211768 6 | H 3.28675268 4.59112768 5.32471768 7 | H 3.28675268 3.09253768 3.55517768 8 | -------------------------------------------------------------------------------- /octopus_works/CH4_periodic/CH4_cell.xyz: -------------------------------------------------------------------------------- 1 | 5 2 | Lattice="8.466835369021458 0.0 0.0 0.0 8.466835369021458 0.0 0.0 0.0 8.466835369021458" Properties=species:S:1:pos:R:3 =T pbc="T T T" 3 | C 3.86935268 4.28686768 4.44316768 4 | H 4.96155268 4.28687768 4.44316768 5 | H 3.50529268 3.34645768 4.86267768 6 | H 3.50529268 4.39377768 3.41899768 7 | H 3.50528268 5.12037768 5.04783768 -------------------------------------------------------------------------------- /codes/ks_dft_02/calc_E_kin.jl: -------------------------------------------------------------------------------- 1 | function calc_E_kin( Ham, psi::Array{Float64,2} ) 2 | Nbasis = size(psi,1) 3 | Nstates = size(psi,2) 4 | E_kin = 0.0 5 | dVol = Ham.grid.dVol 6 | nabla2psi = zeros(Float64,Nbasis) 7 | Focc = Ham.electrons.Focc 8 | for ist in 1:Nstates 9 | @views Kpsi = -0.5*Ham.∇2*psi[:,ist] 10 | @views E_kin = E_kin + Focc[ist]*dot( psi[:,ist], Kpsi[:] )*dVol 11 | end 12 | return E_kin 13 | end -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/W-q14.gth: -------------------------------------------------------------------------------- 1 | W GTH-PADE-q14 GTH-LDA-q14 2 | 4 6 4 0 3 | 0.54000000 2 4 | 4.80025094 0.90154434 5 | 3 6 | 0.41856963 3 7 | 2.69220433 2.33255747 0.29723855 8 | -6.02263750 -0.76746663 9 | 1.21831550 10 | 0.44955492 2 11 | -0.70208426 1.03602407 12 | -2.45168043 13 | 0.39960167 2 14 | 1.17743638 2.44891670 15 | -5.55362106 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Hf-q12.gth: -------------------------------------------------------------------------------- 1 | Hf GTH-PBE-q12 2 | 4 6 2 0 3 | 0.56000000 2 4 | 15.52236567 -2.43356678 5 | 3 6 | 0.31182849 3 7 | -10.91013059 27.37264587 -14.96156977 8 | -59.67292892 38.63060703 9 | -30.66209376 10 | 0.36196660 2 11 | -9.65170049 9.22329739 12 | -10.91315264 13 | 0.41579070 2 14 | -2.74891464 0.48133335 15 | -0.54578072 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Hf-q12.gth: -------------------------------------------------------------------------------- 1 | Hf GTH-PADE-q12 GTH-LDA-q12 2 | 4 6 2 0 3 | 0.56000000 2 4 | 5.13480056 0.52919062 5 | 3 6 | 0.42281035 3 7 | 2.56444209 2.32910852 0.27075363 8 | -6.01373234 -0.69908286 9 | 1.10975964 10 | 0.47268130 2 11 | -1.02527490 0.79129612 12 | -1.87254839 13 | 0.42638752 2 14 | 1.45936326 2.32948018 15 | -5.28276448 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ir-q17.gth: -------------------------------------------------------------------------------- 1 | Ir GTH-PADE-q17 GTH-LDA-q17 2 | 4 6 7 0 3 | 0.51000000 2 4 | 4.90450946 1.31378645 5 | 3 6 | 0.40446887 3 7 | 3.24327835 2.83328456 0.72142882 8 | -7.31550927 -1.86272120 9 | 2.95697824 10 | 0.41142571 2 11 | -0.38057445 1.48088044 12 | -3.50440273 13 | 0.37642813 2 14 | 0.75431547 2.59088743 15 | -5.87558042 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Os-q16.gth: -------------------------------------------------------------------------------- 1 | Os GTH-PADE-q16 GTH-LDA-q16 2 | 4 6 6 0 3 | 0.52000000 2 4 | 5.61307299 0.92195476 5 | 3 6 | 0.41057830 3 7 | 2.78575826 2.59185074 0.54822025 8 | -6.69212983 -1.41549860 9 | 2.24703437 10 | 0.42239546 2 11 | -0.59000550 1.27547446 12 | -3.01832347 13 | 0.38025200 2 14 | 0.88013282 2.52796761 15 | -5.73289168 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Pt-q18.gth: -------------------------------------------------------------------------------- 1 | Pt GTH-PADE-q18 GTH-LDA-q18 2 | 3 6 9 0 3 | 0.50000000 2 4 | 5.44583159 1.15638204 5 | 3 6 | 0.40994150 3 7 | 2.99436565 2.88489700 1.03520925 8 | -7.44877202 -2.67289879 9 | 4.24309529 10 | 0.39865199 2 11 | -0.22518140 1.59606293 12 | -3.77697426 13 | 0.36796397 2 14 | 0.63206655 2.53790667 15 | -5.75543134 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Re-q15.gth: -------------------------------------------------------------------------------- 1 | Re GTH-PADE-q15 GTH-LDA-q15 2 | 4 6 5 0 3 | 0.53000000 2 4 | 5.59266028 0.94395680 5 | 3 6 | 0.40325199 3 7 | 2.76072043 2.47732079 0.21194880 8 | -6.39641476 -0.54724946 9 | 0.86873158 10 | 0.44095069 2 11 | -0.90054631 1.06118049 12 | -2.51121137 13 | 0.39039544 2 14 | 0.87525142 2.50135628 15 | -5.67254285 16 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Ta-q13.gth: -------------------------------------------------------------------------------- 1 | Ta GTH-PADE-q13 GTH-LDA-q13 2 | 4 6 3 0 3 | 0.55000000 2 4 | 4.54623627 0.77942234 5 | 3 6 | 0.42185350 3 7 | 2.70813558 2.24282880 0.23120613 8 | -5.79095906 -0.59697167 9 | 0.94766314 10 | 0.46134516 2 11 | -0.72485277 0.93609767 12 | -2.21521141 13 | 0.41099434 2 14 | 1.34849472 2.37542018 15 | -5.38694662 16 | -------------------------------------------------------------------------------- /codes/LF1d/build_D2_matrix_LF1d_sinc.jl: -------------------------------------------------------------------------------- 1 | function build_D2_matrix_LF1d_sinc( x::Array{Float64,1}, h::Float64, N::Int64 ) 2 | D2 = zeros(Float64,N,N) 3 | # Diagonal part 4 | for i in 1:N 5 | D2[i,i] = -pi^2 / 3.0 / h^2 6 | end 7 | # Off-diagonal 8 | for j in 1:N 9 | for i in j+1:N 10 | D2[i,j] = -2.0*(-1.0)^(i-j)/( x[i] - x[j] )^2 11 | D2[j,i] = D2[i,j] 12 | end 13 | end 14 | return D2 15 | end -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/La-q11.gth: -------------------------------------------------------------------------------- 1 | La GTH-PADE-q11 GTH-LDA-q11 2 | 4 6 1 0 3 | 0.53500000 2 4 | 19.90930823 -1.47483023 5 | 4 6 | 0.55177542 2 7 | 1.29327192 0.43447877 8 | -1.12181937 9 | 0.47630806 3 10 | 1.17252682 0.35023609 0.00887640 11 | -0.82880986 -0.02100539 12 | 0.02985728 13 | 0.62667220 1 14 | 0.32837704 15 | 0.29931017 1 16 | -18.26943896 17 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Ce-q30.gth: -------------------------------------------------------------------------------- 1 | Ce GTH-PBE-q30 2 | 6 12 11 1 3 | 0.20000000 2 4 | 148.23700910 3.91725495 5 | 4 6 | 0.24060899 2 7 | 2.21770923 4.21351645 8 | -5.43962635 9 | 0.16613857 3 10 | -4.53697472 11.78843522 0.01475880 11 | -13.92369350 -0.03492570 12 | 0.02482188 13 | 0.17161109 1 14 | -15.00199037 15 | 0.26526997 1 16 | -4.75946878 17 | -------------------------------------------------------------------------------- /codes/ks_dft_03/calc_E_kin.jl: -------------------------------------------------------------------------------- 1 | function calc_E_kin( Ham, psi::Array{Float64,2} ) 2 | Nbasis = size(psi,1) 3 | Nstates = size(psi,2) 4 | E_kin = 0.0 5 | dVol = Ham.grid.dVol 6 | nabla2psi = zeros(Float64,Nbasis) 7 | Focc = Ham.electrons.Focc 8 | for ist in 1:Nstates 9 | @views nabla2psi = -0.5*Ham.Laplacian*psi[:,ist] 10 | @views E_kin = E_kin + Focc[ist]*dot( psi[:,ist], nabla2psi[:] )*dVol 11 | end 12 | return E_kin 13 | end -------------------------------------------------------------------------------- /codes/pseudopotentials/pade_gth/Au-q19.gth: -------------------------------------------------------------------------------- 1 | Au GTH-PADE-q19 GTH-LDA-q19 2 | 3 6 10 0 3 | 0.49000000 2 4 | 9.07322639 -0.34013367 5 | 3 6 | 0.28803780 3 7 | -5.90182040 26.42537412 -15.50837777 8 | -59.33938963 40.04245923 9 | -31.78271670 10 | 0.35586747 2 11 | -7.08858659 8.19796427 12 | -9.69996213 13 | 0.33386175 2 14 | -8.82572349 9.56535285 15 | -10.84609065 16 | -------------------------------------------------------------------------------- /codes/Project.toml: -------------------------------------------------------------------------------- 1 | [deps] 2 | AlgebraicMultigrid = "2169fc97-5a83-5252-b627-83903c6c433c" 3 | FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" 4 | IncompleteLU = "40713840-3770-5561-ab4c-a76e7d0d7895" 5 | LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" 6 | NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56" 7 | PGFPlotsX = "8314cec4-20b6-5062-9cdb-752b83310925" 8 | PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee" 9 | SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" 10 | -------------------------------------------------------------------------------- /codes/ks_dft_04/calc_E_kin.jl: -------------------------------------------------------------------------------- 1 | function calc_E_kin( Ham, psi::Array{Float64,2} ) 2 | Nbasis = size(psi,1) 3 | Nstates = size(psi,2) 4 | E_kin = 0.0 5 | dVol = Ham.grid.dVol 6 | nabla2psi = zeros(Float64,Nbasis) 7 | Focc = Ham.electrons.Focc 8 | for ist in 1:Nstates 9 | @views nabla2psi = -0.5*Ham.Laplacian*psi[:,ist] 10 | @views E_kin = E_kin + Focc[ist]*dot( psi[:,ist], nabla2psi[:] )*dVol 11 | end 12 | return E_kin 13 | end 14 | -------------------------------------------------------------------------------- /codes/xc_works/LDA_notes.md: -------------------------------------------------------------------------------- 1 | Uniform electron gas: 2 | $$ 3 | \rho = \frac{N_e}{\Omega} 4 | $$ 5 | radius $r_s$: 6 | $$ 7 | \frac{4\pi}{3}r_s^{3} = \frac{\Omega}{N_e} = \frac{1}{\rho} 8 | $$ 9 | 10 | $$ 11 | r_s = \left( \frac{3}{4\pi \rho} \right)^{1/3} 12 | $$ 13 | 14 | Exchange energy per electron: 15 | $$ 16 | \epsilon_{x}^{\sigma} = \frac{E_{x}^{\sigma}}{N^{\sigma}} = 17 | -\frac{3}{4\pi}k^{\sigma}_{F} = 18 | -\frac{3}{4}\left( \frac{6}{\pi} \rho^{\sigma} \right)^{1/3} 19 | $$ 20 | -------------------------------------------------------------------------------- /octopus_works/3d_harm_HF/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 0 5 | 6 | TheoryLevel = hartree_fock 7 | 8 | BoxShape = parallelepiped 9 | %Lsize 10 | 3 | 3 | 3 11 | % 12 | 13 | spacing = 0.25 14 | 15 | PoissonSolver = cg 16 | FilterPotentials = filter_none 17 | 18 | % Species 19 | 'HO' | species_user_defined | potential_formula | "2.0*(x^2 + y^2 + z^2)" | valence | 8 20 | % 21 | 22 | % Coordinates 23 | "HO" | 0 | 0 | 0 24 | % 25 | 26 | 27 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Au-q19.gth: -------------------------------------------------------------------------------- 1 | Au GTH-PBE-q19 2 | 3 6 10 0 3 | 0.49000000 1 4 | 8.36945885 5 | 3 6 | 0.29008402 3 7 | -5.98869002 26.10502137 -15.17621948 8 | -58.38556050 39.18483021 9 | -31.10199477 10 | 0.36150576 3 11 | -5.87695332 4.73144606 2.92710526 12 | -0.72513863 -6.92679530 13 | 4.92291022 14 | 0.34037313 2 15 | -8.80458432 9.49191532 16 | -10.76282032 17 | -------------------------------------------------------------------------------- /octopus_works/3d_harm_hartree/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 0 5 | 6 | TheoryLevel = kohn_sham 7 | XCFunctional = none 8 | 9 | BoxShape = parallelepiped 10 | %Lsize 11 | 3 | 3 | 3 12 | % 13 | 14 | spacing = 0.25 15 | 16 | FilterPotentials = filter_none 17 | 18 | % Species 19 | 'HO' | species_user_defined | potential_formula | "2.0*(x^2 + y^2 + z^2)" | valence | 8 20 | % 21 | 22 | % Coordinates 23 | "HO" | 0 | 0 | 0 24 | % 25 | 26 | 27 | -------------------------------------------------------------------------------- /octopus_works/Ar_atom/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 0 5 | 6 | TheoryLevel = kohn_sham 7 | XCFunctional = lda_x + lda_c_vwn_1 8 | 9 | BoxShape = parallelepiped 10 | %Lsize 11 | 8 | 8 | 8 12 | % 13 | 14 | spacing = 0.4 15 | 16 | MixField = density 17 | MixingScheme = Linear 18 | Mixing = 0.5 19 | 20 | FilterPotentials = filter_none 21 | 22 | UnitsXYZFiles = angstrom_units 23 | XYZCoordinates = "Ar.xyz" 24 | 25 | PseudopotentialSet = hgh_lda 26 | -------------------------------------------------------------------------------- /octopus_works/CH4/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 0 5 | 6 | TheoryLevel = kohn_sham 7 | XCFunctional = lda_x + lda_c_vwn_1 8 | 9 | BoxShape = parallelepiped 10 | %Lsize 11 | 8 | 8 | 8 12 | % 13 | 14 | spacing = 0.40 15 | 16 | MixField = density 17 | MixingScheme = Linear 18 | Mixing = 0.5 19 | 20 | FilterPotentials = filter_none 21 | 22 | UnitsXYZFiles = angstrom_units 23 | XYZCoordinates = "CH4.xyz" 24 | 25 | PseudopotentialSet = hgh_lda 26 | -------------------------------------------------------------------------------- /octopus_works/H2O/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 0 5 | 6 | TheoryLevel = kohn_sham 7 | XCFunctional = lda_x + lda_c_vwn_1 8 | 9 | BoxShape = parallelepiped 10 | %Lsize 11 | 8 | 8 | 8 12 | % 13 | 14 | spacing = 0.25 15 | 16 | MixField = density 17 | MixingScheme = Linear 18 | Mixing = 0.5 19 | 20 | FilterPotentials = filter_none 21 | 22 | UnitsXYZFiles = angstrom_units 23 | XYZCoordinates = "H2O.xyz" 24 | 25 | PseudopotentialSet = hgh_lda 26 | -------------------------------------------------------------------------------- /codes/FD1d/build_D1_matrix_5pt.jl: -------------------------------------------------------------------------------- 1 | """ 2 | f_x = (1*f[i-2] - 8*f[i-1] + 8*f[i+1] - 1*f[i+2])/(12*h**1) 3 | """ 4 | function build_D1_matrix_5pt( N::Int64, h::Float64 ) 5 | mat = zeros(Float64,N,N) 6 | for i = 1:N-2 7 | # 8 | mat[i,i+1] = 8.0 9 | mat[i,i+2] = -1.0 10 | # 11 | mat[i+1,i] = -8.0 12 | mat[i+2,i] = 1.0 13 | end 14 | 15 | mat[N, N-1] = -8.0 16 | mat[N-1,N ] = 8.0 17 | 18 | return mat/(12*h) 19 | 20 | end -------------------------------------------------------------------------------- /codes/KSDFT1d/emin_smearing/setup_path.jl: -------------------------------------------------------------------------------- 1 | push!(LOAD_PATH, "../") 2 | 3 | using Revise, Infiltrator 4 | import Random 5 | using Printf 6 | using LinearAlgebra 7 | using Serialization 8 | using KSDFT1d 9 | 10 | includet("system_defs_01.jl") 11 | includet("system_defs_02.jl") 12 | includet("system_defs_03.jl") 13 | includet("Lfunc.jl") 14 | includet("../utilities.jl") 15 | includet("gradients_psi_Haux.jl") 16 | includet("linmin_quad_new_v01.jl") 17 | includet("../BroydenMixer.jl") 18 | 19 | 20 | -------------------------------------------------------------------------------- /octopus_works/3d_harm/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 0 5 | 6 | TheoryLevel = kohn_sham 7 | XCFunctional = lda_x + lda_c_vwn_1 8 | 9 | BoxShape = parallelepiped 10 | %Lsize 11 | 3 | 3 | 3 12 | % 13 | 14 | spacing = 0.25 15 | 16 | FilterPotentials = filter_none 17 | 18 | % Species 19 | 'HO' | species_user_defined | potential_formula | "2.0*(x^2 + y^2 + z^2)" | valence | 8 20 | % 21 | 22 | % Coordinates 23 | "HO" | 0 | 0 | 0 24 | % 25 | 26 | 27 | -------------------------------------------------------------------------------- /codes/pseudopotentials/pbe_gth/Pt-q18.gth: -------------------------------------------------------------------------------- 1 | Pt GTH-PBE-q18 2 | 3 6 9 0 3 | 0.50000000 2 4 | 8.81432324 -0.29250943 5 | 3 6 | 0.29800221 3 7 | -5.96838498 24.21289966 -13.78967932 8 | -53.68763413 35.60479890 9 | -28.26043301 10 | 0.36017182 3 11 | -6.66865904 7.17065922 0.76690370 12 | -7.20766072 -1.81482538 13 | 1.28980604 14 | 0.34053206 2 15 | -8.58990455 9.41012200 16 | -10.67007542 17 | -------------------------------------------------------------------------------- /octopus_works/H_atom_periodic/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 3 5 | 6 | TheoryLevel = kohn_sham 7 | XCFunctional = lda_x + lda_c_vwn_1 8 | 9 | BoxShape = parallelepiped 10 | %Lsize 11 | 8 | 8 | 8 12 | % 13 | 14 | spacing = 0.4 15 | 16 | MixField = density 17 | MixingScheme = Linear 18 | Mixing = 0.5 19 | 20 | FilterPotentials = filter_none 21 | 22 | UnitsXYZFiles = angstrom_units 23 | XYZCoordinates = "H.xyz" 24 | 25 | PseudopotentialSet = hgh_lda 26 | -------------------------------------------------------------------------------- /octopus_works/LiH_periodic/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 3 5 | 6 | TheoryLevel = kohn_sham 7 | XCFunctional = lda_x + lda_c_vwn_1 8 | 9 | BoxShape = parallelepiped 10 | %Lsize 11 | 8 | 8 | 8 12 | % 13 | 14 | spacing = 0.40 15 | 16 | MixField = density 17 | MixingScheme = Linear 18 | Mixing = 0.5 19 | 20 | FilterPotentials = filter_none 21 | 22 | UnitsXYZFiles = angstrom_units 23 | XYZCoordinates = "LiH.xyz" 24 | 25 | PseudopotentialSet = hgh_lda 26 | -------------------------------------------------------------------------------- /codes/sparse/test_02.jl: -------------------------------------------------------------------------------- 1 | using SparseArrays 2 | 3 | include("../FD1d/build_D2_matrix_3pt.jl") 4 | 5 | function test_D2_3pt() 6 | 7 | D2 = build_D2_matrix_3pt(5, 1.0) 8 | display(D2); println() 9 | 10 | println("size = ", Base.summarysize(D2)) 11 | 12 | D2_sp = sparse(D2) 13 | println("size = ", Base.summarysize(D2_sp)) 14 | 15 | println("nzval = ", D2_sp.nzval) 16 | println("rowval = ", D2_sp.rowval) 17 | println("colptr = ", D2_sp.colptr) 18 | end 19 | 20 | test_D2_3pt() -------------------------------------------------------------------------------- /octopus_works/CH4_periodic/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 3 5 | 6 | TheoryLevel = kohn_sham 7 | XCFunctional = lda_x + lda_c_vwn_1 8 | 9 | BoxShape = parallelepiped 10 | %Lsize 11 | 8 | 8 | 8 12 | % 13 | 14 | spacing = 0.40 15 | 16 | MixField = density 17 | MixingScheme = Linear 18 | Mixing = 0.5 19 | 20 | FilterPotentials = filter_none 21 | 22 | UnitsXYZFiles = angstrom_units 23 | XYZCoordinates = "CH4_cell.xyz" 24 | 25 | PseudopotentialSet = hgh_lda 26 | -------------------------------------------------------------------------------- /codes/common/ortho_sqrt.jl: -------------------------------------------------------------------------------- 1 | function ortho_sqrt( psi ) 2 | Udagger = inv(sqrt(psi'*psi)) 3 | return psi*Udagger 4 | end 5 | 6 | function ortho_sqrt!( psi ) 7 | Udagger = inv(sqrt(psi'*psi)) 8 | @views psi[:,:] = psi[:,:]*Udagger 9 | end 10 | 11 | function ortho_sqrt( psi, dVol ) 12 | Udagger = inv(sqrt(psi'*psi*dVol)) 13 | return psi*Udagger 14 | end 15 | 16 | function ortho_sqrt!( psi, dVol ) 17 | Udagger = inv(sqrt(psi'*psi*dVol)) 18 | @views psi[:,:] = psi[:,:]*Udagger 19 | end -------------------------------------------------------------------------------- /octopus_works/HCl/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 0 5 | 6 | TheoryLevel = kohn_sham 7 | XCFunctional = lda_x + lda_c_vwn_1 8 | 9 | BoxShape = parallelepiped 10 | %Lsize 11 | 8 | 8 | 8 12 | % 13 | 14 | spacing = 0.40 15 | 16 | MixField = density 17 | MixingScheme = Linear 18 | Mixing = 0.5 19 | 20 | PoissonSolver = cg 21 | FilterPotentials = filter_none 22 | 23 | UnitsXYZFiles = angstrom_units 24 | XYZCoordinates = "HCl.xyz" 25 | 26 | PseudopotentialSet = hgh_lda 27 | -------------------------------------------------------------------------------- /octopus_works/H_atom/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 0 5 | 6 | TheoryLevel = kohn_sham 7 | XCFunctional = lda_x + lda_c_vwn_1 8 | #XCFunctional = none 9 | 10 | BoxShape = parallelepiped 11 | %Lsize 12 | 8 | 8 | 8 13 | % 14 | 15 | spacing = 0.4 16 | 17 | MixField = density 18 | MixingScheme = Linear 19 | Mixing = 0.5 20 | 21 | FilterPotentials = filter_none 22 | 23 | UnitsXYZFiles = angstrom_units 24 | XYZCoordinates = "H.xyz" 25 | 26 | PseudopotentialSet = hgh_lda 27 | -------------------------------------------------------------------------------- /octopus_works/LiH/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 0 5 | 6 | TheoryLevel = kohn_sham 7 | XCFunctional = lda_x + lda_c_vwn_1 8 | 9 | BoxShape = parallelepiped 10 | %Lsize 11 | 8 | 8 | 8 12 | % 13 | 14 | spacing = 0.40 15 | 16 | MixField = density 17 | MixingScheme = Linear 18 | Mixing = 0.5 19 | 20 | PoissonSolver = cg 21 | FilterPotentials = filter_none 22 | 23 | UnitsXYZFiles = angstrom_units 24 | XYZCoordinates = "LiH.xyz" 25 | 26 | PseudopotentialSet = hgh_lda 27 | -------------------------------------------------------------------------------- /octopus_works/NH3/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 0 5 | 6 | TheoryLevel = kohn_sham 7 | XCFunctional = lda_x + lda_c_vwn_1 8 | 9 | BoxShape = parallelepiped 10 | %Lsize 11 | 8 | 8 | 8 12 | % 13 | 14 | spacing = 0.20 15 | 16 | MixField = density 17 | MixingScheme = Linear 18 | Mixing = 0.5 19 | 20 | PoissonSolver = cg 21 | FilterPotentials = filter_none 22 | 23 | UnitsXYZFiles = angstrom_units 24 | XYZCoordinates = "NH3.xyz" 25 | 26 | PseudopotentialSet = hgh_lda 27 | -------------------------------------------------------------------------------- /octopus_works/SiH4/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 0 5 | 6 | TheoryLevel = kohn_sham 7 | XCFunctional = lda_x + lda_c_vwn_1 8 | 9 | BoxShape = parallelepiped 10 | %Lsize 11 | 8 | 8 | 8 12 | % 13 | 14 | spacing = 0.40 15 | 16 | MixField = density 17 | MixingScheme = Linear 18 | Mixing = 0.5 19 | 20 | PoissonSolver = cg 21 | FilterPotentials = filter_none 22 | 23 | UnitsXYZFiles = angstrom_units 24 | XYZCoordinates = "SiH4.xyz" 25 | 26 | PseudopotentialSet = hgh_lda 27 | -------------------------------------------------------------------------------- /codes/common/XC_funcs/XC_x_slater_spin_E.jl: -------------------------------------------------------------------------------- 1 | # energy (epsxc) only version 2 | function XC_x_slater_spin_E( rho, zeta ) 3 | 4 | f = -1.10783814957303361 # f = -9/8*(3/pi)^(1/3) 5 | alpha = 2.0/3.0 6 | third = 1.0/3.0 7 | p43 = 4.0/3.0 8 | 9 | rho13 = ( (1.0 + zeta) * rho)^third 10 | exup = f * alpha * rho13 11 | 12 | rho13 = ( (1.0 - zeta) * rho)^third 13 | exdw = f * alpha * rho13 14 | 15 | ex = 0.5 * ( (1.0 + zeta) * exup + (1.0 - zeta) * exdw) 16 | 17 | return ex 18 | end -------------------------------------------------------------------------------- /octopus_works/Ne_atom_periodic/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 3 5 | 6 | TheoryLevel = kohn_sham 7 | XCFunctional = lda_x + lda_c_vwn_1 8 | 9 | BoxShape = parallelepiped 10 | %Lsize 11 | 8 | 8 | 8 12 | % 13 | 14 | spacing = 0.26666666666666667 15 | 16 | MixField = density 17 | MixingScheme = Linear 18 | Mixing = 0.5 19 | 20 | # FilterPotentials = filter_none 21 | 22 | UnitsXYZFiles = angstrom_units 23 | XYZCoordinates = "Ne.xyz" 24 | 25 | PseudopotentialSet = hgh_lda 26 | -------------------------------------------------------------------------------- /codes/FD1d/build_D2_matrix_3pt.jl: -------------------------------------------------------------------------------- 1 | """ 2 | Build second derivative matrix using 3-points centered 3 | finite difference approximation. 4 | 5 | # Arguments 6 | - `N::Int64`: number of grid points 7 | - `h::Float64`: spacing between grid points 8 | """ 9 | function build_D2_matrix_3pt( N::Int64, h::Float64 ) 10 | mat = zeros(Float64,N,N) 11 | for i = 1:N-1 12 | mat[i,i] = -2.0 13 | mat[i,i+1] = 1.0 14 | mat[i+1,i] = 1.0 15 | end 16 | mat[N,N] = -2.0 17 | return mat/h^2 18 | end 19 | 20 | -------------------------------------------------------------------------------- /codes_old/1d/build_D2_matrix_3pt.jl: -------------------------------------------------------------------------------- 1 | """ 2 | Build second derivative matrix using 3-points centered 3 | finite difference approximation. 4 | 5 | # Arguments 6 | - `N::Int64`: number of grid points 7 | - `h::Float64`: spacing between grid points 8 | """ 9 | function build_D2_matrix_3pt( N::Int64, h::Float64 ) 10 | mat = zeros(Float64,N,N) 11 | for i = 1:N-1 12 | mat[i,i] = -2.0 13 | mat[i,i+1] = 1.0 14 | mat[i+1,i] = mat[i,i+1] 15 | end 16 | mat[N,N] = -2.0 17 | return mat/h^2 18 | end 19 | 20 | -------------------------------------------------------------------------------- /codes/common/supporting_functions.jl: -------------------------------------------------------------------------------- 1 | speye(N::Int64) = sparse( Matrix(1.0I, N, N) ) 2 | 3 | """ 4 | meshgrid(vx,vy) 5 | Computes an (x,y)-grid from the vectors (vx,vy). 6 | For more information, see the MATLAB documentation. 7 | 8 | From: https://github.com/ChrisRackauckas/VectorizedRoutines.jl 9 | """ 10 | function meshgrid(vx::AbstractVector{T}, vy::AbstractVector{T}) where {T} 11 | m, n = length(vy), length(vx) 12 | vx = reshape(vx, 1, n) 13 | vy = reshape(vy, m, 1) 14 | return (repeat(vx, m, 1), repeat(vy, 1, n)) 15 | end -------------------------------------------------------------------------------- /codes_old/supporting_functions.jl: -------------------------------------------------------------------------------- 1 | speye(N::Int64) = sparse( Matrix(1.0I, N, N) ) 2 | 3 | """ 4 | meshgrid(vx,vy) 5 | Computes an (x,y)-grid from the vectors (vx,vy). 6 | For more information, see the MATLAB documentation. 7 | 8 | From: https://github.com/ChrisRackauckas/VectorizedRoutines.jl 9 | """ 10 | function meshgrid(vx::AbstractVector{T}, vy::AbstractVector{T}) where {T} 11 | m, n = length(vy), length(vx) 12 | vx = reshape(vx, 1, n) 13 | vy = reshape(vy, m, 1) 14 | return (repeat(vx, m, 1), repeat(vy, 1, n)) 15 | end -------------------------------------------------------------------------------- /octopus_works/H2/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 0 5 | 6 | TheoryLevel = kohn_sham 7 | XCFunctional = lda_x + lda_c_vwn_1 8 | #XCFunctional = none 9 | 10 | BoxShape = parallelepiped 11 | %Lsize 12 | 8 | 8 | 8 13 | % 14 | 15 | spacing = 0.4 16 | 17 | # MixField = density 18 | # MixingScheme = Linear 19 | # Mixing = 0.5 20 | 21 | FilterPotentials = filter_none 22 | 23 | PseudopotentialSet = hgh_lda 24 | 25 | % Coordinates 26 | "H" | -0.75 | 0.0 | 0.0 27 | "H" | 0.75 | 0.0 | 0.0 28 | % 29 | -------------------------------------------------------------------------------- /codes_old/2d/build_nabla2_matrix.jl: -------------------------------------------------------------------------------- 1 | include("../1d/build_D2_matrix_3pt.jl") 2 | include("../1d/build_D2_matrix_5pt.jl") 3 | include("../1d/build_D2_matrix_7pt.jl") 4 | include("../1d/build_D2_matrix_9pt.jl") 5 | 6 | function build_nabla2_matrix( fdgrid::FD2dGrid; func_1d=build_D2_matrix_3pt ) 7 | Nx = fdgrid.Nx 8 | hx = fdgrid.hx 9 | Ny = fdgrid.Ny 10 | hy = fdgrid.hy 11 | 12 | D2x = func_1d(Nx, hx) 13 | D2y = func_1d(Ny, hy) 14 | 15 | ∇2 = kron(D2x, speye(Ny)) + kron(speye(Nx), D2y) 16 | return ∇2 17 | end -------------------------------------------------------------------------------- /codes/ks_dft_02/test_norm_betaNL.jl: -------------------------------------------------------------------------------- 1 | push!(LOAD_PATH, pwd()) 2 | 3 | using Printf 4 | using Random 5 | using LinearAlgebra 6 | using SpecialFunctions 7 | 8 | using KSDFT02Module 9 | 10 | const DIR_PSP = "../pseudopotentials/pade_gth/" 11 | const DIR_STRUCTURES = "../structures" 12 | 13 | include("create_Ham.jl") 14 | 15 | function main( create_Ham_func; N=41) 16 | Ham = create_Ham_func(N) 17 | check_betaNL_norm(Ham.grid, Ham.pspotNL) 18 | end 19 | 20 | for N in range(21,stop=61,step=10) 21 | main(create_Ham_CH4, N=N) 22 | end 23 | -------------------------------------------------------------------------------- /codes_old/3d/visualize_wavefunc.jl: -------------------------------------------------------------------------------- 1 | using Printf 2 | using LinearAlgebra 3 | using Serialization 4 | 5 | mutable struct Atoms 6 | end 7 | 8 | include("../XSF_utils.jl") 9 | 10 | function main() 11 | 12 | psi = deserialize("wavefunc.data") 13 | 14 | LL = [10.0 0.0 0.0; 0.0 10.0 0.0; 0.0 0.0 10.0] 15 | Ns = (50, 50, 50) 16 | 17 | for i in 1:10 18 | filnam = "wavefunc_"*string(i)*".xsf" 19 | write_xsf(filnam, LL) 20 | write_xsf_data3d_crystal(filnam, Ns, LL, psi[:,i]) 21 | end 22 | 23 | end 24 | 25 | main() -------------------------------------------------------------------------------- /codes/poisson_3d/test_GVectors.jl: -------------------------------------------------------------------------------- 1 | using Printf 2 | using LinearAlgebra 3 | using SparseArrays 4 | using IncompleteLU 5 | using AlgebraicMultigrid 6 | using FFTW 7 | 8 | include("INC_poisson_3d.jl") 9 | include("../common/GVectors.jl") 10 | include("Poisson_solve_fft.jl") 11 | 12 | function test_main( NN::Array{Int64} ) 13 | AA = [-8.0, -8.0, -8.0] 14 | BB = [ 8.0, 8.0, 8.0] 15 | grid = FD3dGrid( NN, AA, BB, pbc=(true,true,true) ) 16 | println(grid) 17 | gvec = GVectors(grid) 18 | println(gvec) 19 | end 20 | 21 | test_main([14,14,14]) -------------------------------------------------------------------------------- /book/acknowledgement.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%acknow.tex%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | % sample acknowledgement chapter 3 | % 4 | % Use this file as a template for your own input. 5 | % 6 | %%%%%%%%%%%%%%%%%%%%%%%% Springer %%%%%%%%%%%%%%%%%%%%%%%%%% 7 | 8 | \extrachap{Acknowledgements} 9 | 10 | Use the template \emph{acknow.tex} together with the document class SVMono (monograph-type books) or SVMult (edited books) if you prefer to set your acknowledgement section as a separate chapter instead of including it as last part of your preface. 11 | 12 | -------------------------------------------------------------------------------- /codes/ks_dft_04/mix_linear.jl: -------------------------------------------------------------------------------- 1 | mutable struct LinearMixer 2 | betamix::Float64 3 | iter::Int64 # needed for compatibility with other mixer 4 | end 5 | 6 | function LinearMixer(betamix) 7 | return LinearMixer(betamix, 0) 8 | end 9 | 10 | function do_mix!(mixer::LinearMixer, x, x_new) 11 | mix_linear!(x, x_new, mixer.betamix) 12 | return 13 | end 14 | 15 | function mix_linear!(x, x_new, betamix::Float64) 16 | Npts = length(x) 17 | for i in 1:Npts 18 | x[i] = betamix*x_new[i] + (1-betamix)*x[i] 19 | end 20 | return 21 | end -------------------------------------------------------------------------------- /codes/ks_dft_1d/main_gaussian_integ_01.jl: -------------------------------------------------------------------------------- 1 | using Printf 2 | 3 | include("INC_sch_1d.jl") 4 | 5 | function my_gaussian(x; α=1.0) 6 | return exp(-α*x^2) 7 | end 8 | 9 | function do_integrate(N::Int64) 10 | A = -5.0 11 | B = 5.0 12 | α = 1.0 13 | xgrid, dx = init_FD1d_grid( A, B, N ) 14 | fx = my_gaussian.(xgrid, α=α) 15 | exact_res = sqrt(π)/sqrt(α) 16 | num_res = sum(fx)*dx 17 | @printf("%5d %18.10f %10.5e\n", N, num_res, abs(exact_res - num_res)) 18 | end 19 | 20 | for N in [10, 20, 30, 40, 50] 21 | do_integrate(N) 22 | end 23 | -------------------------------------------------------------------------------- /octopus_works/Ne_atom/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 0 5 | 6 | TheoryLevel = kohn_sham 7 | XCFunctional = lda_x + lda_c_vwn_1 8 | 9 | BoxShape = parallelepiped 10 | %Lsize 11 | 8 | 8 | 8 12 | % 13 | 14 | spacing = 0.4 15 | 16 | MixField = density 17 | MixingScheme = Linear 18 | Mixing = 0.5 19 | 20 | PoissonSolver = cg_corrected 21 | PoissonSolverMaxMultipole = 4 # default 22 | FilterPotentials = filter_none 23 | 24 | UnitsXYZFiles = angstrom_units 25 | XYZCoordinates = "Ne.xyz" 26 | 27 | PseudopotentialSet = hgh_lda 28 | -------------------------------------------------------------------------------- /codes/KSDFT1d/tests/test_Atoms1d.jl: -------------------------------------------------------------------------------- 1 | push!(LOAD_PATH, "../") 2 | 3 | using Printf 4 | using KSDFT1d 5 | 6 | function main() 7 | Natoms = 8 8 | σ = ones(Float64, Natoms)*(1.0) 9 | masses = ones(Float64, Natoms)*42000.0 10 | Zvals = ones(Float64, Natoms)*2 11 | L = 80.0 12 | dx = 0.5 13 | atpos = zeros(Float64, Natoms) 14 | for ia in 1:Natoms 15 | atpos[ia] = (ia - 0.5)*L/Natoms + dx 16 | @printf("%3d %18.10f\n", ia, atpos[ia]) 17 | end 18 | 19 | atoms = Atoms1d( atpos, Zvals, σ, masses, L ) 20 | end 21 | 22 | main() -------------------------------------------------------------------------------- /codes/modelscf1d/test_Atoms1d.jl: -------------------------------------------------------------------------------- 1 | push!(LOAD_PATH, "./") 2 | 3 | using Printf 4 | using ModelSCF1d 5 | 6 | function main() 7 | Natoms = 8 8 | σ = ones(Float64, Natoms)*(1.0) 9 | masses = ones(Float64, Natoms)*42000.0 10 | Zvals = ones(Float64, Natoms)*2 11 | L = 80.0 12 | dx = 0.5 13 | atpos = zeros(Float64, Natoms) 14 | for ia in 1:Natoms 15 | atpos[ia] = (ia - 0.5)*L/Natoms + dx 16 | @printf("%3d %18.10f\n", ia, atpos[ia]) 17 | end 18 | 19 | atoms = Atoms1d( atpos, Zvals, σ, masses, L ) 20 | end 21 | 22 | main() -------------------------------------------------------------------------------- /codes/modelscf1d/ModelSCF1d.jl: -------------------------------------------------------------------------------- 1 | module ModelSCF1d 2 | 3 | using Printf 4 | using LinearAlgebra 5 | using FFTW 6 | 7 | include("Atoms1d.jl") 8 | export Atoms1d 9 | 10 | include("GVectors1d.jl") 11 | export GVectors1d 12 | 13 | include("Electrons.jl") 14 | export Electrons 15 | 16 | include("smearing.jl") 17 | export smear_fermi, smear_fermi_entropy 18 | 19 | include("occupations.jl") 20 | export update_Focc! 21 | 22 | include("Hamiltonian1d.jl") 23 | export Hamiltonian1d, get_matrix 24 | 25 | include("PoissonYukawa1d_solve.jl") 26 | export PoissonYukawa1d_solve! 27 | 28 | end 29 | -------------------------------------------------------------------------------- /codes/KSDFT1d/Poisson_solve_sum.jl: -------------------------------------------------------------------------------- 1 | # a is in bohr, softening parameter of soft Coulomb potential 2 | function Poisson_solve_sum!( grid, 3 | rho::Vector{Float64}, V::Vector{Float64}; a = 1.0 4 | ) 5 | xgrid = grid.x 6 | hx = grid.hx 7 | Npoints = size(rho,1) 8 | fill!(V, 0.0) 9 | for ip in 1:Npoints 10 | xi = xgrid[ip] 11 | for jp in 1:Npoints 12 | xj = xgrid[jp] 13 | dr = sqrt( (xi - xj)^2 + a^2 ) 14 | V[ip] += rho[jp]/dr 15 | end 16 | V[ip] = V[ip]*hx 17 | end 18 | return 19 | end 20 | 21 | -------------------------------------------------------------------------------- /codes/common/XC_funcs/XC_c_pw_E.jl: -------------------------------------------------------------------------------- 1 | # epsxc only version 2 | function XC_c_pw_E( Rhoe ) 3 | 4 | third = 1.0/3.0 5 | pi34 = 0.6203504908994 6 | rs = pi34/Rhoe^third 7 | 8 | a = 0.031091 9 | a1 = 0.21370 10 | b1 = 7.5957 11 | b2 = 3.5876 12 | b3 = 1.6382 13 | b4 = 0.49294 14 | 15 | # interpolation formula 16 | rs12 = sqrt(rs) 17 | rs32 = rs * rs12 18 | rs2 = rs^2 19 | 20 | om = 2.0 * a * (b1 * rs12 + b2 * rs + b3 * rs32 + b4 * rs2) 21 | olog = log(1.0 + 1.0/om) 22 | ec = -2.0 * a * (1.0 + a1 * rs) * olog 23 | 24 | return ec 25 | end -------------------------------------------------------------------------------- /octopus_works/3d_gauss/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 0 5 | 6 | TheoryLevel = kohn_sham 7 | XCFunctional = lda_x + lda_c_vwn_1 8 | 9 | BoxShape = parallelepiped 10 | %Lsize 11 | 3 | 3 | 3 12 | % 13 | 14 | spacing = 0.25 15 | 16 | MixField = density 17 | MixingScheme = Linear 18 | Mixing = 0.5 19 | 20 | PoissonSolver = cg 21 | FilterPotentials = filter_none 22 | 23 | % Species 24 | "X" | species_user_defined | potential_formula | "-1.0*exp(-1.0*r^2)/sqrt(1.0/pi)^3" | valence | 2 25 | % 26 | 27 | % Coordinates 28 | "X" | 0 | 0 | 0 29 | % 30 | 31 | 32 | -------------------------------------------------------------------------------- /codes/common/XC_funcs/XC_x_pbe_E.jl: -------------------------------------------------------------------------------- 1 | # epsxc only version 2 | function XC_x_pbe_E( rho, grho ) 3 | 4 | third = 1.0/3.0 5 | k = 0.804 6 | mu = 0.2195149727645171 7 | c1 = 0.75/pi 8 | c2 = 3.093667726280136 9 | c5 = 4.0*third 10 | 11 | agrho = sqrt(grho) 12 | kf = c2 * rho^third 13 | dsg = 0.5/kf 14 | s1 = agrho*dsg / rho 15 | s2 = s1 * s1 16 | ds = -c5 * s1 17 | 18 | # Energy 19 | f1 = s2 * mu/k 20 | f2 = 1.0 + f1 21 | f3 = k / f2 22 | fx = k - f3 23 | exunif = -c1 * kf 24 | sx = exunif * fx * rho 25 | 26 | return sx 27 | end -------------------------------------------------------------------------------- /codes_old/1d_per/build_D2_matrix_3pt_per.jl: -------------------------------------------------------------------------------- 1 | """ 2 | Build second derivative matrix using 3-points centered 3 | finite difference approximation. 4 | 5 | # Arguments 6 | - `N::Int64`: number of grid points 7 | - `h::Float64`: spacing between grid points 8 | 9 | Periodic version 10 | """ 11 | function build_D2_matrix_3pt_per( N::Int64, h::Float64 ) 12 | mat = zeros(Float64,N,N) 13 | for i = 1:N-1 14 | mat[i,i] = -2.0 15 | mat[i,i+1] = 1.0 16 | mat[i+1,i] = mat[i,i+1] 17 | end 18 | mat[1,N] = 1.0 19 | mat[N,N] = -2.0 20 | mat[N,1] = 1.0 21 | return mat/h^2 22 | end 23 | 24 | -------------------------------------------------------------------------------- /codes/ks_dft_03/mix_adaptive.jl: -------------------------------------------------------------------------------- 1 | function mix_adaptive!( mu, nu, beta0::Float64, beta, f; betamax=0.8 ) 2 | 3 | Npts = length(mu) 4 | 5 | for i = 1:Npts 6 | 7 | t = nu[i] - mu[i] 8 | 9 | if t*f[i] >= 0.0 10 | beta[i] = beta[i] + beta0 11 | if beta[i] > betamax 12 | beta[i] = betamax 13 | end 14 | else 15 | beta[i] = 0.5*( beta[i] + beta0 ) 16 | end 17 | 18 | f[i] = t 19 | 20 | mu[i] = beta[i]*nu[i] + ( 1.0 - beta[i] )*mu[i] 21 | 22 | end 23 | 24 | return 25 | 26 | end -------------------------------------------------------------------------------- /codes/LF1d/build_D1_matrix_LF1d_p.jl: -------------------------------------------------------------------------------- 1 | function build_D1_matrix_LF1d_p( L::Float64, N::Int64 ) 2 | 3 | @assert !iseven(N) 4 | 5 | D1 = zeros(Float64,N,N) 6 | Nprimed = round(Int64,(N-1)/2) 7 | 8 | # Diagonal elements are already zero 9 | 10 | # Off diagonal elements 11 | for j in 1:N, l in (j+1):N 12 | n = j - l 13 | tt1 = pi/L * (-1.0)^n 14 | tt2 = sin(pi*n/N) 15 | D1[j,l] = tt1/tt2 16 | D1[l,j] = -tt1/tt2 17 | end 18 | 19 | return D1 20 | end 21 | 22 | build_D1_matrix_LF1d_p(x_min, x_max, N) = build_D1_matrix_LF1d_p( x_max - x_min, N ) 23 | -------------------------------------------------------------------------------- /codes/ks_dft_02/calc_rhoe.jl: -------------------------------------------------------------------------------- 1 | function calc_rhoe( Ham::Hamiltonian, psi::Array{Float64,2} ) 2 | Nbasis = size(psi,1) 3 | Rhoe = zeros(Float64,Nbasis) 4 | calc_rhoe!( Ham, psi, Rhoe ) 5 | return Rhoe 6 | end 7 | 8 | function calc_rhoe!( Ham::Hamiltonian, psi::Array{Float64}, Rhoe::Array{Float64,1} ) 9 | Nbasis = size(psi,1) 10 | Nstates = size(psi,2) 11 | Focc = Ham.electrons.Focc 12 | Rhoe[:] = zeros(Float64,Nbasis) 13 | for ist in 1:Nstates 14 | for ip in 1:Nbasis 15 | Rhoe[ip] = Rhoe[ip] + Focc[ist]*psi[ip,ist]*psi[ip,ist] 16 | end 17 | end 18 | return 19 | end -------------------------------------------------------------------------------- /codes/ks_dft_03/calc_rhoe.jl: -------------------------------------------------------------------------------- 1 | function calc_rhoe( Ham::Hamiltonian, psi::Array{Float64,2} ) 2 | Nbasis = size(psi,1) 3 | Rhoe = zeros(Float64,Nbasis) 4 | calc_rhoe!( Ham, psi, Rhoe ) 5 | return Rhoe 6 | end 7 | 8 | function calc_rhoe!( Ham::Hamiltonian, psi::Array{Float64}, Rhoe::Array{Float64,1} ) 9 | Nbasis = size(psi,1) 10 | Nstates = size(psi,2) 11 | Focc = Ham.electrons.Focc 12 | Rhoe[:] = zeros(Float64,Nbasis) 13 | for ist in 1:Nstates 14 | for ip in 1:Nbasis 15 | Rhoe[ip] = Rhoe[ip] + Focc[ist]*psi[ip,ist]*psi[ip,ist] 16 | end 17 | end 18 | return 19 | end -------------------------------------------------------------------------------- /codes/FD2d/main_FD2dGrid.jl: -------------------------------------------------------------------------------- 1 | using Printf 2 | 3 | include("FD2dGrid.jl") 4 | 5 | function main() 6 | Nx = 3 7 | Ny = 4 8 | grid = FD2dGrid( (-5.0,5.0), Nx, (-5.0,5.0), Ny ) 9 | println(grid) 10 | println(grid.x) 11 | println(grid.y) 12 | for ip = 1:grid.Npoints 13 | @printf("%3d %8.3f %8.3f\n", ip, grid.r[1,ip], grid.r[2,ip]) 14 | end 15 | 16 | println() 17 | for i = 1:Nx 18 | for j = 1:Ny 19 | ip = grid.idx_xy2ip[i,j] 20 | @printf("[%8.3f,%8.3f] ", grid.r[1,ip], grid.r[2,ip]) 21 | end 22 | @printf("\n") 23 | end 24 | end 25 | 26 | main() -------------------------------------------------------------------------------- /codes/common/XC_funcs/XC_x_slater_spin.jl: -------------------------------------------------------------------------------- 1 | # 2 | # Slater exchange with alpha=2/3, spin-polarized case 3 | # 4 | function XC_x_slater_spin( rho, zeta ) 5 | 6 | f = -1.10783814957303361 # f = -9/8*(3/pi)^(1/3) 7 | alpha = 2.0/3.0 8 | third = 1.0/3.0 9 | p43 = 4.0/3.0 10 | 11 | rho13 = ( (1.0 + zeta) * rho)^third 12 | exup = f * alpha * rho13 13 | vxup = p43 * f * alpha * rho13 14 | 15 | rho13 = ( (1.0 - zeta) * rho)^third 16 | exdw = f * alpha * rho13 17 | vxdw = p43 * f * alpha * rho13 18 | ex = 0.5 * ( (1.0 + zeta) * exup + (1.0 - zeta) * exdw) 19 | 20 | return ex, vxup, vxdw 21 | end -------------------------------------------------------------------------------- /codes/FD1d/build_D2_matrix_p_3pt.jl: -------------------------------------------------------------------------------- 1 | """ 2 | Build second derivative matrix using 3-points centered 3 | finite difference approximation. 4 | 5 | # Arguments 6 | - `N::Int64`: number of grid points 7 | - `h::Float64`: spacing between grid points 8 | 9 | Periodic boundary condition. 10 | """ 11 | function build_D2_matrix_p_3pt( N::Int64, h::Float64 ) 12 | mat = zeros(Float64,N,N) 13 | for i = 1:N-1 14 | mat[i,i] = -2.0 15 | mat[i,i+1] = 1.0 16 | mat[i+1,i] = 1.0 17 | end 18 | 19 | mat[N,N] = -2.0 20 | 21 | mat[1,N] = 1.0 22 | mat[N,1] = 1.0 23 | 24 | return mat/h^2 25 | end 26 | 27 | -------------------------------------------------------------------------------- /codes/common/calc_dr_periodic.jl: -------------------------------------------------------------------------------- 1 | # Only works for orthogonal lattice vectors 2 | function calc_dr_periodic!( LL, r, r0, dr ) 3 | 4 | xx1 = abs( r[1] - r0[1] ) 5 | xx2 = abs( r[1] - r0[1] + LL[1] ) 6 | xx3 = abs( r[1] - r0[1] - LL[1] ) 7 | dr[1] = min( xx1, xx2, xx3 ) 8 | 9 | yy1 = abs( r[2] - r0[2] ) 10 | yy2 = abs( r[2] - r0[2] + LL[2] ) 11 | yy3 = abs( r[2] - r0[2] - LL[2] ) 12 | dr[2] = min( yy1, yy2, yy3 ) 13 | 14 | zz1 = abs( r[3] - r0[3] ) 15 | zz2 = abs( r[3] - r0[3] + LL[3] ) 16 | zz3 = abs( r[3] - r0[3] - LL[3] ) 17 | dr[3] = min( zz1, zz2, zz3 ) 18 | 19 | return 20 | end -------------------------------------------------------------------------------- /codes/ks_dft_02/calc_energies.jl: -------------------------------------------------------------------------------- 1 | function calc_energies!( Ham::Hamiltonian, psi::Array{Float64,2} ) 2 | 3 | dVol = Ham.grid.dVol 4 | 5 | Ham.energies.Kinetic = calc_E_kin( Ham, psi ) 6 | Ham.energies.Ps_loc = sum( Ham.V_Ps_loc .* Ham.rhoe )*dVol 7 | if Ham.pspotNL.NbetaNL > 0 8 | Ham.energies.Ps_nloc = calc_E_Ps_nloc( Ham, psi ) 9 | end 10 | Ham.energies.Hartree = 0.5*sum( Ham.V_Hartree .* Ham.rhoe )*dVol 11 | Ham.energies.XC = sum( excVWN(Ham.rhoe) .* Ham.rhoe )*dVol 12 | 13 | return 14 | end 15 | 16 | function calc_energies(Ham, psi) 17 | calc_energies!(Ham, psi) 18 | return Ham.energies 19 | end -------------------------------------------------------------------------------- /codes/ks_dft_03/calc_energies.jl: -------------------------------------------------------------------------------- 1 | function calc_energies!( Ham::Hamiltonian, psi::Array{Float64,2} ) 2 | 3 | dVol = Ham.grid.dVol 4 | 5 | Ham.energies.Kinetic = calc_E_kin( Ham, psi ) 6 | Ham.energies.Ps_loc = sum( Ham.V_Ps_loc .* Ham.rhoe )*dVol 7 | if Ham.pspotNL.NbetaNL > 0 8 | Ham.energies.Ps_nloc = calc_E_Ps_nloc( Ham, psi ) 9 | end 10 | Ham.energies.Hartree = 0.5*sum( Ham.V_Hartree .* Ham.rhoe )*dVol 11 | Ham.energies.XC = sum( excVWN(Ham.rhoe) .* Ham.rhoe )*dVol 12 | 13 | return 14 | end 15 | 16 | function calc_energies(Ham, psi) 17 | calc_energies!(Ham, psi) 18 | return Ham.energies 19 | end -------------------------------------------------------------------------------- /codes/modelscf1d/reference_impl/OrigModelSCF1d.jl: -------------------------------------------------------------------------------- 1 | module OrigModelSCF1d 2 | 3 | include("Atoms.jl") 4 | export Atoms 5 | 6 | include("scfOptions.jl") 7 | export EigensolverOptions, SCFOptions 8 | export AndersonMixOptions, SimpleMixOptions 9 | 10 | include("anderson_mix.jl") 11 | include("kerker_mix.jl") 12 | 13 | include("pseudocharge.jl") 14 | export pseudocharge 15 | 16 | include("Hamiltonian.jl") 17 | include("hartree_pot_bc.jl") 18 | export hartree_pot_bc 19 | export Hamiltonian, init_pot!, scf_potmix!, get_force! 20 | export create_Hamiltonian 21 | 22 | include("getocc.jl") 23 | 24 | 25 | #include("Integrators.jl") 26 | 27 | end 28 | -------------------------------------------------------------------------------- /codes/KSDFT1d/calc_energies.jl: -------------------------------------------------------------------------------- 1 | function calc_E_NN(atoms::Atoms1d) 2 | Natoms = atoms.Natoms 3 | Zvals = atoms.Zvals 4 | atpos = atoms.positions 5 | E_NN = 0.0 6 | for i in 1:Natoms, j in (i+1):Natoms 7 | rij = abs(atpos[i] - atpos[j]) 8 | E_NN += Zvals[i]*Zvals[j]/rij 9 | end 10 | return E_NN 11 | end 12 | 13 | function calc_E_kin(Ham, psi) 14 | Ekin = 0.0 15 | Nstates = size(psi, 2) 16 | Kpsi = Ham.Kmat*psi 17 | Focc = Ham.electrons.Focc 18 | hx = Ham.grid.hx 19 | for ist in 1:Nstates 20 | Ekin += Focc[ist]*dot(psi[:,ist], Kpsi[:,ist])*hx 21 | end 22 | return Ekin 23 | end -------------------------------------------------------------------------------- /codes_old/3d/build_nabla2_matrix.jl: -------------------------------------------------------------------------------- 1 | include("../1d/build_D2_matrix_3pt.jl") 2 | include("../1d/build_D2_matrix_5pt.jl") 3 | include("../1d/build_D2_matrix_7pt.jl") 4 | include("../1d/build_D2_matrix_9pt.jl") 5 | 6 | const ⊗ = kron 7 | 8 | function build_nabla2_matrix( fdgrid::FD3dGrid; func_1d=build_D2_matrix_3pt ) 9 | 10 | D2x = func_1d(fdgrid.Nx, fdgrid.hx) 11 | D2y = func_1d(fdgrid.Ny, fdgrid.hy) 12 | D2z = func_1d(fdgrid.Nz, fdgrid.hz) 13 | 14 | IIx = speye(fdgrid.Nx) 15 | IIy = speye(fdgrid.Ny) 16 | IIz = speye(fdgrid.Nz) 17 | 18 | ∇2 = D2x⊗IIy⊗IIz + IIx⊗D2y⊗IIz + IIx⊗IIy⊗D2z 19 | 20 | return ∇2 21 | 22 | end -------------------------------------------------------------------------------- /octopus_works/H_atom_ps/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 0 5 | 6 | TheoryLevel = kohn_sham 7 | XCFunctional = lda_x + lda_c_vwn_1 8 | 9 | BoxShape = parallelepiped 10 | %Lsize 11 | 8 | 8 | 8 12 | % 13 | 14 | spacing = 0.25 15 | 16 | MixField = density 17 | MixingScheme = linear 18 | Mixing = 0.5 19 | 20 | PoissonSolver = cg 21 | FilterPotentials = filter_none 22 | 23 | % Species 24 | "X" | species_user_defined | potential_formula | "-1.0/r*erf(r/(sqrt(2.0)*0.2) ) + (-4.0663326 + 0.6678322*(5*r)^2)*exp(-0.5*(5*r)^2)" | valence | 1 25 | % 26 | 27 | % Coordinates 28 | "X" | 1e-9 | 1e-9 | 1e-9 29 | % 30 | -------------------------------------------------------------------------------- /codes/modelscf1d/Atoms1d.jl: -------------------------------------------------------------------------------- 1 | # atoms struct to store the data from the atoms 2 | mutable struct Atoms1d 3 | Natoms::Int64 4 | positions::Vector{Float64} 5 | Zvals::Array{Float64} 6 | σ::Vector{Float64} 7 | masses::Vector{Float64} 8 | forces::Vector{Float64} 9 | L::Float64 # cell length 10 | end 11 | 12 | function Atoms1d( positions, Zvals, σ, masses, L ) 13 | Natoms = length(positions) 14 | @assert Natoms == length(Zvals) 15 | @assert Natoms == length(σ) 16 | @assert Natoms == length(masses) 17 | forces = zeros(Natoms) 18 | # 19 | return Atoms1d( Natoms, positions, Zvals, σ, masses, forces, L ) 20 | end -------------------------------------------------------------------------------- /expl_julia/modify_array1.jl: -------------------------------------------------------------------------------- 1 | function modify01!(a) 2 | # create new array, a is not modified in the calling function 3 | for i in 1:size(a,1) 4 | a = a .+ 1 5 | end 6 | return 7 | end 8 | 9 | function modify02!(a) 10 | for i in 1:size(a,1) 11 | a .+= 1 12 | end 13 | return 14 | end 15 | 16 | 17 | function modify03!(a) 18 | for i in 1:size(a,1) 19 | a[i] = a[i] + size(a,1) 20 | end 21 | return 22 | end 23 | 24 | function main() 25 | a = rand(5) 26 | display(a); println() 27 | #modify01!(a) 28 | #modify02!(a) 29 | modify03!(a) 30 | display(a); println() 31 | end 32 | 33 | main() -------------------------------------------------------------------------------- /codes/LF2d/build_nabla2_matrix.jl: -------------------------------------------------------------------------------- 1 | include("../LF1d/build_D2_matrix_LF1d_c.jl") 2 | include("../LF1d/build_D2_matrix_LF1d_sinc.jl") 3 | 4 | function build_nabla2_matrix( grid::LF2dGrid ) 5 | 6 | if grid.types[1] == :sinc 7 | D2x = build_D2_matrix_LF1d_sinc( grid.x, grid.hx, grid.Nx ) 8 | else 9 | D2x = build_D2_matrix_LF1d_c( grid.Lx, grid.Nx ) 10 | end 11 | 12 | if grid.types[2] == :sinc 13 | D2y = build_D2_matrix_LF1d_sinc( grid.y, grid.hy, grid.Ny ) 14 | else 15 | D2y = build_D2_matrix_LF1d_c( grid.Ly, grid.Ny ) 16 | end 17 | 18 | ∇2 = kron(D2x, speye(grid.Ny)) + kron(speye(grid.Nx), D2y) 19 | return ∇2 20 | 21 | end -------------------------------------------------------------------------------- /codes/LF1d/init_LF1d_sinc_grid.jl: -------------------------------------------------------------------------------- 1 | function init_LF1d_sinc_grid(h::Float64, N::Int64) 2 | # Choice for x_min and x_max 3 | x_min = -(N-1)*h/2.0 4 | # 5 | x = zeros(Float64,N) 6 | for i in 1:N 7 | x[i] = x_min + (i-1)*h 8 | end 9 | return x 10 | end 11 | 12 | function init_LF1d_sinc_grid( x_min::Float64, x_max::Float64, N::Int64 ) 13 | @assert x_min < 0.0 14 | @assert x_max > 0.0 15 | @assert abs(x_min) ≈ x_max 16 | h = 2*x_max/(N-1) 17 | x = zeros(Float64,N) 18 | for i in 1:N 19 | x[i] = x_min + (i-1)*h 20 | end 21 | return x, h 22 | end 23 | 24 | init_LF1d_sinc_grid( X, N ) = init_LF1d_sinc_grid( X[1], X[2], N ) -------------------------------------------------------------------------------- /octopus_works/H2_atom_ps/inp: -------------------------------------------------------------------------------- 1 | CalculationMode = gs 2 | 3 | Dimensions = 3 4 | PeriodicDimensions = 0 5 | 6 | TheoryLevel = kohn_sham 7 | XCFunctional = none 8 | #XCFunctional = lda_x + lda_c_vwn_1 9 | 10 | BoxShape = parallelepiped 11 | %Lsize 12 | 8 | 8 | 8 13 | % 14 | 15 | spacing = 0.25 16 | 17 | MixField = density 18 | MixingScheme = Linear 19 | Mixing = 0.5 20 | 21 | FilterPotentials = filter_none 22 | 23 | % Species 24 | "X" | species_user_defined | potential_formula | "-1.0/r*erf(r/(sqrt(2.0)*0.2) ) + (-4.0663326 + 0.6678322*(5*r)^2)*exp(-0.5*(5*r)^2)" | valence | 1 25 | % 26 | 27 | % Coordinates 28 | "X" | -0.75 | 1e-9 | 1e-9 29 | "X" | 0.75 | 1e-9 | 1e-9 30 | % 31 | -------------------------------------------------------------------------------- /codes/modelscf1d/Electrons.jl: -------------------------------------------------------------------------------- 1 | mutable struct Electrons 2 | Nelectrons::Int64 3 | Nstates_occ::Int64 4 | Nstates_extra::Int64 5 | Nstates::Int64 6 | Focc::Matrix{Float64} 7 | ebands::Matrix{Float64} 8 | end 9 | 10 | 11 | function Electrons(atoms::Atoms1d; Nstates_extra=0, Nspin=1) 12 | Nelectrons = sum(atoms.Zvals) 13 | Nstates_occ = round(Int64, Nelectrons/2) 14 | Nstates = Nstates_occ + Nstates_extra 15 | # 16 | Focc = zeros(Float64, Nstates, Nspin) 17 | Focc[1:Nstates_occ] .= 2.0 18 | # 19 | ebands = zeros(Float64, Nstates, Nspin) 20 | # 21 | return Electrons(Nelectrons, Nstates_occ, Nstates_extra, Nstates, Focc, ebands) 22 | end -------------------------------------------------------------------------------- /expl_julia/modify_kwarg.jl: -------------------------------------------------------------------------------- 1 | function myfunc!(x; y=1.1) 2 | y = 2*y 3 | println("In myfunc! y = ", y) 4 | z = x + y + 1 5 | return z 6 | end 7 | 8 | function myfunc2!(x; y=[1.1]) 9 | y[1] = 2*y[1] 10 | println("In myfunc2! y = ", y) 11 | z = x + y[1] + 1 12 | return z 13 | end 14 | 15 | function main() 16 | x = 2.0 17 | y = 3.1 18 | 19 | z = myfunc!(x, y=y) 20 | println("y = ", y) 21 | println("z = ", z) 22 | 23 | y = 3.1 24 | z = myfunc2!(x, y=[y]) 25 | println("y = ", y) 26 | println("z = ", z) 27 | 28 | y = [3.1] 29 | z = myfunc2!(x, y=y) 30 | println("y = ", y) 31 | println("z = ", z) 32 | end 33 | 34 | main() -------------------------------------------------------------------------------- /codes/FD1d/build_D1_matrix_p_5pt.jl: -------------------------------------------------------------------------------- 1 | """ 2 | f_x = (1*f[i-2] - 8*f[i-1] + 8*f[i+1] - 1*f[i+2])/(12*h**1) 3 | """ 4 | function build_D1_matrix_p_5pt( N::Int64, h::Float64 ) 5 | mat = zeros(Float64,N,N) 6 | for i = 1:N-2 7 | # 8 | mat[i,i+1] = 8.0 9 | mat[i,i+2] = -1.0 10 | # 11 | mat[i+1,i] = -8.0 12 | mat[i+2,i] = 1.0 13 | end 14 | 15 | mat[N, N-1] = -8.0 16 | mat[N-1,N ] = 8.0 17 | 18 | # Periodic 19 | 20 | mat[1,N ] = -8.0 21 | mat[1,N-1] = 1.0 22 | 23 | mat[N ,1] = 8.0 24 | mat[N-1,1] = -1.0 25 | 26 | mat[2,N] = 1.0 27 | mat[N,2] = -1.0 28 | 29 | return mat/(12*h) 30 | 31 | end -------------------------------------------------------------------------------- /codes/KSDFT1d/XCCalculator.jl: -------------------------------------------------------------------------------- 1 | abstract type AbstractXCCalculator 2 | end 3 | 4 | # Use internal XC 5 | struct XCCalculator <: AbstractXCCalculator 6 | end 7 | 8 | # Use Libxc 9 | struct LibxcXCCalculator <: AbstractXCCalculator 10 | Vlapl::Array{Float64,2} 11 | Vtau::Array{Float64,2} 12 | end 13 | 14 | function LibxcXCCalculator( ; is_metagga=false, Npoints=0, Nspin=1 ) 15 | if is_metagga 16 | @assert Npoints > 0 17 | Vlapl = zeros(Npoints,Nspin) 18 | Vtau = zeros(Npoints,Nspin) 19 | return LibxcXCCalculator(Vlapl, Vtau) 20 | else 21 | return LibxcXCCalculator(zeros(1,1),zeros(1,1)) 22 | end 23 | end 24 | 25 | # These types should contain xcfunc field 26 | -------------------------------------------------------------------------------- /codes/sparse/test_ILU0Preconditioner.jl: -------------------------------------------------------------------------------- 1 | using Printf 2 | using LinearAlgebra 3 | using SparseArrays 4 | using BenchmarkTools 5 | 6 | include("../FD2d/FD2dGrid.jl") 7 | include("../FD2d/build_nabla2_matrix.jl") 8 | include("../common/supporting_functions.jl") 9 | 10 | include("../common/ILU0Preconditioner.jl") 11 | 12 | function main() 13 | Nx = 5 14 | Ny = 4 15 | grid = FD2dGrid( (-5.0,5.0), Nx, (-5.0,5.0), Ny ) 16 | ∇2 = build_nabla2_matrix( grid, stencil_order=3 ) 17 | 18 | prec = ILU0Preconditioner(-∇2) 19 | 20 | x = randn(Nx*Ny) 21 | println("dot(x,x) before = ", dot(x,x)) 22 | 23 | ldiv!(prec, x) 24 | 25 | println("dot(x,x) after = ", dot(x,x)) 26 | end 27 | 28 | main() -------------------------------------------------------------------------------- /codes/FD1d/build_D1_matrix_7pt.jl: -------------------------------------------------------------------------------- 1 | """ 2 | f_x = (-1*f[i-3] + 9*f[i-2] - 45*f[i-1] + 45*f[i+1] - 9*f[i+2] + 1*f[i+3])/(60*h**1) 3 | """ 4 | function build_D1_matrix_7pt( N::Int64, h::Float64 ) 5 | mat = zeros(Float64,N,N) 6 | for i = 1:N-3 7 | # 8 | mat[i,i+1] = 45.0 9 | mat[i,i+2] = -9.0 10 | mat[i,i+3] = 1.0 11 | # 12 | mat[i+1,i] = -45.0 13 | mat[i+2,i] = 9.0 14 | mat[i+3,i] = -1.0 15 | end 16 | 17 | mat[N ,N-1] = -45.0 18 | mat[N ,N-2] = 9.0 19 | # 20 | mat[N-2,N ] = -9.0 21 | mat[N-1,N ] = 45.0 22 | 23 | mat[N-1,N-2] = -45.0 24 | # 25 | mat[N-2,N-1] = 45.0 26 | 27 | return mat/(60*h) 28 | 29 | end -------------------------------------------------------------------------------- /codes/ks_dft_02/op_V_loc.jl: -------------------------------------------------------------------------------- 1 | # Local potential operator, Vloc is the local potential to be applied instead 2 | # of potential in Ham 3 | function op_V_loc( V_loc::Vector{Float64}, psi ) 4 | Nbasis = size(psi,1) 5 | Nstates = size(psi,2) 6 | Vpsi = zeros(Float64,Nbasis,Nstates) 7 | for ist in 1:Nstates, ip in 1:Nbasis 8 | Vpsi[ip,ist] = V_loc[ip]*psi[ip,ist] 9 | end 10 | return Vpsi 11 | end 12 | 13 | # Local pspot operator 14 | function op_V_Ps_loc( Ham::Hamiltonian, psi ) 15 | Nbasis = size(psi,1) 16 | Nstates = size(psi,2) 17 | Vpsi = zeros(Float64,Nbasis,Nstates) 18 | for ist in 1:Nstates, ip in 1:Nbasis 19 | Vpsi[ip,ist] = Ham.V_Ps_loc[ip]*psi[ip,ist] 20 | end 21 | return Vpsi 22 | end -------------------------------------------------------------------------------- /codes/ks_dft_03/op_V_loc.jl: -------------------------------------------------------------------------------- 1 | # Local potential operator, Vloc is the local potential to be applied instead 2 | # of potential in Ham 3 | function op_V_loc( V_loc::Vector{Float64}, psi ) 4 | Nbasis = size(psi,1) 5 | Nstates = size(psi,2) 6 | Vpsi = zeros(Float64,Nbasis,Nstates) 7 | for ist in 1:Nstates, ip in 1:Nbasis 8 | Vpsi[ip,ist] = V_loc[ip]*psi[ip,ist] 9 | end 10 | return Vpsi 11 | end 12 | 13 | # Local pspot operator 14 | function op_V_Ps_loc( Ham::Hamiltonian, psi ) 15 | Nbasis = size(psi,1) 16 | Nstates = size(psi,2) 17 | Vpsi = zeros(Float64,Nbasis,Nstates) 18 | for ist in 1:Nstates, ip in 1:Nbasis 19 | Vpsi[ip,ist] = Ham.V_Ps_loc[ip]*psi[ip,ist] 20 | end 21 | return Vpsi 22 | end -------------------------------------------------------------------------------- /expl_julia/test_structArray.jl: -------------------------------------------------------------------------------- 1 | struct MyStruct 2 | a::Vector{Float64} 3 | b::Matrix{Float64} 4 | end 5 | 6 | function update_struct!(o) 7 | a = o.a 8 | b = o.b 9 | for i in 1:size(a,1) 10 | a[i] = 9*i 11 | end 12 | for j in 1:size(b,2), i in 1:size(b,1) 13 | b[i,j] = 10*(i + j) 14 | end 15 | return 16 | end 17 | 18 | function main() 19 | N = 5 20 | obj1 = MyStruct(rand(5), rand(5,3)) 21 | 22 | println("Before update_struct!:") 23 | display(obj1.a); println() 24 | display(obj1.b); println() 25 | 26 | update_struct!(obj1) 27 | 28 | println("Before update_struct!:") 29 | display(obj1.a); println() 30 | display(obj1.b); println() 31 | end 32 | 33 | main() -------------------------------------------------------------------------------- /codes/LF1d/build_D2_matrix_LF1d_p.jl: -------------------------------------------------------------------------------- 1 | function build_D2_matrix_LF1d_p( L::Float64, N::Int64 ) 2 | 3 | @assert !iseven(N) 4 | 5 | D2 = zeros(Float64,N,N) 6 | Nprimed = round(Int64,(N-1)/2) 7 | 8 | # Diagonal elements 9 | for j in 1:N 10 | D2[j,j] = -( 2*pi/L )^2 * Nprimed * (Nprimed + 1)/3.0 11 | end 12 | 13 | # Off diagonal elements 14 | for j in 1:N, l = (j+1):N 15 | n = j - l 16 | tt3 = (2.0*pi/L)^2 * (-1.0)^n * cos(pi*n/N) 17 | tt4 = 2.0*sin(pi*n/N)^2 18 | D2[j,l] = -tt3/tt4 19 | D2[l,j] = -tt3/tt4 20 | end 21 | 22 | return D2 23 | end 24 | 25 | build_D2_matrix_LF1d_p(x_min, x_max, N) = build_D2_matrix_LF1d_p( x_max - x_min, N ) 26 | -------------------------------------------------------------------------------- /codes/FD1d/build_D2_matrix_5pt.jl: -------------------------------------------------------------------------------- 1 | """ 2 | Build second derivative matrix using 5-points centered 3 | finite difference approximation. 4 | 5 | # Arguments 6 | - `N::Int64`: number of grid points 7 | - `h::Float64`: spacing between grid points 8 | 9 | f_xx = (-1*f[i-2] + 16*f[i-1]- 30*f[i+0] + 16*f[i+1] - 1*f[i+2] )/(12*h^2) 10 | """ 11 | function build_D2_matrix_5pt( N::Int64, h::Float64 ) 12 | mat = zeros(Float64,N,N) 13 | for i = 1:N-2 14 | mat[i,i] = -30.0 15 | mat[i,i+1] = 16.0 16 | mat[i,i+2] = -1.0 17 | mat[i+1,i] = 16.0 18 | mat[i+2,i] = -1.0 19 | end 20 | 21 | mat[N-1,N-1] = -30.0 22 | mat[N-1,N] = 16.0 23 | mat[N,N-1] = 16.0 24 | 25 | mat[N,N] = -30.0 26 | 27 | return mat/(12*h^2) 28 | end -------------------------------------------------------------------------------- /codes/common/XC_functionals_internal.jl: -------------------------------------------------------------------------------- 1 | # Adapted from PWSCF 2 | # I found slight difference with Libxc for PBE correlation. 3 | 4 | include("XC_funcs/XC_c_pbe.jl") 5 | include("XC_funcs/XC_c_pbe_E.jl") 6 | 7 | include("XC_funcs/XC_c_pbe_spin.jl") 8 | include("XC_funcs/XC_c_pbe_spin_E.jl") 9 | 10 | include("XC_funcs/XC_c_pw.jl") 11 | include("XC_funcs/XC_c_pw_E.jl") 12 | 13 | include("XC_funcs/XC_c_pw_spin.jl") 14 | include("XC_funcs/XC_c_pw_spin_E.jl") 15 | 16 | include("XC_funcs/XC_c_vwn.jl") 17 | 18 | include("XC_funcs/XC_c_vwn_spin.jl") 19 | 20 | 21 | include("XC_funcs/XC_x_pbe.jl") 22 | include("XC_funcs/XC_x_pbe_E.jl") 23 | 24 | include("XC_funcs/XC_x_slater.jl") 25 | 26 | include("XC_funcs/XC_x_slater_spin.jl") 27 | include("XC_funcs/XC_x_slater_spin_E.jl") 28 | -------------------------------------------------------------------------------- /codes_old/1d/test_D2_matrix.jl: -------------------------------------------------------------------------------- 1 | include("build_D2_matrix_3pt.jl") 2 | include("build_D2_matrix_5pt.jl") 3 | include("build_D2_matrix_7pt.jl") 4 | include("build_D2_matrix_9pt.jl") 5 | 6 | function test_D2_3pt() 7 | D2 = build_D2_matrix_3pt(5, 1.0) 8 | display(D2) 9 | println() 10 | end 11 | 12 | function test_D2_5pt() 13 | D2 = build_D2_matrix_5pt(9, sqrt(1.0/12.0)) 14 | display(D2) 15 | println() 16 | end 17 | 18 | function test_D2_7pt() 19 | D2 = build_D2_matrix_7pt(9, sqrt(1.0/180.0)) 20 | display(D2) 21 | println() 22 | end 23 | 24 | function test_D2_9pt() 25 | D2 = build_D2_matrix_9pt(9, sqrt(1.0/5040.0)) 26 | display(D2) 27 | println() 28 | end 29 | 30 | test_D2_3pt() 31 | test_D2_5pt() 32 | test_D2_7pt() 33 | test_D2_9pt() -------------------------------------------------------------------------------- /codes_old/1d/build_D2_matrix_5pt.jl: -------------------------------------------------------------------------------- 1 | """ 2 | Build second derivative matrix using 5-points centered 3 | finite difference approximation. 4 | 5 | # Arguments 6 | - `N::Int64`: number of grid points 7 | - `h::Float64`: spacing between grid points 8 | 9 | f_xx = (-1*f[i-2] + 16*f[i-1]- 30*f[i+0] + 16*f[i+1] - 1*f[i+2] )/(12*h^2) 10 | """ 11 | function build_D2_matrix_5pt( N::Int64, h::Float64 ) 12 | mat = zeros(Float64,N,N) 13 | for i = 1:N-2 14 | mat[i,i] = -30.0 15 | mat[i,i+1] = 16.0 16 | mat[i,i+2] = -1.0 17 | mat[i+1,i] = mat[i,i+1] 18 | mat[i+2,i] = mat[i,i+2] 19 | end 20 | 21 | mat[N-1,N-1] = -30.0 22 | mat[N-1,N] = 16.0 23 | mat[N,N-1] = mat[N-2,N-1] 24 | mat[N,N] = -30.0 25 | 26 | 27 | return mat/(12*h^2) 28 | end -------------------------------------------------------------------------------- /codes/qdot_2d/calc_rhoe.jl: -------------------------------------------------------------------------------- 1 | function calc_rhoe( Ham::Hamiltonian, psi::Array{Float64,2} ) 2 | Nbasis = size(psi,1) 3 | Nstates = size(psi,2) 4 | Focc = Ham.electrons.Focc 5 | Rhoe = zeros(Float64,Nbasis) 6 | for ist in 1:Nstates 7 | for ip in 1:Nbasis 8 | Rhoe[ip] = Rhoe[ip] + Focc[ist]*psi[ip,ist]*psi[ip,ist] 9 | end 10 | end 11 | return Rhoe 12 | end 13 | 14 | 15 | function calc_rhoe!( Ham::Hamiltonian, psi::Array{Float64,2}, Rhoe::Array{Float64,1} ) 16 | Nbasis = size(psi,1) 17 | Nstates = size(psi,2) 18 | Focc = Ham.electrons.Focc 19 | @views Rhoe[:] .= 0.0 20 | for ist in 1:Nstates 21 | for ip in 1:Nbasis 22 | Rhoe[ip] = Rhoe[ip] + Focc[ist]*psi[ip,ist]*psi[ip,ist] 23 | end 24 | end 25 | return 26 | end -------------------------------------------------------------------------------- /codes/common/XC_funcs/XC_c_pbe_E.jl: -------------------------------------------------------------------------------- 1 | # energy (epsxc) only 2 | function XC_c_pbe_E( rho, grho ) 3 | 4 | ga = 0.0310906908696548950 5 | be = 0.06672455060314922 6 | third = 1.0/3.0 7 | pi34 = 0.6203504908994 8 | xkf = 1.919158292677513 9 | xks = 1.128379167095513 10 | 11 | rs = pi34/rho^third 12 | ec = XC_c_pw_E( rho ) 13 | 14 | kf = xkf/rs 15 | ks = xks * sqrt(kf) 16 | t = sqrt(grho) / (2.0 * ks * rho) 17 | 18 | expe = exp(-ec/ga) 19 | af = be / ga * (1.0 / (expe - 1.0) ) 20 | 21 | y = af * t * t 22 | 23 | xy = (1.0 + y) / (1.0 + y + y * y) 24 | 25 | qy = y * y * (2.0 + y) / (1.0 + y + y * y)^2 26 | 27 | s1 = 1.0 + be / ga * t * t * xy 28 | h0 = ga * log(s1) 29 | 30 | sc = rho * h0 31 | 32 | return sc 33 | 34 | end -------------------------------------------------------------------------------- /codes/ks_dft_01/calc_rhoe.jl: -------------------------------------------------------------------------------- 1 | function calc_rhoe( Ham::Hamiltonian, psi::Array{Float64,2} ) 2 | Nbasis = size(psi,1) 3 | Nstates = size(psi,2) 4 | Focc = Ham.electrons.Focc 5 | Rhoe = zeros(Float64,Nbasis) 6 | for ist in 1:Nstates 7 | for ip in 1:Nbasis 8 | Rhoe[ip] = Rhoe[ip] + Focc[ist]*psi[ip,ist]*psi[ip,ist] 9 | end 10 | end 11 | return Rhoe 12 | end 13 | 14 | 15 | function calc_rhoe!( Ham::Hamiltonian, psi::Array{Float64}, Rhoe::Array{Float64,1} ) 16 | Nbasis = size(psi,1) 17 | Nstates = size(psi,2) 18 | Focc = Ham.electrons.Focc 19 | Rhoe[:] = zeros(Float64,Nbasis) 20 | for ist in 1:Nstates 21 | for ip in 1:Nbasis 22 | Rhoe[ip] = Rhoe[ip] + Focc[ist]*psi[ip,ist]*psi[ip,ist] 23 | end 24 | end 25 | return 26 | end -------------------------------------------------------------------------------- /codes_old/1d/test_init_FD1d_grid.jl: -------------------------------------------------------------------------------- 1 | using PGFPlotsX 2 | using LaTeXStrings 3 | 4 | include("init_FD1d_grid.jl") 5 | 6 | function my_gaussian(x::Float64; α=1.0) 7 | return exp( -α*x^2 ) 8 | end 9 | 10 | function main() 11 | A = -5.0 12 | B = 5.0 13 | Npoints = 8 14 | x, h = init_FD1d_grid( A, B, Npoints ) 15 | println(x) 16 | println(h) 17 | 18 | NptsPlot = 200 19 | x_dense = range(A, stop=5, length=NptsPlot) 20 | 21 | f = @pgf( Axis( {height = "6cm", width = "10cm" }, 22 | PlotInc( {mark="none"}, Coordinates(x_dense, my_gaussian.(x_dense)) ), 23 | LegendEntry(L"f(x)"), 24 | PlotInc( Coordinates(x, my_gaussian.(x)) ), 25 | LegendEntry(L"Sampled $f(x)$"), 26 | ) 27 | ) 28 | pgfsave("TEMP_gaussian_1d.pdf", f) 29 | end 30 | 31 | main() -------------------------------------------------------------------------------- /codes_old/1d_per/test_D2_matrix.jl: -------------------------------------------------------------------------------- 1 | include("build_D2_matrix_3pt_per.jl") 2 | include("build_D2_matrix_5pt_per.jl") 3 | #include("build_D2_matrix_7pt.jl") 4 | #include("build_D2_matrix_9pt.jl") 5 | 6 | function test_D2_3pt() 7 | D2 = build_D2_matrix_3pt_per(5, 1.0) 8 | display(D2) 9 | println() 10 | end 11 | 12 | 13 | function test_D2_5pt() 14 | D2 = build_D2_matrix_5pt_per(8, sqrt(1.0/12.0)) 15 | display(D2) 16 | println() 17 | end 18 | 19 | #= 20 | function test_D2_7pt() 21 | D2 = build_D2_matrix_7pt(9, sqrt(1.0/180.0)) 22 | display(D2) 23 | println() 24 | end 25 | 26 | function test_D2_9pt() 27 | D2 = build_D2_matrix_9pt(9, sqrt(1.0/5040.0)) 28 | display(D2) 29 | println() 30 | end 31 | =# 32 | 33 | #test_D2_3pt() 34 | test_D2_5pt() 35 | #test_D2_7pt() 36 | #test_D2_9pt() -------------------------------------------------------------------------------- /codes/common/XC_funcs/XC_c_pw.jl: -------------------------------------------------------------------------------- 1 | function XC_c_pw( Rhoe ) 2 | # J.P. Perdew and Y. Wang, PRB 45, 13244 (1992) 3 | 4 | third = 1.0/3.0 5 | pi34 = 0.6203504908994 6 | rs = pi34/Rhoe^third 7 | 8 | a = 0.031091 9 | a1 = 0.21370 10 | b1 = 7.5957 11 | b2 = 3.5876 12 | b3 = 1.6382 13 | b4 = 0.49294 14 | 15 | # interpolation formula 16 | rs12 = sqrt(rs) 17 | rs32 = rs * rs12 18 | rs2 = rs^2 19 | 20 | om = 2.0 * a * (b1 * rs12 + b2 * rs + b3 * rs32 + b4 * rs2) 21 | dom = 2.0 * a * (0.5 * b1 * rs12 + b2 * rs + 1.5 * b3 * rs32 + 2.0 * b4 * rs2) 22 | olog = log(1.0 + 1.0/om) 23 | ec = -2.0 * a * (1.0 + a1 * rs) * olog 24 | vc = -2.0*a*(1.0 + 2.0/3.0 * a1 * rs) * olog - 2.0/3.0 * a * (1.0 + a1*rs) * dom/ (om * (om + 1.0) ) 25 | 26 | return ec, vc 27 | end -------------------------------------------------------------------------------- /codes_old/1d/test_harmonic_1d.jl: -------------------------------------------------------------------------------- 1 | using Printf 2 | using LinearAlgebra 3 | 4 | include("init_FD1d_grid.jl") 5 | include("build_D2_matrix_3pt.jl") 6 | include("build_D2_matrix_5pt.jl") 7 | include("build_D2_matrix_7pt.jl") 8 | include("build_D2_matrix_9pt.jl") 9 | 10 | function pot_harmonic( x; ω=1.0 ) 11 | return 0.5 * ω^2 * x^2 12 | end 13 | 14 | function main() 15 | 16 | xmin = -5.0 17 | xmax = 5.0 18 | N = 50 19 | x, h = init_FD1d_grid(xmin, xmax, N) 20 | 21 | D2 = build_D2_matrix_9pt(N, h) 22 | Vpot = pot_harmonic.(x) 23 | 24 | Ham = -0.5*D2 + diagm( 0 => Vpot ) 25 | 26 | evals, evecs = eigen( Ham ) 27 | 28 | Nstates = 5 29 | @printf("\n\nEigenvalues\n") 30 | for i in 1:Nstates 31 | @printf("%5d %18.10f\n", i, evals[i]) 32 | end 33 | end 34 | 35 | main() -------------------------------------------------------------------------------- /codes/KSDFT1d/INC_sch_1d.jl: -------------------------------------------------------------------------------- 1 | include("../FD1d/init_FD1d_grid.jl") 2 | include("../FD1d/build_D2_matrix_3pt.jl") 3 | include("../FD1d/build_D2_matrix_5pt.jl") 4 | include("../FD1d/build_D2_matrix_7pt.jl") 5 | include("../FD1d/build_D2_matrix_9pt.jl") 6 | include("../FD1d/build_D2_matrix_11pt.jl") 7 | 8 | include("../FD1d/init_FD1d_p_grid.jl") 9 | # 10 | include("../FD1d/build_D1_matrix_p_3pt.jl") 11 | include("../FD1d/build_D1_matrix_p_5pt.jl") 12 | include("../FD1d/build_D1_matrix_p_7pt.jl") 13 | include("../FD1d/build_D1_matrix_p_9pt.jl") 14 | include("../FD1d/build_D1_matrix_p_11pt.jl") 15 | # 16 | include("../FD1d/build_D2_matrix_p_3pt.jl") 17 | include("../FD1d/build_D2_matrix_p_5pt.jl") 18 | include("../FD1d/build_D2_matrix_p_7pt.jl") 19 | include("../FD1d/build_D2_matrix_p_9pt.jl") 20 | include("../FD1d/build_D2_matrix_p_11pt.jl") -------------------------------------------------------------------------------- /codes/KSDFT1d/emin_smearing/test_Lfunc_03.jl: -------------------------------------------------------------------------------- 1 | push!(LOAD_PATH, "../") 2 | 3 | import Random 4 | using Printf 5 | using LinearAlgebra 6 | using Serialization 7 | 8 | using KSDFT1d 9 | 10 | include("system_defs_01.jl") 11 | include("Lfunc.jl") 12 | include("../utilities.jl") 13 | 14 | Ham = init_Hamiltonian() 15 | 16 | hx = Ham.grid.hx 17 | Npoints = Ham.grid.Npoints 18 | Nelectrons = Ham.electrons.Nelectrons 19 | Nstates = Ham.electrons.Nstates 20 | Focc = Ham.electrons.Focc 21 | 22 | Random.seed!(1234) 23 | psi = generate_random_wavefunc(Ham) 24 | 25 | # Using diagonal Haux 26 | ebands1 = sort(randn(Nstates)) 27 | Haux = diagm(0 => ebands1) 28 | 29 | display(Haux); println() 30 | 31 | Etot1 = calc_Lfunc_Haux!(Ham, psi, Haux) 32 | 33 | println("\nCall again:") 34 | Etot2 = calc_Lfunc_ebands!(Ham, psi, reshape(ebands1,(Nstates,1))) -------------------------------------------------------------------------------- /codes/ks_dft_1d/INC_sch_1d.jl: -------------------------------------------------------------------------------- 1 | include("../FD1d/init_FD1d_grid.jl") 2 | include("../FD1d/build_D2_matrix_3pt.jl") 3 | include("../FD1d/build_D2_matrix_5pt.jl") 4 | include("../FD1d/build_D2_matrix_7pt.jl") 5 | include("../FD1d/build_D2_matrix_9pt.jl") 6 | include("../FD1d/build_D2_matrix_11pt.jl") 7 | 8 | include("../FD1d/init_FD1d_p_grid.jl") 9 | # 10 | include("../FD1d/build_D1_matrix_p_3pt.jl") 11 | include("../FD1d/build_D1_matrix_p_5pt.jl") 12 | include("../FD1d/build_D1_matrix_p_7pt.jl") 13 | include("../FD1d/build_D1_matrix_p_9pt.jl") 14 | include("../FD1d/build_D1_matrix_p_11pt.jl") 15 | # 16 | include("../FD1d/build_D2_matrix_p_3pt.jl") 17 | include("../FD1d/build_D2_matrix_p_5pt.jl") 18 | include("../FD1d/build_D2_matrix_p_7pt.jl") 19 | include("../FD1d/build_D2_matrix_p_9pt.jl") 20 | include("../FD1d/build_D2_matrix_p_11pt.jl") -------------------------------------------------------------------------------- /codes/sch_1d/INC_sch_1d.jl: -------------------------------------------------------------------------------- 1 | include("../FD1d/init_FD1d_grid.jl") 2 | include("../FD1d/build_D2_matrix_3pt.jl") 3 | include("../FD1d/build_D2_matrix_5pt.jl") 4 | include("../FD1d/build_D2_matrix_7pt.jl") 5 | include("../FD1d/build_D2_matrix_9pt.jl") 6 | include("../FD1d/build_D2_matrix_11pt.jl") 7 | 8 | include("../FD1d/init_FD1d_p_grid.jl") 9 | # 10 | include("../FD1d/build_D1_matrix_p_3pt.jl") 11 | include("../FD1d/build_D1_matrix_p_5pt.jl") 12 | include("../FD1d/build_D1_matrix_p_7pt.jl") 13 | include("../FD1d/build_D1_matrix_p_9pt.jl") 14 | include("../FD1d/build_D1_matrix_p_11pt.jl") 15 | # 16 | include("../FD1d/build_D2_matrix_p_3pt.jl") 17 | include("../FD1d/build_D2_matrix_p_5pt.jl") 18 | include("../FD1d/build_D2_matrix_p_7pt.jl") 19 | include("../FD1d/build_D2_matrix_p_9pt.jl") 20 | include("../FD1d/build_D2_matrix_p_11pt.jl") -------------------------------------------------------------------------------- /codes_old/ks_part1/ks_scf/calc_rhoe.jl: -------------------------------------------------------------------------------- 1 | function calc_rhoe( Ham::Hamiltonian, psi::Array{Float64,2} ) 2 | Nbasis = size(psi,1) 3 | Nstates = size(psi,2) 4 | Focc = Ham.electrons.Focc 5 | Rhoe = zeros(Float64,Nbasis) 6 | for ist in 1:Nstates 7 | for ip in 1:Nbasis 8 | Rhoe[ip] = Rhoe[ip] + Focc[ist]*psi[ip,ist]*psi[ip,ist] 9 | end 10 | end 11 | return Rhoe 12 | end 13 | 14 | 15 | function calc_rhoe!( Ham::Hamiltonian, psi::Array{Float64}, Rhoe::Array{Float64,1} ) 16 | Nbasis = size(psi,1) 17 | Nstates = size(psi,2) 18 | Focc = Ham.electrons.Focc 19 | Rhoe[:] = zeros(Float64,Nbasis) 20 | for ist in 1:Nstates 21 | for ip in 1:Nbasis 22 | Rhoe[ip] = Rhoe[ip] + Focc[ist]*psi[ip,ist]*psi[ip,ist] 23 | end 24 | end 25 | return 26 | end -------------------------------------------------------------------------------- /codes/ks_dft_04/calc_rhoe.jl: -------------------------------------------------------------------------------- 1 | function calc_rhoe( 2 | Ham::Hamiltonian, 3 | psis::Vector{Array{Float64,2}} 4 | ) 5 | Nspin = size(psis, 1) 6 | Nbasis = size(psis[1], 1) 7 | Rhoe = zeros(Float64, Nbasis, Nspin) 8 | calc_rhoe!(Ham, psi, Rhoe) 9 | return Rhoe 10 | end 11 | 12 | function calc_rhoe!( 13 | Ham::Hamiltonian, 14 | psis::Vector{Array{Float64,2}}, 15 | Rhoe::Array{Float64,2} 16 | ) 17 | Nspin = size(psis, 1) 18 | Nbasis = size(psis[1], 1) 19 | Nstates = size(psis[1], 2) 20 | Focc = Ham.electrons.Focc 21 | fill!(Rhoe, 0.0) 22 | for ispin in 1:Nspin 23 | psi = psis[ispin] 24 | for ist in 1:Nstates, ip in 1:Nbasis 25 | Rhoe[ip,ispin] = Rhoe[ip,ispin] + Focc[ist,ispin]*psi[ip,ist]*psi[ip,ist] 26 | end 27 | end 28 | return 29 | end -------------------------------------------------------------------------------- /expl_julia/test_2struct.jl: -------------------------------------------------------------------------------- 1 | struct MyStruct1 2 | Npoints::Int64 3 | Nspin::Int64 4 | data::Array{Float64} 5 | end 6 | 7 | struct MyStruct2 8 | Npoints::Int64 9 | Nspin::Int64 10 | data::Array{Float64,2} 11 | end 12 | 13 | function main() 14 | Npoints = 5 15 | Nspin = 2 16 | 17 | in_data = rand(Npoints,Nspin) 18 | obj1 = MyStruct1(Npoints,Nspin,in_data) 19 | obj2 = MyStruct2(Npoints,Nspin,in_data) 20 | 21 | println(typeof(obj1.data)) 22 | println(typeof(obj2.data)) 23 | 24 | in_data2 = rand(Npoints) 25 | obj3 = MyStruct1(Npoints,Nspin,in_data2) 26 | obj4 = MyStruct2(Npoints,Nspin,reshape(in_data2,(Npoints,1))) # must use reshape 27 | 28 | println(typeof(obj3.data)) 29 | println(typeof(obj4.data)) 30 | 31 | println("Pass here") 32 | end 33 | 34 | main() -------------------------------------------------------------------------------- /codes/ks_dft_03/gen_gaussian_density.jl: -------------------------------------------------------------------------------- 1 | function gen_gaussian_density!( 2 | grid, atoms::Atoms, pspots::Vector{PsPot_GTH}, Rhoe::Array{Float64,1} 3 | ) 4 | Natoms = atoms.Natoms 5 | Npoints = grid.Npoints 6 | 7 | Zvals = get_Zvals(pspots) 8 | 9 | σ = 0.5 10 | nrmfct = (2*pi*σ^2)^1.5 11 | Rhoe .= 0.0 12 | for ia in 1:Natoms 13 | isp = atoms.atm2species[ia] 14 | for ip in 1:Npoints 15 | dr1 = grid.r[1,ip] - atoms.positions[1,ia] 16 | dr2 = grid.r[2,ip] - atoms.positions[2,ia] 17 | dr3 = grid.r[3,ip] - atoms.positions[3,ia] 18 | r = sqrt(dr1^2 + dr2^2 + dr3^2) 19 | Rhoe[ip] = Rhoe[ip] + Zvals[isp] * exp( -r^2 / (2.0*σ^2) ) / nrmfct 20 | end 21 | end 22 | println("Gaussian Rhoe integral = ", sum(Rhoe)*grid.dVol) 23 | return 24 | end --------------------------------------------------------------------------------