using DFTK # Setup silicon lattice a = 10.263141334305942 # lattice constant in Bohr lattice = a / 2 .* [[0 1 1.]; [1 0 1.]; [1 1 0.]] Si = ElementPsp(:Si, psp=load_psp("hgh/lda/Si-q4")) atoms = [Si, Si] positions = [ones(3)/8, -ones(3)/8] # Cast to Float32, setup model and basis model = model_DFT(Array{Float32}(lattice), atoms, positions, [:lda_x, :lda_c_vwn]) basis = PlaneWaveBasis(model, Ecut=7, kgrid=[4, 4, 4]) # Run the SCF scfres = self_consistent_field(basis, tol=1e-3); scfres.energies eltype(scfres.energies.total) eltype(scfres.ρ)