using DFTK using Downloads using Unitful using Plots PSEUDOLIB = "https://raw.githubusercontent.com/JuliaMolSim/PseudoLibrary" COMMIT = "56d1774708e1adfff35d30a403004cb98de4224b" URL_UPF = PSEUDOLIB * "/$COMMIT/pseudos/pd_nc_sr_lda_standard_04_upf/Li.upf"; psp_hgh = load_psp("hgh/lda/li-q3.hgh"); path_upf = Downloads.download(URL_UPF, joinpath(tempdir(), "Li.upf")) psp_upf = load_psp(path_upf); function run_bands(psp) a = -1.53877u"Å" b = -2.66523u"Å" c = -4.92295u"Å" lattice = [ a a 0; -b b 0; 0 0 -c] Li = ElementPsp(:Li; psp) atoms = [Li, Li] positions = [[1/3, 2/3, 1/4], [2/3, 1/3, 3/4]] # These are (as you saw above) completely unconverged parameters model = model_LDA(lattice, atoms, positions; temperature=1e-2) basis = PlaneWaveBasis(model; Ecut=24, kgrid=(6, 6, 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))