Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antoine-levitt/5ba929875c21e88baeec8532562f5311 to your computer and use it in GitHub Desktop.
Save antoine-levitt/5ba929875c21e88baeec8532562f5311 to your computer and use it in GitHub Desktop.
using StaticArrays
using PyPlot
const gap = 0.0 # gap at the Dirac points. 0 for graphene
const n = 80 # number of k point per direction
const t2 = 0.0
#http://www-personal.umich.edu/~sunkai/teaching/Fall_2014/Chapter6.pdf
# K = 1/3,-1/3
# K' = -1/3,1/3
# near K/K', H(k) = (Jk)_1 σ1 + (Jk)_2 σ2, with
# J = pi (√3 -√3)
# (1 1)
# for K, and columns exchanged for K'
const x = (0:1/(n):(n-1)/n)-0.5
# see e.g. https://courses.cit.cornell.edu/mse5470/handout11.pdf
const δ = @SMatrix [1/sqrt(3) -1/(2sqrt(3)) -1/(2sqrt(3));
0 1/2 -1/2]
# lattice vectors
const A = @SMatrix [sqrt(3)/2 sqrt(3)/2;
1/2 -1/2 ]
# recp lattice vectors
const B = inv(A')
#H(k+K) = tau^|K|*H(k)*(tau^|K|)'
const tau = @SMatrix [1 0;0 exp(im*2π/3)]
f(k1,k2) = sum(cis.(2π.*δ'*(B*(@SVector [k1,k2]))))
function H(k1,k2)
fk = f(k1,k2)
M = gap + 2t2*(sin(2π*k1) + sin(2π*k2) + sin(2π*(k1-k2)))
@SMatrix [M fk';
fk -M]
end
function plot_gaps()
figure()
gapk(k1,k2) = eig(Hermitian(H(k1,k2)))[1][2] - eig(Hermitian(H(k1,k2)))[1][1]
gaps = [gapk(k1,k2) for k1 in x, k2 in x]
pcolor(x,x,gaps)
colorbar()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment