Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
146 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# # Anyons | ||
|
||
# We solve the almost-bosonic anyon model of https://arxiv.org/pdf/1901.10739.pdf | ||
|
||
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 | ||
|
||
terms = [Kinetic(2), | ||
ExternalFromReal(X -> pot(X...)), | ||
Anyonic(1, β) | ||
] | ||
model = Model(lattice; n_electrons=n_electrons, | ||
terms=terms, spin_polarization=:spinless) # "spinless electrons" | ||
basis = PlaneWaveBasis(model, Ecut, kgrid=(1, 1, 1); | ||
fft_size=DFTK.compute_fft_size(lattice, Ecut, supersampling=1.2)) | ||
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π)) | ||
display(heatmap(scfres.ρ.real[:, :, 1], c=:blues)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using DFTK | ||
using LinearAlgebra | ||
using Test | ||
|
||
@testset "Anyons" begin | ||
# Test that the magnetic field satisfies ∇∧A = 2π ρref, ∇⋅A = 0 | ||
x = 1.23 | ||
y = -1.8 | ||
ε = 1e-8 | ||
M = 2.31 | ||
σ = 1.81 | ||
dAdx = ( DFTK.magnetic_field_produced_by_ρref(x + ε, y, M, σ) | ||
- DFTK.magnetic_field_produced_by_ρref(x, y, M, σ)) / ε | ||
dAdy = ( DFTK.magnetic_field_produced_by_ρref(x, y + ε, M, σ) | ||
- DFTK.magnetic_field_produced_by_ρref(x, y, M, σ)) / ε | ||
curlA = dAdx[2] - dAdy[1] | ||
divA = dAdx[1] + dAdy[2] | ||
@test norm(curlA - 2π*DFTK.ρref_real(x, y, M, σ)) < 1e-4 | ||
@test abs(divA) < 1e-6 | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters