Two-dimensional square lattice model with flux
A two-dimensional example is presented here:
julia> function H₀(k, p)
k1, k2 = k
Hsize, ν = p
t = 1
Hmat = zeros(ComplexF64, Hsize, Hsize)
ϕ = 2π * ν / Hsize
for i in 1:Hsize
Hmat[i, i] = -2t * cos(k2 - i * ϕ)
end
for i in 1:Hsize-1
Hmat[i, i+1] = -t
Hmat[i+1, i] = -t
end
Hmat[1, Hsize] = -t * exp(-im * k1)
Hmat[Hsize, 1] = -t * exp(im * k1)
Hmat
endYou can also use our preset Hamiltonian function Flux2d to define the same Hamiltonian matrix as follows:
julia> H₀(k, p) = Flux2d(k, p)To calculate the dispersion, run:
julia> H(k) = H₀(k, (6, 1))
julia> showBand(H; value=false, disp=true)Then we can compute the Chern numbers using FCProblem:
julia> prob = FCProblem(H);
julia> sol = solve(prob)The output is:
FCSolution{Vector{Int64}, Int64}([1, 1, -2, -2, 1, 1], 0)The first argument TopologicalNumber in the named tuple is a vector that stores the first Chern number for each band. The vector is arranged in order of bands, starting from the one with the lowest energy. The second argument Total stores the total of the first Chern numbers for each band. Total is a quantity that should always return zero.
You can access these values as follows:
julia> sol.TopologicalNumber
6-element Vector{Int64}:
1
1
-2
-2
1
1
julia> sol.Total
0One-dimensional phase diagram is given by:
julia> H(k, p) = H₀(k, (6, p));
julia> param = 0:6;
julia> prob = FCProblem(H);
julia> sol = calcPhaseDiagram(prob, param; plot=true)
(param = 0:6, nums = [0 0 … 0 0; 1 1 … 1 1; … ; -1 -1 … -1 -1; 0 0 … 0 0])