using DFTK using Unitful using Plots using LazyArtifacts import Main: @artifact_str # hide psp_hgh = load_psp("hgh/lda/si-q4.hgh"); psp_upf = load_psp(artifact"pd_nc_sr_lda_standard_0.4.1_upf/Si.upf"); function run_bands(psp) a = 10.26 # Silicon lattice constant in Bohr lattice = a / 2 * [[0 1 1.]; [1 0 1.]; [1 1 0.]] Si = ElementPsp(:Si; psp=psp) atoms = [Si, Si] positions = [ones(3)/8, -ones(3)/8] # These are (as you saw above) completely unconverged parameters model = model_LDA(lattice, atoms, positions; temperature=1e-2) basis = PlaneWaveBasis(model; Ecut=12, kgrid=(4, 4, 4)) scfres = self_consistent_field(basis; tol=1e-4) bandplot = plot_bandstructure(scfres) (; scfres, bandplot) end; result_hgh = run_bands(psp_hgh) result_hgh.scfres.energies result_upf = run_bands(psp_upf) result_upf.scfres.energies plot(result_hgh.bandplot, result_upf.bandplot, titles=["HGH" "UPF"], size=(800, 400))