Commit 3fc6ff94 by Christoph Groth

### simplify TranslationalSymmetry: it now takes 1d vectors as parameters directly

parent 8e7924e0
 ... ... @@ -9,7 +9,7 @@ # First, define the tight-binding system @@ -73,8 +75,9 @@ @@ -72,8 +74,9 @@ sys.attach_lead(lead1) # Plot it, to make sure it's OK ... ... @@ -21,7 +21,7 @@ # Finalize the system @@ -98,8 +101,13 @@ @@ -97,8 +100,13 @@ # Use matplotlib to write output # We should see conductance steps ... ...
 ... ... @@ -22,7 +22,7 @@ + sys[lat.shape(ring, (0, 11))] = 4 * t + for hopping in lat.nearest: + sys[sys.possible_hoppings(*hopping)] = -t + sym_lead0 = kwant.TranslationalSymmetry([lat.vec((-1, 0))]) + sym_lead0 = kwant.TranslationalSymmetry((-a, 0)) + lead0 = kwant.Builder(sym_lead0) + def lead_shape(pos): + (x, y) = pos ... ... @@ -46,7 +46,7 @@ + sys[lat.shape(ring, (0, 11))] = 4 * t + for hopping in lat.nearest: + sys[sys.possible_hoppings(*hopping)] = -t + sym_lead0 = kwant.TranslationalSymmetry([lat.vec((-1, 0))]) + sym_lead0 = kwant.TranslationalSymmetry((-a, 0)) + lead0 = kwant.Builder(sym_lead0) + def lead_shape(pos): + (x, y) = pos ... ...
 ... ... @@ -8,7 +8,7 @@ # global variable governing the behavior of potential() in # make_system() @@ -76,19 +77,25 @@ @@ -74,19 +75,25 @@ smatrix = kwant.solve(sys, energy) data.append(smatrix.transmission(1, 0)) ... ...
 ... ... @@ -8,7 +8,7 @@ def make_system(a=1, W=10, L=10, barrier=1.5, barrierpos=(3, 4), @@ -95,19 +96,23 @@ @@ -94,19 +95,23 @@ smatrix.transmission(0, 0) + smatrix.transmission(1, 0)) ... ...
 ... ... @@ -49,10 +49,9 @@ for i in xrange(L): # First the lead to the left # (Note: in the current version, TranslationalSymmetry takes a # realspace vector) # (Note: TranslationalSymmetry takes a real space vector) #HIDDEN_BEGIN_xcmc sym_lead0 = kwant.TranslationalSymmetry([lat.vec((-1, 0))]) sym_lead0 = kwant.TranslationalSymmetry((-a, 0)) lead0 = kwant.Builder(sym_lead0) #HIDDEN_END_xcmc ... ... @@ -69,7 +68,7 @@ for j in xrange(W): # Then the lead to the right #HIDDEN_BEGIN_xhqc sym_lead1 = kwant.TranslationalSymmetry([lat.vec((1, 0))]) sym_lead1 = kwant.TranslationalSymmetry((a, 0)) lead1 = kwant.Builder(sym_lead1) for j in xrange(W): ... ...
 ... ... @@ -36,10 +36,9 @@ def make_system(a=1, t=1.0, W=10, L=30): #### Define the leads. #### # First the lead to the left, ... # (Note: in the current version, TranslationalSymmetry takes a # realspace vector) # (Note: TranslationalSymmetry takes a real space vector) #HIDDEN_BEGIN_iepx sym_lead0 = kwant.TranslationalSymmetry([lat.vec((-1, 0))]) sym_lead0 = kwant.TranslationalSymmetry((-a, 0)) lead0 = kwant.Builder(sym_lead0) lead0[(lat(0, j) for j in xrange(W))] = 4 * t ... ...
 ... ... @@ -49,9 +49,7 @@ def make_system(a=1, t=1.0, W=10, L=30, L_well=10): #### Define the leads. #### # First the lead to the left, ... # (Note: in the current version, TranslationalSymmetry takes a # realspace vector) sym_lead0 = kwant.TranslationalSymmetry([lat.vec((-1, 0))]) sym_lead0 = kwant.TranslationalSymmetry((-a, 0)) lead0 = kwant.Builder(sym_lead0) lead0[(lat(0, j) for j in xrange(W))] = 4 * t ... ...
 ... ... @@ -50,7 +50,7 @@ def make_system(a=1, t=1.0, alpha=0.5, e_z=0.08, W=10, L=30): #### Define the leads. #### # left lead sym_lead0 = kwant.TranslationalSymmetry([lat.vec((-1, 0))]) sym_lead0 = kwant.TranslationalSymmetry((-a, 0)) lead0 = kwant.Builder(sym_lead0) #HIDDEN_BEGIN_yliu ... ...
 ... ... @@ -67,7 +67,7 @@ def make_system(r=10, w=2.0, pot=0.1): #### Define the leads. #### #HIDDEN_BEGIN_aakh # left lead sym0 = kwant.TranslationalSymmetry([graphene.vec((-1, 0))]) sym0 = kwant.TranslationalSymmetry(graphene.vec((-1, 0))) def lead0_shape(pos): x, y = pos ... ... @@ -79,7 +79,7 @@ def make_system(r=10, w=2.0, pot=0.1): lead0[lead0.possible_hoppings(*hopping)] = -1 # The second lead, going to the top right sym1 = kwant.TranslationalSymmetry([graphene.vec((0, 1))]) sym1 = kwant.TranslationalSymmetry(graphene.vec((0, 1))) def lead1_shape(pos): x, y = pos ... ... @@ -140,7 +140,7 @@ def plot_bandstructure(flead, momenta): pyplot.show() #HIDDEN The part of the following code block which begins with plotter_symbols #HIDDEN The part of the following code block which begins with group_colors #HIDDEN is included verbatim in the tutorial text because nested code examples #HIDDEN are not supported. Remember to update the tutorial text when you #HIDDEN modify this block. ... ...