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(:Si, functional="lda")) atoms = [Si => [ones(3)/8, -ones(3)/8]] # Cast to Float32, setup model and basis model = model_DFT(Array{Float32}(lattice), atoms, [:lda_x, :lda_c_vwn]) Ecut = 7 basis = PlaneWaveBasis(model, Ecut, kgrid=[4, 4, 4]) # Run the SCF scfres = self_consistent_field(basis, tol=1e-4); scfres.energies eltype(scfres.energies.total) eltype(scfres.ρ.real)