Skip to content
Snippets Groups Projects
Commit 053f0af0 authored by Michael Wimmer's avatar Michael Wimmer Committed by Christoph Groth
Browse files

fix diffs of tutorial examples

parent 24c11bc2
No related branches found
No related tags found
No related merge requests found
--- original
+++ modified
@@ -9,6 +9,7 @@
@@ -12,6 +12,7 @@
# example, but in the tutorial main text)
# - Modifcations of hoppings/sites after they have been added
......@@ -8,7 +8,7 @@
from cmath import exp
from math import pi
@@ -37,12 +38,13 @@
@@ -40,12 +41,13 @@
sys[lat.shape(ring, (0, r1 + 1))] = 4 * t
sys[lat.neighbors()] = -t
......@@ -28,7 +28,7 @@
return exp(1j * phi)
def crosses_branchcut(hop):
@@ -78,6 +80,50 @@
@@ -81,6 +83,50 @@
return sys
......@@ -79,7 +79,7 @@
def plot_conductance(sys, energy, fluxes):
# compute conductance
@@ -87,18 +133,31 @@
@@ -90,18 +136,31 @@
smatrix = kwant.smatrix(sys, energy, args=[flux])
data.append(smatrix.transmission(1, 0))
......@@ -116,7 +116,7 @@
# Finalize the system.
sys = sys.finalized()
@@ -108,6 +167,17 @@
@@ -111,6 +170,17 @@
for i in xrange(100)])
......
--- original
+++ modified
@@ -6,6 +6,7 @@
@@ -9,6 +9,7 @@
# --------------------------
# - Computing the band structure of a finalized lead.
......@@ -8,7 +8,7 @@
import kwant
# For plotting.
@@ -33,10 +34,19 @@
@@ -36,10 +37,19 @@
def main():
lead = make_lead().finalized()
......
--- original
+++ modified
@@ -8,6 +8,7 @@
@@ -11,6 +11,7 @@
# - Use of `hamiltonian_submatrix` in order to obtain a Hamiltonian
# matrix.
......@@ -8,7 +8,7 @@
from cmath import exp
import numpy as np
import kwant
@@ -65,29 +66,39 @@
@@ -68,29 +69,39 @@
energies.append(ev)
......
--- original
+++ modified
@@ -8,6 +8,7 @@
@@ -11,6 +11,7 @@
# lattice, namely graphene
from __future__ import division # so that 1/2 == 0.5, and not 0
......@@ -8,7 +8,7 @@
from math import pi, sqrt, tanh
import kwant
@@ -100,22 +101,40 @@
@@ -103,22 +104,40 @@
smatrix = kwant.smatrix(sys, energy)
data.append(smatrix.transmission(0, 1))
......@@ -57,7 +57,7 @@
def main():
@@ -127,8 +146,11 @@
@@ -130,8 +149,11 @@
def family_colors(site):
return 0 if site.family == a else 1
......@@ -71,7 +71,7 @@
# Compute some eigenvalues.
compute_evs(sys.finalized())
@@ -137,9 +159,11 @@
@@ -140,9 +162,11 @@
for lead in leads:
sys.attach_lead(lead)
......
--- original
+++ modified
@@ -6,6 +6,7 @@
@@ -9,6 +9,7 @@
# --------------------------
# - demonstrate different ways of plotting
......@@ -8,7 +8,7 @@
import kwant
from matplotlib import pyplot
@@ -29,9 +30,11 @@
@@ -32,9 +33,11 @@
def plot_system(sys):
......@@ -23,7 +23,7 @@
# use color and linewidths to get a better plot
def family_color(site):
@@ -40,7 +43,11 @@
@@ -43,7 +46,11 @@
def hopping_lw(site1, site2):
return 0.04 if site1.family == site2.family else 0.1
......@@ -36,7 +36,7 @@
def plot_data(sys, n):
@@ -55,7 +62,11 @@
@@ -58,7 +65,11 @@
# the usual - works great in general, looks just a bit crufty for
# small systems
......@@ -49,7 +49,7 @@
# use two different sort of triangles to cleanly fill the space
def family_shape(i):
@@ -65,15 +76,22 @@
@@ -68,15 +79,22 @@
def family_color(i):
return 'black' if sys.site(i).family == a else 'white'
......
--- original
+++ modified
@@ -1,3 +1,4 @@
@@ -9,6 +9,7 @@
# --------------------------
# - demonstrate different ways of plotting in 3D
+import _defs
import kwant
from matplotlib import pyplot
@@ -22,7 +23,10 @@
@@ -33,7 +34,10 @@
# checking shapes:
sys = make_cuboid()
......@@ -17,7 +20,7 @@
# visualize the crystal structure better for a very small system
sys = make_cuboid(a=1.5, b=1.5, c=1.5)
@@ -30,8 +34,12 @@
@@ -41,8 +45,12 @@
def family_colors(site):
return 'r' if site.family == a else 'g'
......
--- original
+++ modified
@@ -6,6 +6,7 @@
@@ -9,6 +9,7 @@
# --------------------------
# - Functions as values in Builder
......@@ -8,7 +8,7 @@
import kwant
# For plotting
@@ -52,19 +53,25 @@
@@ -55,19 +56,25 @@
smatrix = kwant.smatrix(sys, energy, args=[-welldepth])
data.append(smatrix.transmission(1, 0))
......
--- original
+++ modified
@@ -8,6 +8,7 @@
@@ -11,6 +11,7 @@
# - Making scattering region and leads
# - Using the simple sparse solver for computing Landauer conductance
......@@ -8,7 +8,7 @@
from matplotlib import pyplot
import kwant
@@ -66,7 +67,10 @@
@@ -69,7 +70,10 @@
sys.attach_lead(right_lead)
# Plot it, to make sure it's OK
......@@ -20,7 +20,7 @@
# Finalize the system
sys = sys.finalized()
@@ -87,8 +91,13 @@
@@ -90,8 +94,13 @@
# Use matplotlib to write output
# We should see conductance steps
......
--- original
+++ modified
@@ -10,6 +10,7 @@
@@ -13,6 +13,7 @@
# --------------------------
# - Numpy matrices as values in Builder
......@@ -8,7 +8,7 @@
import kwant
# For plotting
@@ -67,19 +68,24 @@
@@ -70,19 +71,24 @@
smatrix = kwant.smatrix(sys, energy)
data.append(smatrix.transmission(1, 0))
......
--- original
+++ modified
@@ -10,6 +10,7 @@
@@ -13,6 +13,7 @@
# - Main motivation is to contrast to the implementation of superconductivity
# in tutorial5b.py
......@@ -8,7 +8,7 @@
import kwant
import numpy as np
@@ -46,11 +47,20 @@
@@ -49,11 +50,20 @@
# Make system and finalize it right away.
lead = make_lead().finalized()
......
--- original
+++ modified
@@ -7,6 +7,7 @@
@@ -10,6 +10,7 @@
# - Implementing electron and hole ("orbital") degrees of freedom
# using different lattices
......@@ -8,7 +8,7 @@
import kwant
# For plotting
@@ -82,19 +83,24 @@
@@ -85,19 +86,24 @@
smatrix.transmission(0, 0) +
smatrix.transmission(1, 0))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment