1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
| from math import pi, sqrt, tanh import kwant import scipy.sparse.linalg as sla from matplotlib import pyplot
sin_30, cos_30 = (1 / 2, sqrt(3) / 2) graphene = kwant.lattice.general([(1, 0), (sin_30, cos_30)], [(0, 0), (0, 1 / sqrt(3))]) a, b = graphene.sublattices;
def make_system(r=10, w=2.0, pot=0.1):
def circle(pos): x, y = pos return x ** 2 + y ** 2 < r ** 2
syst = kwant.Builder()
def potential(site): (x, y) = site.pos d = y * cos_30 + x * sin_30 return pot * tanh(d / w)
syst[graphene.shape(circle, (0, 0))] = potential
hoppings = (((0, 0), a, b), ((0, 1), a, b), ((-1, 1), a, b)) syst[[kwant.builder.HoppingKind(*hopping) for hopping in hoppings]] = -1
del syst[a(0, 0)] syst[a(-2, 1), b(2, 2)] = -1
sym0 = kwant.TranslationalSymmetry(graphene.vec((-1, 0)))
def lead0_shape(pos): x, y = pos return (-0.4 * r < y < 0.4 * r)
lead0 = kwant.Builder(sym0) lead0[graphene.shape(lead0_shape, (0, 0))] = -pot lead0[[kwant.builder.HoppingKind(*hopping) for hopping in hoppings]] = -1
sym1 = kwant.TranslationalSymmetry(graphene.vec((0, 1)))
def lead1_shape(pos): v = pos[1] * sin_30 - pos[0] * cos_30 return (-0.4 * r < v < 0.4 * r)
lead1 = kwant.Builder(sym1) lead1[graphene.shape(lead1_shape, (0, 0))] = pot lead1[[kwant.builder.HoppingKind(*hopping) for hopping in hoppings]] = -1
return syst, [lead0, lead1]
def compute_evs(syst): sparse_mat = syst.hamiltonian_submatrix(sparse=True)
evs = sla.eigs(sparse_mat, 2)[0] print(evs.real)
def plot_conductance(syst, energies): data = [] for energy in energies: smatrix = kwant.smatrix(syst, energy) data.append(smatrix.transmission(0, 1))
pyplot.figure() pyplot.plot(energies, data) pyplot.xlabel("energy [t]") pyplot.ylabel("conductance [e^2/h]") pyplot.show()
def plot_bandstructure(flead, momenta): bands = kwant.physics.Bands(flead) energies = [bands(k) for k in momenta]
pyplot.figure() pyplot.plot(momenta, energies) pyplot.xlabel("momentum [(lattice constant)^-1]") pyplot.ylabel("energy [t]") pyplot.show()
def main(): pot = 0.1 syst, leads = make_system(pot=pot)
def family_colors(site): return 0 if site.family == a else 1
kwant.plot(syst, site_color=family_colors, site_lw=0.1, colorbar=False)
compute_evs(syst.finalized())
for lead in leads: syst.attach_lead(lead)
kwant.plot(syst, site_color=family_colors, site_lw=0.1, lead_site_lw=0, colorbar=False)
syst = syst.finalized()
momenta = [-pi + 0.02 * pi * i for i in range(101)] plot_bandstructure(syst.leads[0], momenta)
energies = [-2 * pot + 4. / 50. * pot * i for i in range(51)] plot_conductance(syst, energies)
if __name__ == '__main__': main()
|