From 053f0af0b4089fe2bcd0ffef8bd148da4f0e2572 Mon Sep 17 00:00:00 2001 From: Michael Wimmer <wimmer@lorentz.leidenuniv.nl> Date: Fri, 6 Sep 2013 16:15:34 +0200 Subject: [PATCH] fix diffs of tutorial examples --- doc/source/images/ab_ring.py.diff | 10 +++++----- doc/source/images/band_structure.py.diff | 4 ++-- doc/source/images/closed_system.py.diff | 4 ++-- doc/source/images/graphene.py.diff | 8 ++++---- doc/source/images/plot_graphene.py.diff | 10 +++++----- doc/source/images/plot_zincblende.py.diff | 9 ++++++--- doc/source/images/quantum_well.py.diff | 4 ++-- doc/source/images/quantum_wire.py.diff | 6 +++--- doc/source/images/spin_orbit.py.diff | 4 ++-- .../images/superconductor_band_structure.py.diff | 4 ++-- doc/source/images/superconductor_transport.py.diff | 4 ++-- 11 files changed, 35 insertions(+), 32 deletions(-) diff --git a/doc/source/images/ab_ring.py.diff b/doc/source/images/ab_ring.py.diff index 4793b77..bacb520 100644 --- a/doc/source/images/ab_ring.py.diff +++ b/doc/source/images/ab_ring.py.diff @@ -1,6 +1,6 @@ --- 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)]) diff --git a/doc/source/images/band_structure.py.diff b/doc/source/images/band_structure.py.diff index 1a848e8..90d7354 100644 --- a/doc/source/images/band_structure.py.diff +++ b/doc/source/images/band_structure.py.diff @@ -1,6 +1,6 @@ --- 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() diff --git a/doc/source/images/closed_system.py.diff b/doc/source/images/closed_system.py.diff index 9b3c0dc..ba6e26d 100644 --- a/doc/source/images/closed_system.py.diff +++ b/doc/source/images/closed_system.py.diff @@ -1,6 +1,6 @@ --- 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) diff --git a/doc/source/images/graphene.py.diff b/doc/source/images/graphene.py.diff index 0ed96e4..b87add8 100644 --- a/doc/source/images/graphene.py.diff +++ b/doc/source/images/graphene.py.diff @@ -1,6 +1,6 @@ --- 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) diff --git a/doc/source/images/plot_graphene.py.diff b/doc/source/images/plot_graphene.py.diff index 15cd417..21ca11e 100644 --- a/doc/source/images/plot_graphene.py.diff +++ b/doc/source/images/plot_graphene.py.diff @@ -1,6 +1,6 @@ --- 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' diff --git a/doc/source/images/plot_zincblende.py.diff b/doc/source/images/plot_zincblende.py.diff index 2f5c24d..ba55ad1 100644 --- a/doc/source/images/plot_zincblende.py.diff +++ b/doc/source/images/plot_zincblende.py.diff @@ -1,11 +1,14 @@ --- 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' diff --git a/doc/source/images/quantum_well.py.diff b/doc/source/images/quantum_well.py.diff index 0d6c0fa..c7eed04 100644 --- a/doc/source/images/quantum_well.py.diff +++ b/doc/source/images/quantum_well.py.diff @@ -1,6 +1,6 @@ --- 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)) diff --git a/doc/source/images/quantum_wire.py.diff b/doc/source/images/quantum_wire.py.diff index 3edc8b0..2b39e15 100644 --- a/doc/source/images/quantum_wire.py.diff +++ b/doc/source/images/quantum_wire.py.diff @@ -1,6 +1,6 @@ --- 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 diff --git a/doc/source/images/spin_orbit.py.diff b/doc/source/images/spin_orbit.py.diff index 14b9d53..5090752 100644 --- a/doc/source/images/spin_orbit.py.diff +++ b/doc/source/images/spin_orbit.py.diff @@ -1,6 +1,6 @@ --- 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)) diff --git a/doc/source/images/superconductor_band_structure.py.diff b/doc/source/images/superconductor_band_structure.py.diff index 5fac2e2..9d62d43 100644 --- a/doc/source/images/superconductor_band_structure.py.diff +++ b/doc/source/images/superconductor_band_structure.py.diff @@ -1,6 +1,6 @@ --- 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() diff --git a/doc/source/images/superconductor_transport.py.diff b/doc/source/images/superconductor_transport.py.diff index 3fd835a..2a2501e 100644 --- a/doc/source/images/superconductor_transport.py.diff +++ b/doc/source/images/superconductor_transport.py.diff @@ -1,6 +1,6 @@ --- 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)) -- GitLab