using DFTK using StaticArrays using Plots # Unit cell. Having one of the lattice vectors as zero means a 2D system a = 14 lattice = a .* [[1 0 0.]; [0 1 0]; [0 0 0]]; # Confining scalar potential pot(x, y, z) = ((x - a/2)^2 + (y - a/2)^2); # Parameters Ecut = 50 n_electrons = 1 β = 5; # Collect all the terms, build and run the model terms = [Kinetic(; scaling_factor=2), ExternalFromReal(X -> pot(X...)), Anyonic(1, β) ] model = Model(lattice; n_electrons, terms, spin_polarization=:spinless) # "spinless electrons" basis = PlaneWaveBasis(model; Ecut, kgrid=(1, 1, 1)) scfres = direct_minimization(basis, tol=1e-14) # Reduce tol for production E = scfres.energies.total s = 2 E11 = π/2 * (2(s+1)/s)^((s+2)/s) * (s/(s+2))^(2(s+1)/s) * E^((s+2)/s) / β println("e(1,1) / (2π)= ", E11 / (2π)) heatmap(scfres.ρ[:, :, 1, 1], c=:blues)