miller = (1, 1, 0) # Surface Miller indices n_GaAs = 2 # Number of GaAs layers n_vacuum = 4 # Number of vacuum layers Ecut = 5 # Hartree kgrid = (4, 4, 1); # Monkhorst-Pack mesh using ASEconvert a = 5.6537 # GaAs lattice parameter in Ångström (because ASE uses Å as length unit) gaas = ase.build.bulk("GaAs", "zincblende"; a) surface = ase.build.surface(gaas, miller, n_GaAs, 0, periodic=true); d_vacuum = maximum(maximum, surface.cell) / n_GaAs * n_vacuum surface = ase.build.surface(gaas, miller, n_GaAs, d_vacuum, periodic=true); ase.io.write("surface.png", surface * pytuple((3, 3, 1)), rotation="-90x, 30y, -75z") using DFTK system = attach_psp(pyconvert(AbstractSystem, surface); Ga="hgh/pbe/ga-q3.hgh", As="hgh/pbe/as-q5.hgh") model = model_DFT(system, [:gga_x_pbe, :gga_c_pbe], temperature=0.001, smearing=DFTK.Smearing.Gaussian()) basis = PlaneWaveBasis(model; Ecut, kgrid) scfres = self_consistent_field(basis, tol=1e-4, mixing=LdosMixing()); scfres.energies