From 98924b3bfe5c68af26a64f5f0f25c04b48758487 Mon Sep 17 00:00:00 2001
From: Michael Wimmer <wimmer@lorentz.leidenuniv.nl>
Date: Tue, 10 Apr 2012 15:50:36 +0200
Subject: [PATCH] new tutorial dealing with superconductivity

---
 doc/Makefile                            |  16 +-
 doc/source/images/tutorial5a.py         |  80 ++++++
 doc/source/images/tutorial5b.py         | 125 +++++++++
 doc/source/images/tutorial5b_sketch.svg | 325 ++++++++++++++++++++++++
 doc/source/tutorial/index.rst           |   1 +
 doc/source/tutorial/tutorial5.rst       | 173 +++++++++++++
 doc/source/whatsnew/0.2.rst             |   4 +
 examples/tutorial5a.py                  |  70 +++++
 examples/tutorial5b.py                  | 117 +++++++++
 9 files changed, 910 insertions(+), 1 deletion(-)
 create mode 100644 doc/source/images/tutorial5a.py
 create mode 100644 doc/source/images/tutorial5b.py
 create mode 100644 doc/source/images/tutorial5b_sketch.svg
 create mode 100644 doc/source/tutorial/tutorial5.rst
 create mode 100644 examples/tutorial5a.py
 create mode 100644 examples/tutorial5b.py

diff --git a/doc/Makefile b/doc/Makefile
index abe401ad..da1b700b 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -26,7 +26,9 @@ TUTORIAL2C_IMAGES = source/images/tutorial2c_result.png source/images/tutorial2c
 TUTORIAL3A_IMAGES = source/images/tutorial3a_result.png source/images/tutorial3a_result.pdf
 TUTORIAL3B_IMAGES = source/images/tutorial3b_result.png source/images/tutorial3b_result.pdf source/images/tutorial3b_sys.png source/images/tutorial3b_sys.pdf
 TUTORIAL4_IMAGES = source/images/tutorial4_result.png source/images/tutorial4_result.pdf source/images/tutorial4_sys1.png source/images/tutorial4_sys1.pdf source/images/tutorial4_sys2.png source/images/tutorial4_sys2.pdf source/images/tutorial4_bs.png source/images/tutorial4_bs.pdf
-ALL_TUTORIAL_IMAGES = $(TUTORIAL1A_IMAGES)  $(TUTORIAL2A_IMAGES) $(TUTORIAL2B_IMAGES) $(TUTORIAL2C_IMAGES) $(TUTORIAL3A_IMAGES) $(TUTORIAL3B_IMAGES) $(TUTORIAL4_IMAGES)
+TUTORIAL5A_IMAGES = source/images/tutorial5a_result.png source/images/tutorial5a_result.pdf
+TUTORIAL5B_IMAGES = source/images/tutorial5b_result.png source/images/tutorial5b_result.pdf
+ALL_TUTORIAL_IMAGES = $(TUTORIAL1A_IMAGES)  $(TUTORIAL2A_IMAGES) $(TUTORIAL2B_IMAGES) $(TUTORIAL2C_IMAGES) $(TUTORIAL3A_IMAGES) $(TUTORIAL3B_IMAGES) $(TUTORIAL4_IMAGES) $(TUTORIAL5A_IMAGES) $(TUTORIAL5B_IMAGES)
 
 .PHONY: help clean realclean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest
 
@@ -154,3 +156,15 @@ $(TUTORIAL4_IMAGES): source/images/.tutorial4_flag
 source/images/.tutorial4_flag: source/images/tutorial4.py
 	cd source/images/ && python tutorial4.py
 	touch source/images/.tutorial4_flag
+
+$(TUTORIAL5A_IMAGES): source/images/.tutorial5a_flag
+	@:
+source/images/.tutorial5a_flag: source/images/tutorial5a.py
+	cd source/images/ && python tutorial5a.py
+	touch source/images/.tutorial5a_flag
+
+$(TUTORIAL5B_IMAGES): source/images/.tutorial5b_flag
+	@:
+source/images/.tutorial5b_flag: source/images/tutorial5b.py
+	cd source/images/ && python tutorial5b.py
+	touch source/images/.tutorial5b_flag
diff --git a/doc/source/images/tutorial5a.py b/doc/source/images/tutorial5a.py
new file mode 100644
index 00000000..8d54f0ef
--- /dev/null
+++ b/doc/source/images/tutorial5a.py
@@ -0,0 +1,80 @@
+# Physics background
+# ------------------
+#  band structure of a superconducting quantum wire in tight-binding
+#  approximation
+#
+# Kwant features highlighted
+# --------------------------
+#  - Repetition of previously used concepts (band structure calculations,
+#    matrices as values in Builder).
+#  - Main motivation is to contrast to the implementation of superconductivity
+#    in tutorial5b.py
+
+import kwant
+import latex, html
+
+import numpy as np
+from math import pi
+
+# For plotting
+import pylab
+
+tau_x = np.array([[0,1],[1,0]])
+tau_z = np.array([[1,0],[0,-1]])
+
+def make_lead(a=1, t=1.0, mu=0.7, Delta=0.1, W=10):
+    # Start with an empty lead with a single square lattice
+    lat = kwant.lattice.Square(a)
+
+    sym_lead = kwant.TranslationalSymmetry([lat.vec((-1, 0))])
+    lead = kwant.Builder(sym_lead)
+    lead.default_site_group = lat
+
+    # build up one unit cell of the lead, and add the hoppings
+    # to the next unit cell
+    for j in xrange(W):
+        lead[(0, j)] = (4 * t - mu) * tau_z + Delta * tau_x
+
+        if j > 0:
+            lead[(0, j), (0, j-1)] = - t * tau_z
+
+        lead[(1, j), (0, j)] = - t * tau_z
+
+    # return a finalized lead
+    return lead.finalized()
+
+
+def plot_bandstructure(flead, momenta):
+    # Use the method ``energies`` of the finalized lead to compute
+    # the bandstructure
+    energy_list = [flead.energies(k) for k in momenta]
+
+    pylab.plot(momenta, energy_list)
+    pylab.xlabel("momentum [in untis of (lattice constant)^-1]")
+    pylab.ylabel("energy [in units of t]")
+    pylab.ylim([-0.8, 0.8])
+    fig = pylab.gcf()
+    pylab.setp(fig.get_axes()[0].get_xticklabels(),
+               fontsize=latex.mpl_tick_size)
+    pylab.setp(fig.get_axes()[0].get_yticklabels(),
+               fontsize=latex.mpl_tick_size)
+    fig.set_size_inches(latex.mpl_width_in, latex.mpl_width_in*3./4.)
+    fig.subplots_adjust(left=0.15, right=0.95, top=0.95, bottom=0.15)
+    fig.savefig("tutorial5a_result.pdf")
+    fig.savefig("tutorial5a_result.png",
+                dpi=(html.figwidth_px/latex.mpl_width_in))
+
+
+def main():
+    flead = make_lead()
+
+    # list of momenta at which the bands should be computed
+    momenta = np.arange(-1.5, 1.5 + .0001, 0.002 * pi)
+
+    plot_bandstructure(flead, momenta)
+
+
+# Call the main function if the script gets executed (as opposed to imported).
+# See <http://docs.python.org/library/__main__.html>.
+if __name__ == '__main__':
+    main()
diff --git a/doc/source/images/tutorial5b.py b/doc/source/images/tutorial5b.py
new file mode 100644
index 00000000..322b1201
--- /dev/null
+++ b/doc/source/images/tutorial5b.py
@@ -0,0 +1,125 @@
+# Physics background
+# ------------------
+# - conductance of a NS-junction (Andreev reflection, superconducting gap)
+#
+# Kwant features highlighted
+# --------------------------
+# - Implementing electron and hole ("orbital") degrees of freedom
+#   using different lattices
+
+import kwant
+import latex, html
+
+# For plotting
+import pylab
+
+# For matrix support
+import numpy
+
+def make_system(a=1, W=10, L=10, barrier=1.5, barrierpos=(3, 4),
+                mu=0.4, Delta=0.1, Deltapos=4, t=1.0):
+    # Start with an empty tight-binding system and two square lattices,
+    # corresponding to electron and hole degree of freedom
+    lat_e = kwant.lattice.Square(a)
+    lat_h = kwant.lattice.Square(a)
+
+    sys = kwant.Builder()
+
+    #### Define the scattering region. ####
+    sys[(lat_e(x, y) for x in range(L) for y in range(W))] = 4 * t - mu
+    sys[(lat_h(x, y) for x in range(L) for y in range(W))] = mu - 4 * t
+
+    # the tunnel barrier
+    sys[(lat_e(x, y) for x in range(barrierpos[0], barrierpos[1])
+         for y in range(W))] = 4 * t + barrier - mu
+    sys[(lat_h(x, y) for x in range(barrierpos[0], barrierpos[1])
+         for y in range(W))] = mu - 4 * t - barrier
+
+    # hoppings in x and y-directions, for both electrons and holes
+    sys[sys.possible_hoppings((1, 0), lat_e, lat_e)] = - t
+    sys[sys.possible_hoppings((0, 1), lat_e, lat_e)] = - t
+    sys[sys.possible_hoppings((1, 0), lat_h, lat_h)] = t
+    sys[sys.possible_hoppings((0, 1), lat_h, lat_h)] = t
+
+    # Superconducting order parameter enters as hopping between
+    # electrons and holes
+    sys[((lat_e(x,y), lat_h(x, y)) for x in range(Deltapos, L)
+         for y in range(W))] = Delta
+
+    #### Define the leads. ####
+    # left electron lead
+    sym_lead0 = kwant.TranslationalSymmetry([lat_e.vec((-1, 0))])
+    lead0 = kwant.Builder(sym_lead0)
+
+    lead0[(lat_e(0, j) for j in xrange(W))] = 4 * t - mu
+    # hoppings in x and y-direction
+    lead0[lead0.possible_hoppings((1, 0), lat_e, lat_e)] = - t
+    lead0[lead0.possible_hoppings((0, 1), lat_e, lat_e)] = - t
+
+    # left hole lead
+    sym_lead1 = kwant.TranslationalSymmetry([lat_h.vec((-1, 0))])
+    lead1 = kwant.Builder(sym_lead1)
+
+    lead1[(lat_h(0, j) for j in xrange(W))] = mu - 4 * t
+    # hoppings in x and y-direction
+    lead1[lead1.possible_hoppings((1, 0), lat_h, lat_h)] = t
+    lead1[lead1.possible_hoppings((0, 1), lat_h, lat_h)] = t
+
+    # Then the lead to the right
+    # this one is superconducting and thus is comprised of electrons
+    # AND holes
+    sym_lead2 = kwant.TranslationalSymmetry([lat_e.vec((1, 0))])
+    lead2 = kwant.Builder(sym_lead2)
+
+    lead2[(lat_e(0, j) for j in xrange(W))] = 4 * t - mu
+    lead2[(lat_h(0, j) for j in xrange(W))] = mu - 4 * t
+    # hoppings in x and y-direction
+    lead2[lead2.possible_hoppings((1, 0), lat_e, lat_e)] = - t
+    lead2[lead2.possible_hoppings((0, 1), lat_e, lat_e)] = - t
+    lead2[lead2.possible_hoppings((1, 0), lat_h, lat_h)] = t
+    lead2[lead2.possible_hoppings((0, 1), lat_h, lat_h)] = t
+    lead2[((lat_e(0, j), lat_h(0, j)) for j in xrange(W))] = Delta
+
+    #### Attach the leads and return the finalized system. ####
+    sys.attach_lead(lead0)
+    sys.attach_lead(lead1)
+    sys.attach_lead(lead2)
+
+    return sys.finalized()
+
+def plot_conductance(fsys, energies):
+    # Compute conductance
+    data = []
+    for energy in energies:
+        smatrix = kwant.solve(fsys, energy)
+        # Conductance is N - R_ee + R_he
+        data.append(smatrix.submatrix(0, 0).shape[0] -
+                    smatrix.transmission(0, 0) +
+                    smatrix.transmission(1, 0))
+
+    pylab.plot(energies, data)
+    pylab.xlabel("energy [in units of t]")
+    pylab.ylabel("conductance [in units of e^2/h]")
+    fig = pylab.gcf()
+    pylab.setp(fig.get_axes()[0].get_xticklabels(),
+               fontsize=latex.mpl_tick_size)
+    pylab.setp(fig.get_axes()[0].get_yticklabels(),
+               fontsize=latex.mpl_tick_size)
+    fig.set_size_inches(latex.mpl_width_in, latex.mpl_width_in*3./4.)
+    fig.subplots_adjust(left=0.15, right=0.95, top=0.95, bottom=0.15)
+    fig.savefig("tutorial5b_result.pdf")
+    fig.savefig("tutorial5b_result.png",
+                dpi=(html.figwidth_px/latex.mpl_width_in))
+
+
+
+def main():
+    fsys = make_system()
+
+    plot_conductance(fsys, energies=[0.002 * i for i in xrange(100)])
+
+
+# Call the main function if the script gets executed (as opposed to imported).
+# See <http://docs.python.org/library/__main__.html>.
+if __name__ == '__main__':
+    main()
diff --git a/doc/source/images/tutorial5b_sketch.svg b/doc/source/images/tutorial5b_sketch.svg
new file mode 100644
index 00000000..35f087cd
--- /dev/null
+++ b/doc/source/images/tutorial5b_sketch.svg
@@ -0,0 +1,325 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="236.85225"
+   height="102.88937"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.47 r22583"
+   sodipodi:docname="tutorial5b_sketch.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   version="1.0">
+  <defs
+     id="defs4">
+    <marker
+       inkscape:stockid="Arrow1Mend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow1Mend"
+       style="overflow:visible">
+      <path
+         id="path5182"
+         d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+         style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
+         transform="matrix(-0.4,0,0,-0.4,-4,0)" />
+    </marker>
+    <pattern
+       inkscape:stockid="Stripes 1:2"
+       id="Strips1_2"
+       patternTransform="matrix(0.93049189,-0.87551382,1.8365019,1.9518254,0,0)"
+       height="1"
+       width="3"
+       patternUnits="userSpaceOnUse"
+       inkscape:collect="always">
+      <rect
+         id="rect4444"
+         height="2"
+         width="1"
+         y="-0.5"
+         x="0"
+         style="fill:black;stroke:none" />
+    </pattern>
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective3026" />
+    <inkscape:perspective
+       id="perspective3635"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <inkscape:perspective
+       id="perspective3695"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="2.5106232"
+     inkscape:cx="34.418931"
+     inkscape:cy="46.021777"
+     inkscape:document-units="mm"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:object-nodes="true"
+     inkscape:grid-points="true"
+     gridtolerance="1.3"
+     objecttolerance="0.8"
+     gridanglex="8.4666669mm"
+     gridanglez="8.4666669mm"
+     grid_units="mm"
+     inkscape:window-width="1399"
+     inkscape:window-height="974"
+     inkscape:window-x="57"
+     inkscape:window-y="0"
+     inkscape:window-maximized="0"
+     units="pt"
+     inkscape:snap-bbox="true">
+    <inkscape:grid
+       id="GridFromPre046Settings"
+       type="xygrid"
+       originx="0px"
+       originy="0px"
+       spacingx="2mm"
+       spacingy="2mm"
+       color="#0000ff"
+       empcolor="#ff0400"
+       opacity="0.2"
+       empopacity="0.37647059"
+       empspacing="5"
+       units="mm"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Ebene 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-127.3091,-26.863735)">
+    <rect
+       style="opacity:0.95;fill:#858585;fill-opacity:1;stroke:none"
+       id="rect2911"
+       width="113.38583"
+       height="56.692913"
+       x="248.84453"
+       y="44.012253" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:2.12598419;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 248.0315,63.267717 -233.858272,0"
+       id="path3685"
+       transform="translate(114.19886,-19.255464)"
+       sodipodi:nodetypes="cc" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:2.12598419;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 363.09835,100.70517 -233.85827,0"
+       id="path3685-7"
+       sodipodi:nodetypes="cc" />
+    <rect
+       style="opacity:0.95;fill:url(#Strips1_2);fill-opacity:1;stroke:none"
+       id="rect3709"
+       width="15.135684"
+       height="55.763046"
+       x="220.49808"
+       y="44.012253" />
+    <g
+       style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Times;-inkscape-font-specification:Times"
+       id="text5156">
+      <path
+         d="m 133.86818,32.019985 0,3.960938 -1.07813,0 0,-3.925782 c 0,-0.621089 -0.12109,-1.085932 -0.36328,-1.394531 -0.24219,-0.308588 -0.60547,-0.462885 -1.08984,-0.46289 -0.58204,5e-6 -1.04102,0.185552 -1.37695,0.55664 -0.33594,0.371099 -0.50391,0.876958 -0.50391,1.517578 l 0,3.708985 -1.08398,0 0,-6.5625 1.08398,0 0,1.019531 c 0.25781,-0.394525 0.56054,-0.689447 0.9082,-0.884766 0.35156,-0.195306 0.75586,-0.292962 1.21289,-0.292968 0.7539,6e-6 1.32422,0.234381 1.71094,0.703125 0.38671,0.464849 0.58007,1.150395 0.58008,2.05664"
+         style=""
+         id="path5623" />
+      <path
+         d="m 138.57326,30.174282 c -0.57813,6e-6 -1.03516,0.226568 -1.3711,0.679688 -0.33594,0.449223 -0.5039,1.06641 -0.5039,1.851562 0,0.785159 0.16601,1.404299 0.49804,1.857422 0.33594,0.44922 0.79492,0.673829 1.37696,0.673828 0.57421,1e-6 1.02929,-0.226561 1.36523,-0.679687 0.33593,-0.453124 0.5039,-1.07031 0.50391,-1.851563 -1e-5,-0.77734 -0.16798,-1.392573 -0.50391,-1.845703 -0.33594,-0.457026 -0.79102,-0.685541 -1.36523,-0.685547 m 0,-0.914062 c 0.93749,6e-6 1.67382,0.304693 2.20898,0.914062 0.53515,0.60938 0.80273,1.453129 0.80274,2.53125 -1e-5,1.074221 -0.26759,1.91797 -0.80274,2.53125 -0.53516,0.609375 -1.27149,0.914062 -2.20898,0.914063 -0.94141,-10e-7 -1.67969,-0.304688 -2.21485,-0.914063 -0.53125,-0.61328 -0.79687,-1.457029 -0.79687,-2.53125 0,-1.078121 0.26562,-1.92187 0.79687,-2.53125 0.53516,-0.609369 1.27344,-0.914056 2.21485,-0.914062"
+         style=""
+         id="path5625" />
+      <path
+         d="m 147.16896,30.426235 c -0.1211,-0.07031 -0.25391,-0.121088 -0.39844,-0.152344 -0.14063,-0.03515 -0.29688,-0.05273 -0.46875,-0.05273 -0.60938,6e-6 -1.07812,0.199224 -1.40625,0.597656 -0.32422,0.394536 -0.48633,0.962895 -0.48633,1.705078 l 0,3.457032 -1.08398,0 0,-6.5625 1.08398,0 0,1.019531 c 0.22657,-0.398432 0.52149,-0.693353 0.88477,-0.884766 0.36328,-0.195306 0.80468,-0.292962 1.32422,-0.292968 0.0742,6e-6 0.15624,0.0059 0.24609,0.01758 0.0898,0.0078 0.18945,0.02149 0.29883,0.04101 l 0.006,1.107422"
+         style=""
+         id="path5627" />
+      <path
+         d="m 153.20998,30.678188 c 0.26952,-0.484369 0.59179,-0.84179 0.96679,-1.072265 0.375,-0.230462 0.8164,-0.345697 1.32422,-0.345703 0.68359,6e-6 1.21093,0.24024 1.58203,0.720703 0.37109,0.476568 0.55663,1.156255 0.55664,2.039062 l 0,3.960938 -1.08398,0 0,-3.925782 c -1e-5,-0.628901 -0.11134,-1.095698 -0.33399,-1.40039 -0.22266,-0.304682 -0.5625,-0.457026 -1.01953,-0.457031 -0.5586,5e-6 -1,0.185552 -1.32422,0.55664 -0.32422,0.371099 -0.48633,0.876958 -0.48632,1.517578 l 0,3.708985 -1.08399,0 0,-3.925782 c 0,-0.632807 -0.11133,-1.099604 -0.33398,-1.40039 -0.22266,-0.304682 -0.56641,-0.457026 -1.03125,-0.457031 -0.55079,5e-6 -0.98829,0.187505 -1.3125,0.5625 -0.32422,0.371098 -0.48633,0.875004 -0.48633,1.511718 l 0,3.708985 -1.08398,0 0,-6.5625 1.08398,0 0,1.019531 c 0.24609,-0.402338 0.54101,-0.699213 0.88477,-0.890625 0.34374,-0.1914 0.75194,-0.287103 1.2246,-0.287109 0.47656,6e-6 0.88086,0.1211 1.2129,0.363281 0.33593,0.242193 0.58397,0.593756 0.74414,1.054687"
+         style=""
+         id="path5629" />
+      <path
+         d="m 162.7549,32.682095 c -0.8711,3e-6 -1.47461,0.09961 -1.81055,0.298828 -0.33594,0.199221 -0.50391,0.539065 -0.50391,1.019531 0,0.382814 0.125,0.687501 0.375,0.914062 0.25391,0.222658 0.59766,0.333986 1.03125,0.333985 0.59766,1e-6 1.07617,-0.210937 1.43555,-0.632813 0.36328,-0.425779 0.54492,-0.990232 0.54492,-1.693359 l 0,-0.240234 -1.07226,0 m 2.15039,-0.445313 0,3.744141 -1.07813,0 0,-0.996094 c -0.24609,0.398438 -0.55274,0.69336 -0.91992,0.884766 -0.36719,0.187499 -0.81641,0.281249 -1.34765,0.28125 -0.67188,-10e-7 -1.20704,-0.1875 -1.60547,-0.5625 -0.39454,-0.378906 -0.5918,-0.884765 -0.5918,-1.517579 0,-0.738278 0.24609,-1.294918 0.73828,-1.669921 0.49609,-0.374996 1.23437,-0.562496 2.21484,-0.5625 l 1.51172,0 0,-0.105469 c 0,-0.496089 -0.16406,-0.878901 -0.49218,-1.148438 -0.32423,-0.273432 -0.78126,-0.41015 -1.3711,-0.410156 -0.375,6e-6 -0.74023,0.04493 -1.0957,0.134766 -0.35547,0.08985 -0.69727,0.224615 -1.02539,0.404297 l 0,-0.996094 c 0.39453,-0.152338 0.77734,-0.265619 1.14844,-0.339844 0.37109,-0.07812 0.73241,-0.117181 1.08398,-0.117187 0.94921,6e-6 1.6582,0.2461 2.12695,0.738281 0.46875,0.492193 0.70312,1.238286 0.70313,2.238281"
+         style=""
+         id="path5631" />
+      <path
+         d="m 167.15529,26.863735 1.07812,0 0,9.117188 -1.07812,0 0,-9.117188"
+         style=""
+         id="path5633" />
+      <path
+         d="m 174.30373,26.863735 1.07812,0 0,9.117188 -1.07812,0 0,-9.117188"
+         style=""
+         id="path5635" />
+      <path
+         d="m 183.24513,32.430141 0,0.527344 -4.95703,0 c 0.0469,0.74219 0.26953,1.308596 0.66797,1.699219 0.40234,0.38672 0.96093,0.580079 1.67578,0.580078 0.41406,1e-6 0.81445,-0.05078 1.20117,-0.152344 0.39062,-0.101561 0.77734,-0.253905 1.16016,-0.457031 l 0,1.019531 c -0.38673,0.164063 -0.78321,0.289063 -1.18945,0.375 -0.40626,0.08594 -0.81837,0.128906 -1.23633,0.128907 -1.04688,-10e-7 -1.87696,-0.304688 -2.49024,-0.914063 -0.60937,-0.609374 -0.91406,-1.433591 -0.91406,-2.472656 0,-1.074215 0.28906,-1.925776 0.86719,-2.554688 0.58203,-0.632806 1.36523,-0.949212 2.34961,-0.949218 0.88281,6e-6 1.58007,0.285162 2.09179,0.855468 0.51562,0.566412 0.77344,1.337895 0.77344,2.314453 m -1.07812,-0.316406 c -0.008,-0.589839 -0.17384,-1.060542 -0.49805,-1.412109 -0.32032,-0.351557 -0.7461,-0.527338 -1.27734,-0.527344 -0.60157,6e-6 -1.08399,0.169928 -1.44727,0.509766 -0.35938,0.339848 -0.56641,0.818364 -0.62109,1.435547 l 3.84375,-0.0059"
+         style=""
+         id="path5637" />
+      <path
+         d="m 187.97365,32.682095 c -0.8711,3e-6 -1.47461,0.09961 -1.81055,0.298828 -0.33594,0.199221 -0.50391,0.539065 -0.50391,1.019531 0,0.382814 0.125,0.687501 0.375,0.914062 0.25391,0.222658 0.59766,0.333986 1.03125,0.333985 0.59766,1e-6 1.07617,-0.210937 1.43555,-0.632813 0.36328,-0.425779 0.54492,-0.990232 0.54492,-1.693359 l 0,-0.240234 -1.07226,0 m 2.15039,-0.445313 0,3.744141 -1.07813,0 0,-0.996094 c -0.24609,0.398438 -0.55274,0.69336 -0.91992,0.884766 -0.36719,0.187499 -0.81641,0.281249 -1.34765,0.28125 -0.67188,-10e-7 -1.20704,-0.1875 -1.60547,-0.5625 -0.39454,-0.378906 -0.5918,-0.884765 -0.5918,-1.517579 0,-0.738278 0.24609,-1.294918 0.73828,-1.669921 0.49609,-0.374996 1.23437,-0.562496 2.21484,-0.5625 l 1.51172,0 0,-0.105469 c 0,-0.496089 -0.16406,-0.878901 -0.49218,-1.148438 -0.32423,-0.273432 -0.78126,-0.41015 -1.3711,-0.410156 -0.375,6e-6 -0.74023,0.04493 -1.0957,0.134766 -0.35547,0.08985 -0.69727,0.224615 -1.02539,0.404297 l 0,-0.996094 c 0.39453,-0.152338 0.77734,-0.265619 1.14844,-0.339844 0.37109,-0.07812 0.73241,-0.117181 1.08398,-0.117187 0.94921,6e-6 1.6582,0.2461 2.12695,0.738281 0.46875,0.492193 0.70312,1.238286 0.70313,2.238281"
+         style=""
+         id="path5639" />
+      <path
+         d="m 196.6924,30.414516 0,-3.550781 1.07812,0 0,9.117188 -1.07812,0 0,-0.984375 c -0.22657,0.390625 -0.51368,0.681641 -0.86133,0.873047 -0.34375,0.187499 -0.75782,0.281249 -1.24219,0.28125 -0.79297,-10e-7 -1.43945,-0.316407 -1.93945,-0.949219 -0.4961,-0.632811 -0.74414,-1.464842 -0.74414,-2.496094 0,-1.031246 0.24804,-1.863276 0.74414,-2.496094 0.5,-0.632806 1.14648,-0.949212 1.93945,-0.949218 0.48437,6e-6 0.89844,0.09571 1.24219,0.287109 0.34765,0.187506 0.63476,0.476568 0.86133,0.867187 m -3.67383,2.291016 c 0,0.792971 0.16211,1.416018 0.48633,1.869141 0.32812,0.449219 0.77734,0.673829 1.34765,0.673828 0.57031,1e-6 1.01953,-0.224609 1.34766,-0.673828 0.32812,-0.453123 0.49218,-1.07617 0.49219,-1.869141 -1e-5,-0.792965 -0.16407,-1.414058 -0.49219,-1.863281 -0.32813,-0.45312 -0.77735,-0.679682 -1.34766,-0.679688 -0.57031,6e-6 -1.01953,0.226568 -1.34765,0.679688 -0.32422,0.449223 -0.48633,1.070316 -0.48633,1.863281"
+         style=""
+         id="path5641" />
+    </g>
+    <g
+       style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Times;-inkscape-font-specification:Times"
+       id="text5160">
+      <path
+         d="m 272.46338,30.556499 0,1.019532 c -0.30469,-0.156245 -0.6211,-0.273432 -0.94922,-0.351563 -0.32813,-0.07812 -0.66797,-0.117181 -1.01953,-0.117187 -0.53516,6e-6 -0.9375,0.08204 -1.20703,0.246093 -0.26563,0.164068 -0.39844,0.410162 -0.39844,0.738282 0,0.250004 0.0957,0.44727 0.28711,0.591797 0.1914,0.140629 0.57617,0.275394 1.1543,0.404296 l 0.36914,0.08203 c 0.76562,0.164066 1.30859,0.396487 1.6289,0.697265 0.32422,0.296878 0.48633,0.712893 0.48633,1.248047 0,0.609376 -0.24219,1.091798 -0.72656,1.447266 -0.48047,0.355469 -1.14258,0.533203 -1.98633,0.533203 -0.35156,0 -0.71875,-0.03516 -1.10156,-0.105469 -0.37891,-0.06641 -0.7793,-0.167968 -1.20117,-0.304687 l 0,-1.113282 c 0.39843,0.207033 0.79101,0.363283 1.17773,0.46875 0.38672,0.101564 0.76953,0.152345 1.14844,0.152344 0.50781,10e-7 0.89843,-0.08594 1.17187,-0.257812 0.27344,-0.17578 0.41015,-0.421874 0.41016,-0.738282 -10e-6,-0.292966 -0.0996,-0.517575 -0.29883,-0.673828 -0.19532,-0.156247 -0.62696,-0.306638 -1.29492,-0.451172 l -0.375,-0.08789 c -0.66797,-0.140622 -1.15039,-0.355466 -1.44727,-0.644531 -0.29687,-0.292965 -0.44531,-0.693355 -0.44531,-1.201172 0,-0.617182 0.21875,-1.093744 0.65625,-1.429688 0.4375,-0.335931 1.05859,-0.503899 1.86328,-0.503906 0.39844,7e-6 0.77344,0.0293 1.125,0.08789 0.35156,0.0586 0.67578,0.14649 0.97266,0.263671"
+         style=""
+         id="path5644" />
+      <path
+         d="m 274.42627,34.335796 0,-3.972656 1.07812,0 0,3.931641 c 0,0.621095 0.1211,1.087892 0.36329,1.40039 0.24218,0.308595 0.60546,0.462892 1.08984,0.462891 0.58203,10e-7 1.04101,-0.185546 1.37695,-0.556641 0.33984,-0.371092 0.50976,-0.876951 0.50977,-1.517578 l 0,-3.720703 1.07812,0 0,6.5625 -1.07812,0 0,-1.007812 c -0.26173,0.398438 -0.56641,0.695312 -0.91406,0.890625 -0.34376,0.191406 -0.74415,0.287109 -1.20118,0.287109 -0.7539,0 -1.32617,-0.234375 -1.71679,-0.703125 -0.39063,-0.468749 -0.58594,-1.154295 -0.58594,-2.056641"
+         style=""
+         id="path5646" />
+      <path
+         d="m 283.19775,35.941265 0,3.480469 -1.08398,0 0,-9.058594 1.08398,0 0,0.996094 c 0.22656,-0.390619 0.51172,-0.679681 0.85547,-0.867188 0.34766,-0.191399 0.76172,-0.287102 1.24219,-0.287109 0.79687,7e-6 1.44335,0.316413 1.93945,0.949219 0.5,0.632817 0.75,1.464848 0.75,2.496093 0,1.031253 -0.25,1.863283 -0.75,2.496094 -0.4961,0.632813 -1.14258,0.949219 -1.93945,0.949219 -0.48047,0 -0.89453,-0.09375 -1.24219,-0.28125 -0.34375,-0.191406 -0.62891,-0.482421 -0.85547,-0.873047 m 3.66797,-2.291016 c 0,-0.792964 -0.16407,-1.414057 -0.49218,-1.863281 -0.32423,-0.453119 -0.77149,-0.679681 -1.3418,-0.679687 -0.57032,6e-6 -1.01954,0.226568 -1.34766,0.679687 -0.32422,0.449224 -0.48633,1.070317 -0.48633,1.863281 0,0.792972 0.16211,1.416018 0.48633,1.869141 0.32812,0.44922 0.77734,0.673829 1.34766,0.673828 0.57031,10e-7 1.01757,-0.224608 1.3418,-0.673828 0.32811,-0.453123 0.49218,-1.076169 0.49218,-1.869141"
+         style=""
+         id="path5648" />
+      <path
+         d="m 295.38525,33.374859 0,0.527344 -4.95703,0 c 0.0469,0.742189 0.26953,1.308595 0.66797,1.699218 0.40234,0.38672 0.96094,0.580079 1.67578,0.580078 0.41406,10e-7 0.81445,-0.05078 1.20117,-0.152343 0.39062,-0.101562 0.77734,-0.253905 1.16016,-0.457032 l 0,1.019532 c -0.38672,0.164062 -0.78321,0.289062 -1.18945,0.375 -0.40626,0.08594 -0.81837,0.128906 -1.23633,0.128906 -1.04688,0 -1.87696,-0.304687 -2.49023,-0.914063 -0.60938,-0.609373 -0.91407,-1.433591 -0.91407,-2.472656 0,-1.074214 0.28906,-1.925776 0.86719,-2.554687 0.58203,-0.632806 1.36523,-0.949212 2.34961,-0.949219 0.88281,7e-6 1.58007,0.285163 2.0918,0.855469 0.51561,0.566411 0.77343,1.337895 0.77343,2.314453 m -1.07812,-0.316406 c -0.008,-0.58984 -0.17383,-1.060542 -0.49805,-1.41211 -0.32032,-0.351557 -0.7461,-0.527338 -1.27734,-0.527344 -0.60157,6e-6 -1.08399,0.169928 -1.44727,0.509766 -0.35937,0.339849 -0.56641,0.818364 -0.62109,1.435547 l 3.84375,-0.0059"
+         style=""
+         id="path5650" />
+      <path
+         d="m 300.93408,31.370953 c -0.1211,-0.07031 -0.25391,-0.121088 -0.39844,-0.152344 -0.14062,-0.03515 -0.29687,-0.05273 -0.46875,-0.05274 -0.60937,6e-6 -1.07812,0.199225 -1.40625,0.597657 -0.32422,0.394536 -0.48633,0.962895 -0.48632,1.705078 l 0,3.457031 -1.08399,0 0,-6.5625 1.08399,0 0,1.019531 c 0.22656,-0.398431 0.52148,-0.693353 0.88476,-0.884765 0.36328,-0.195306 0.80469,-0.292962 1.32422,-0.292969 0.0742,7e-6 0.15625,0.0059 0.24609,0.01758 0.0898,0.0078 0.18945,0.02149 0.29883,0.04102 l 0.006,1.107422"
+         style=""
+         id="path5652" />
+      <path
+         d="m 306.5415,30.615093 0,1.007813 c -0.30469,-0.167964 -0.61133,-0.292963 -0.91992,-0.375 -0.30469,-0.08593 -0.61328,-0.128901 -0.92578,-0.128907 -0.69922,6e-6 -1.24219,0.222662 -1.62891,0.667969 -0.38672,0.441411 -0.58008,1.062504 -0.58007,1.863281 -1e-5,0.800784 0.19335,1.42383 0.58007,1.869141 0.38672,0.441407 0.92969,0.66211 1.62891,0.662109 0.3125,10e-7 0.62109,-0.04101 0.92578,-0.123046 0.30859,-0.08594 0.61523,-0.21289 0.91992,-0.38086 l 0,0.996094 c -0.30078,0.140625 -0.61328,0.246094 -0.9375,0.316406 -0.32031,0.07031 -0.66211,0.105469 -1.02539,0.105469 -0.98828,0 -1.77344,-0.310547 -2.35547,-0.931641 -0.58203,-0.621092 -0.87304,-1.458982 -0.87304,-2.513672 0,-1.070308 0.29297,-1.912104 0.8789,-2.52539 0.58985,-0.613275 1.39649,-0.919915 2.41993,-0.919922 0.33202,7e-6 0.65624,0.03516 0.97265,0.105469 0.3164,0.06641 0.62304,0.167975 0.91992,0.304687"
+         style=""
+         id="path5654" />
+      <path
+         d="m 310.94775,31.118999 c -0.57812,6e-6 -1.03515,0.226569 -1.37109,0.679688 -0.33594,0.449223 -0.50391,1.06641 -0.50391,1.851562 0,0.785159 0.16602,1.404299 0.49805,1.857422 0.33594,0.44922 0.79492,0.673829 1.37695,0.673828 0.57422,10e-7 1.0293,-0.226561 1.36524,-0.679687 0.33593,-0.453123 0.5039,-1.07031 0.5039,-1.851563 0,-0.777339 -0.16797,-1.392573 -0.5039,-1.845703 -0.33594,-0.457025 -0.79102,-0.685541 -1.36524,-0.685547 m 0,-0.914062 c 0.9375,7e-6 1.67383,0.304694 2.20899,0.914062 0.53515,0.609381 0.80273,1.45313 0.80273,2.53125 0,1.074221 -0.26758,1.917971 -0.80273,2.53125 -0.53516,0.609376 -1.27149,0.914063 -2.20899,0.914063 -0.94141,0 -1.67969,-0.304687 -2.21484,-0.914063 -0.53125,-0.613279 -0.79688,-1.457029 -0.79687,-2.53125 -10e-6,-1.07812 0.26562,-1.921869 0.79687,-2.53125 0.53515,-0.609368 1.27343,-0.914055 2.21484,-0.914062"
+         style=""
+         id="path5656" />
+      <path
+         d="m 321.1958,32.964703 0,3.960937 -1.07812,0 0,-3.925781 c -1e-5,-0.621089 -0.1211,-1.085933 -0.36329,-1.394531 -0.24219,-0.308589 -0.60547,-0.462885 -1.08984,-0.462891 -0.58203,6e-6 -1.04102,0.185552 -1.37695,0.556641 -0.33594,0.371098 -0.50391,0.876957 -0.50391,1.517578 l 0,3.708984 -1.08398,0 0,-6.5625 1.08398,0 0,1.019531 c 0.25781,-0.394525 0.56055,-0.689447 0.9082,-0.884765 0.35156,-0.195306 0.75586,-0.292962 1.2129,-0.292969 0.7539,7e-6 1.32421,0.234381 1.71093,0.703125 0.38672,0.464849 0.58007,1.150395 0.58008,2.056641"
+         style=""
+         id="path5658" />
+      <path
+         d="m 327.67627,31.359234 0,-3.550781 1.07812,0 0,9.117187 -1.07812,0 0,-0.984375 c -0.22657,0.390626 -0.51368,0.681641 -0.86133,0.873047 -0.34375,0.1875 -0.75781,0.28125 -1.24219,0.28125 -0.79297,0 -1.43945,-0.316406 -1.93945,-0.949219 -0.49609,-0.632811 -0.74414,-1.464841 -0.74414,-2.496094 0,-1.031245 0.24805,-1.863276 0.74414,-2.496093 0.5,-0.632806 1.14648,-0.949212 1.93945,-0.949219 0.48438,7e-6 0.89844,0.09571 1.24219,0.287109 0.34765,0.187507 0.63476,0.476569 0.86133,0.867188 m -3.67383,2.291015 c 0,0.792972 0.16211,1.416018 0.48633,1.869141 0.32812,0.44922 0.77734,0.673829 1.34766,0.673828 0.5703,10e-7 1.01952,-0.224608 1.34765,-0.673828 0.32812,-0.453123 0.49218,-1.076169 0.49219,-1.869141 -10e-6,-0.792964 -0.16407,-1.414057 -0.49219,-1.863281 -0.32813,-0.453119 -0.77735,-0.679681 -1.34765,-0.679687 -0.57032,6e-6 -1.01954,0.226568 -1.34766,0.679687 -0.32422,0.449224 -0.48633,1.070317 -0.48633,1.863281"
+         style=""
+         id="path5660" />
+      <path
+         d="m 330.86377,34.335796 0,-3.972656 1.07812,0 0,3.931641 c 0,0.621095 0.1211,1.087892 0.36329,1.40039 0.24218,0.308595 0.60546,0.462892 1.08984,0.462891 0.58203,10e-7 1.04101,-0.185546 1.37695,-0.556641 0.33984,-0.371092 0.50976,-0.876951 0.50977,-1.517578 l 0,-3.720703 1.07812,0 0,6.5625 -1.07812,0 0,-1.007812 c -0.26173,0.398438 -0.56641,0.695312 -0.91406,0.890625 -0.34376,0.191406 -0.74415,0.287109 -1.20118,0.287109 -0.7539,0 -1.32617,-0.234375 -1.71679,-0.703125 -0.39063,-0.468749 -0.58594,-1.154295 -0.58594,-2.056641"
+         style=""
+         id="path5662" />
+      <path
+         d="m 343.31494,30.615093 0,1.007813 c -0.30469,-0.167964 -0.61133,-0.292963 -0.91992,-0.375 -0.30469,-0.08593 -0.61329,-0.128901 -0.92578,-0.128907 -0.69922,6e-6 -1.24219,0.222662 -1.62891,0.667969 -0.38672,0.441411 -0.58008,1.062504 -0.58008,1.863281 0,0.800784 0.19336,1.42383 0.58008,1.869141 0.38672,0.441407 0.92969,0.66211 1.62891,0.662109 0.31249,10e-7 0.62109,-0.04101 0.92578,-0.123046 0.30859,-0.08594 0.61523,-0.21289 0.91992,-0.38086 l 0,0.996094 c -0.30079,0.140625 -0.61329,0.246094 -0.9375,0.316406 -0.32032,0.07031 -0.66211,0.105469 -1.02539,0.105469 -0.98828,0 -1.77344,-0.310547 -2.35547,-0.931641 -0.58203,-0.621092 -0.87305,-1.458982 -0.87304,-2.513672 -10e-6,-1.070308 0.29296,-1.912104 0.8789,-2.52539 0.58984,-0.613275 1.39648,-0.919915 2.41992,-0.919922 0.33203,7e-6 0.65625,0.03516 0.97266,0.105469 0.3164,0.06641 0.62304,0.167975 0.91992,0.304687"
+         style=""
+         id="path5664" />
+      <path
+         d="m 346.24463,28.499859 0,1.863281 2.2207,0 0,0.837891 -2.2207,0 0,3.5625 c 0,0.535158 0.0723,0.878907 0.2168,1.03125 0.14843,0.152344 0.44726,0.228516 0.89648,0.228515 l 1.10742,0 0,0.902344 -1.10742,0 c -0.83203,0 -1.40625,-0.154297 -1.72266,-0.462891 -0.3164,-0.312499 -0.47461,-0.878904 -0.47461,-1.699218 l 0,-3.5625 -0.79101,0 0,-0.837891 0.79101,0 0,-1.863281 1.08399,0"
+         style=""
+         id="path5666" />
+      <path
+         d="m 352.43213,31.118999 c -0.57813,6e-6 -1.03516,0.226569 -1.37109,0.679688 -0.33594,0.449223 -0.50391,1.06641 -0.50391,1.851562 0,0.785159 0.16601,1.404299 0.49805,1.857422 0.33593,0.44922 0.79491,0.673829 1.37695,0.673828 0.57421,10e-7 1.02929,-0.226561 1.36523,-0.679687 0.33594,-0.453123 0.5039,-1.07031 0.50391,-1.851563 -10e-6,-0.777339 -0.16797,-1.392573 -0.50391,-1.845703 -0.33594,-0.457025 -0.79102,-0.685541 -1.36523,-0.685547 m 0,-0.914062 c 0.93749,7e-6 1.67382,0.304694 2.20898,0.914062 0.53515,0.609381 0.80273,1.45313 0.80274,2.53125 -10e-6,1.074221 -0.26759,1.917971 -0.80274,2.53125 -0.53516,0.609376 -1.27149,0.914063 -2.20898,0.914063 -0.94141,0 -1.67969,-0.304687 -2.21484,-0.914063 -0.53126,-0.613279 -0.79688,-1.457029 -0.79688,-2.53125 0,-1.07812 0.26562,-1.921869 0.79688,-2.53125 0.53515,-0.609368 1.27343,-0.914055 2.21484,-0.914062"
+         style=""
+         id="path5668" />
+      <path
+         d="m 361.02783,31.370953 c -0.1211,-0.07031 -0.25391,-0.121088 -0.39844,-0.152344 -0.14062,-0.03515 -0.29687,-0.05273 -0.46875,-0.05274 -0.60937,6e-6 -1.07812,0.199225 -1.40625,0.597657 -0.32422,0.394536 -0.48633,0.962895 -0.48632,1.705078 l 0,3.457031 -1.08399,0 0,-6.5625 1.08399,0 0,1.019531 c 0.22656,-0.398431 0.52148,-0.693353 0.88476,-0.884765 0.36328,-0.195306 0.80469,-0.292962 1.32422,-0.292969 0.0742,7e-6 0.15625,0.0059 0.24609,0.01758 0.0898,0.0078 0.18945,0.02149 0.29883,0.04102 l 0.006,1.107422"
+         style=""
+         id="path5670" />
+    </g>
+    <g
+       style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Times;-inkscape-font-specification:Times"
+       id="text5164">
+      <path
+         d="m 185.30331,121.15741 0,1.86328 2.22071,0 0,0.83789 -2.22071,0 0,3.5625 c 0,0.53516 0.0723,0.87891 0.2168,1.03125 0.14844,0.15235 0.44726,0.22852 0.89649,0.22852 l 1.10742,0 0,0.90234 -1.10742,0 c -0.83204,0 -1.40626,-0.1543 -1.72266,-0.46289 -0.31641,-0.3125 -0.47461,-0.8789 -0.47461,-1.69922 l 0,-3.5625 -0.79102,0 0,-0.83789 0.79102,0 0,-1.86328 1.08398,0"
+         style=""
+         id="path5673" />
+      <path
+         d="m 188.83652,126.99335 0,-3.97266 1.07812,0 0,3.93164 c 0,0.6211 0.12109,1.08789 0.36328,1.40039 0.24219,0.3086 0.60547,0.46289 1.08985,0.46289 0.58202,0 1.04101,-0.18554 1.37695,-0.55664 0.33984,-0.37109 0.50976,-0.87695 0.50977,-1.51758 l 0,-3.7207 1.07812,0 0,6.5625 -1.07812,0 0,-1.00781 c -0.26173,0.39844 -0.56642,0.69531 -0.91407,0.89062 -0.34375,0.19141 -0.74414,0.28711 -1.20117,0.28711 -0.75391,0 -1.32617,-0.23437 -1.7168,-0.70312 -0.39062,-0.46875 -0.58593,-1.1543 -0.58593,-2.05664"
+         style=""
+         id="path5675" />
+      <path
+         d="m 202.02011,125.62225 0,3.96094 -1.07812,0 0,-3.92578 c -1e-5,-0.62109 -0.1211,-1.08593 -0.36329,-1.39453 -0.24219,-0.30859 -0.60547,-0.46289 -1.08984,-0.46289 -0.58203,0 -1.04102,0.18555 -1.37695,0.55664 -0.33594,0.3711 -0.50391,0.87696 -0.50391,1.51758 l 0,3.70898 -1.08398,0 0,-6.5625 1.08398,0 0,1.01953 c 0.25781,-0.39452 0.56055,-0.68944 0.9082,-0.88476 0.35156,-0.19531 0.75586,-0.29297 1.2129,-0.29297 0.7539,0 1.32421,0.23438 1.71093,0.70312 0.38672,0.46485 0.58007,1.1504 0.58008,2.05664"
+         style=""
+         id="path5677" />
+      <path
+         d="m 209.6373,125.62225 0,3.96094 -1.07813,0 0,-3.92578 c 0,-0.62109 -0.1211,-1.08593 -0.36328,-1.39453 -0.24219,-0.30859 -0.60547,-0.46289 -1.08984,-0.46289 -0.58204,0 -1.04102,0.18555 -1.37695,0.55664 -0.33594,0.3711 -0.50391,0.87696 -0.50391,1.51758 l 0,3.70898 -1.08399,0 0,-6.5625 1.08399,0 0,1.01953 c 0.25781,-0.39452 0.56054,-0.68944 0.9082,-0.88476 0.35156,-0.19531 0.75586,-0.29297 1.21289,-0.29297 0.7539,0 1.32422,0.23438 1.71094,0.70312 0.38671,0.46485 0.58007,1.1504 0.58008,2.05664"
+         style=""
+         id="path5679" />
+      <path
+         d="m 217.41269,126.03241 0,0.52734 -4.95703,0 c 0.0469,0.74219 0.26953,1.3086 0.66797,1.69922 0.40234,0.38672 0.96093,0.58008 1.67578,0.58008 0.41406,0 0.81445,-0.0508 1.20117,-0.15234 0.39062,-0.10156 0.77734,-0.25391 1.16016,-0.45703 l 0,1.01953 c -0.38673,0.16406 -0.78321,0.28906 -1.18946,0.375 -0.40625,0.0859 -0.81836,0.1289 -1.23633,0.1289 -1.04687,0 -1.87695,-0.30468 -2.49023,-0.91406 -0.60938,-0.60937 -0.91406,-1.43359 -0.91406,-2.47266 0,-1.07421 0.28906,-1.92577 0.86719,-2.55468 0.58202,-0.63281 1.36523,-0.94922 2.3496,-0.94922 0.88281,0 1.58008,0.28516 2.0918,0.85547 0.51562,0.56641 0.77343,1.33789 0.77344,2.31445 m -1.07813,-0.31641 c -0.008,-0.58984 -0.17383,-1.06054 -0.49804,-1.41211 -0.32032,-0.35155 -0.7461,-0.52733 -1.27735,-0.52734 -0.60156,1e-5 -1.08398,0.16993 -1.44726,0.50977 -0.35938,0.33984 -0.56641,0.81836 -0.6211,1.43554 l 3.84375,-0.006"
+         style=""
+         id="path5681" />
+      <path
+         d="m 219.15878,120.466 1.07813,0 0,9.11719 -1.07813,0 0,-9.11719"
+         style=""
+         id="path5683" />
+      <path
+         d="m 231.01816,126.3078 c -1e-5,-0.79296 -0.16407,-1.41406 -0.49219,-1.86328 -0.32422,-0.45312 -0.77149,-0.67968 -1.3418,-0.67969 -0.57031,1e-5 -1.01953,0.22657 -1.34765,0.67969 -0.32422,0.44922 -0.48633,1.07032 -0.48633,1.86328 0,0.79297 0.16211,1.41602 0.48633,1.86914 0.32812,0.44922 0.77734,0.67383 1.34765,0.67383 0.57031,0 1.01758,-0.22461 1.3418,-0.67383 0.32812,-0.45312 0.49218,-1.07617 0.49219,-1.86914 m -3.66797,-2.29102 c 0.22656,-0.39061 0.51172,-0.67968 0.85547,-0.86718 0.34765,-0.1914 0.76171,-0.28711 1.24219,-0.28711 0.79687,0 1.44335,0.31641 1.93945,0.94922 0.49999,0.63281 0.74999,1.46484 0.75,2.49609 -1e-5,1.03125 -0.25001,1.86328 -0.75,2.49609 -0.4961,0.63282 -1.14258,0.94922 -1.93945,0.94922 -0.48048,0 -0.89454,-0.0937 -1.24219,-0.28125 -0.34375,-0.1914 -0.62891,-0.48242 -0.85547,-0.87304 l 0,0.98437 -1.08399,0 0,-9.11719 1.08399,0 0,3.55078"
+         style=""
+         id="path5685" />
+      <path
+         d="m 236.90683,126.28436 c -0.8711,10e-6 -1.47461,0.0996 -1.81055,0.29883 -0.33594,0.19922 -0.50391,0.53907 -0.5039,1.01953 -1e-5,0.38282 0.12499,0.6875 0.375,0.91406 0.2539,0.22266 0.59765,0.33399 1.03125,0.33399 0.59765,0 1.07616,-0.21094 1.43554,-0.63281 0.36328,-0.42578 0.54492,-0.99024 0.54493,-1.69336 l 0,-0.24024 -1.07227,0 m 2.15039,-0.44531 0,3.74414 -1.07812,0 0,-0.99609 c -0.2461,0.39844 -0.55274,0.69336 -0.91993,0.88476 -0.36719,0.1875 -0.81641,0.28125 -1.34765,0.28125 -0.67188,0 -1.20704,-0.1875 -1.60547,-0.5625 -0.39453,-0.3789 -0.5918,-0.88476 -0.5918,-1.51758 0,-0.73827 0.24609,-1.29491 0.73828,-1.66992 0.49609,-0.37499 1.23438,-0.56249 2.21485,-0.5625 l 1.51172,0 0,-0.10547 c -10e-6,-0.49608 -0.16407,-0.8789 -0.49219,-1.14843 -0.32423,-0.27344 -0.78126,-0.41015 -1.3711,-0.41016 -0.375,1e-5 -0.74023,0.0449 -1.0957,0.13477 -0.35547,0.0898 -0.69727,0.22461 -1.02539,0.40429 l 0,-0.99609 c 0.39453,-0.15234 0.77734,-0.26562 1.14844,-0.33984 0.37109,-0.0781 0.73242,-0.11719 1.08398,-0.11719 0.94922,0 1.6582,0.2461 2.12696,0.73828 0.46874,0.49219 0.70311,1.23829 0.70312,2.23828"
+         style=""
+         id="path5687" />
+      <path
+         d="m 245.10995,124.0285 c -0.12109,-0.0703 -0.25391,-0.12108 -0.39843,-0.15234 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,0 -1.07813,0.19922 -1.40625,0.59765 -0.32422,0.39454 -0.48633,0.9629 -0.48633,1.70508 l 0,3.45703 -1.08399,0 0,-6.5625 1.08399,0 0,1.01953 c 0.22656,-0.39843 0.52148,-0.69335 0.88476,-0.88476 0.36328,-0.19531 0.80469,-0.29297 1.32422,-0.29297 0.0742,0 0.15625,0.006 0.2461,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10742"
+         style=""
+         id="path5689" />
+      <path
+         d="m 249.84433,124.0285 c -0.1211,-0.0703 -0.25391,-0.12108 -0.39844,-0.15234 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,0 -1.07813,0.19922 -1.40625,0.59765 -0.32422,0.39454 -0.48633,0.9629 -0.48633,1.70508 l 0,3.45703 -1.08398,0 0,-6.5625 1.08398,0 0,1.01953 c 0.22656,-0.39843 0.52149,-0.69335 0.88477,-0.88476 0.36328,-0.19531 0.80468,-0.29297 1.32422,-0.29297 0.0742,0 0.15624,0.006 0.24609,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10742"
+         style=""
+         id="path5691" />
+      <path
+         d="m 250.98691,123.02069 1.07812,0 0,6.5625 -1.07812,0 0,-6.5625 m 0,-2.55469 1.07812,0 0,1.36524 -1.07812,0 0,-1.36524"
+         style=""
+         id="path5693" />
+      <path
+         d="m 259.92831,126.03241 0,0.52734 -4.95703,0 c 0.0469,0.74219 0.26953,1.3086 0.66797,1.69922 0.40234,0.38672 0.96094,0.58008 1.67578,0.58008 0.41406,0 0.81445,-0.0508 1.20117,-0.15234 0.39062,-0.10156 0.77734,-0.25391 1.16016,-0.45703 l 0,1.01953 c -0.38672,0.16406 -0.78321,0.28906 -1.18945,0.375 -0.40626,0.0859 -0.81837,0.1289 -1.23633,0.1289 -1.04688,0 -1.87696,-0.30468 -2.49023,-0.91406 -0.60938,-0.60937 -0.91407,-1.43359 -0.91407,-2.47266 0,-1.07421 0.28906,-1.92577 0.86719,-2.55468 0.58203,-0.63281 1.36523,-0.94922 2.34961,-0.94922 0.88281,0 1.58007,0.28516 2.0918,0.85547 0.51562,0.56641 0.77343,1.33789 0.77343,2.31445 m -1.07812,-0.31641 c -0.008,-0.58984 -0.17383,-1.06054 -0.49805,-1.41211 -0.32032,-0.35155 -0.7461,-0.52733 -1.27734,-0.52734 -0.60157,1e-5 -1.08399,0.16993 -1.44727,0.50977 -0.35937,0.33984 -0.56641,0.81836 -0.62109,1.43554 l 3.84375,-0.006"
+         style=""
+         id="path5695" />
+      <path
+         d="m 265.47714,124.0285 c -0.1211,-0.0703 -0.25391,-0.12108 -0.39844,-0.15234 -0.14062,-0.0352 -0.29687,-0.0527 -0.46875,-0.0527 -0.60937,0 -1.07812,0.19922 -1.40625,0.59765 -0.32422,0.39454 -0.48633,0.9629 -0.48632,1.70508 l 0,3.45703 -1.08399,0 0,-6.5625 1.08399,0 0,1.01953 c 0.22656,-0.39843 0.52148,-0.69335 0.88476,-0.88476 0.36328,-0.19531 0.80469,-0.29297 1.32422,-0.29297 0.0742,0 0.15625,0.006 0.24609,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10742"
+         style=""
+         id="path5697" />
+    </g>
+    <path
+       style="fill:none;stroke:#000000;stroke-width:1.41732287;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#Arrow1Mend)"
+       d="M 99.212598,136.49111 109.53456,122.94866"
+       id="path5168"
+       transform="translate(114.19886,-19.255464)" />
+  </g>
+</svg>
diff --git a/doc/source/tutorial/index.rst b/doc/source/tutorial/index.rst
index 27b0f450..255772a8 100644
--- a/doc/source/tutorial/index.rst
+++ b/doc/source/tutorial/index.rst
@@ -13,3 +13,4 @@ these notes maybe safely skipped.
     tutorial2
     tutorial3
     tutorial4
+    tutorial5
diff --git a/doc/source/tutorial/tutorial5.rst b/doc/source/tutorial/tutorial5.rst
new file mode 100644
index 00000000..bd572b00
--- /dev/null
+++ b/doc/source/tutorial/tutorial5.rst
@@ -0,0 +1,173 @@
+.. _tutorial-superconductor:
+
+Superconductors: orbital vs lattice degrees of freedom
+------------------------------------------------------
+
+This example deals with superconductivity on the level of the
+Bogoliubov-de Gennes (BdG) equation. In this framework, the Hamiltonian
+is given as
+
+.. math::
+
+    H = \begin{pmatrix} H_0 - \mu& \Delta\\ \Delta^\dagger&\mu-\mathcal{T}H\mathcal{T}^{-1}\end{pmatrix}
+
+where :math:`H_0` is the Hamiltonian of the system without
+superconductivity, :math:`\mu` the chemical potential, :math:`\Delta`
+the superconducting order parameter, and :math:`\mathcal{T}`
+the time-reversal operator. The BdG Hamiltonian introduces
+electron and hole degrees of freedom (an artificial doubling -
+be aware of the fact that electron and hole excitations
+are related!), which we now implement in `kwant`.
+
+For this we restrict ourselves to a simple spin-less system without
+magnetic field, so that :math:`\Delta` is just a number (which we
+choose real), and :math:`\mathcal{T}H\mathcal{T}^{-1}=H_0^*=H_0`.
+
+"Orbital description": Using matrices
+.....................................
+
+We begin by computing the band structure of a superconducting wire.
+The most natural way to implement the BdG Hamiltonian is by using a
+2x2 matrix structure for all Hamiltonian matrix elements:
+
+.. literalinclude:: ../../../examples/tutorial5a.py
+    :lines: 21-45
+
+As you see, the example is syntactically equivalent to our
+:ref:`spin example <tutorial_spinorbit>`, the only difference
+is now that the Pauli matrices act in electron-hole space.
+
+Computing the band structure then yields the result
+
+.. image:: ../images/tutorial5a_result.*
+
+We clearly observe the superconducting gap in the spectrum. That was easy,
+he?
+
+.. seealso::
+    The full source code can be found in
+    :download:`examples/tutorial5a.py <../../../examples/tutorial5a.py>`
+
+
+"Lattice description": Using different lattices
+...............................................
+
+While it seems most natural to implement the BdG Hamiltonian
+using a 2x2 matrix structure for the matrix elements of the Hamiltonian,
+we run into a problem when we want to compute electronic transport in
+a system consisting of a normal and a superconducting lead:
+Since electrons and holes carry charge with opposite sign, we need to
+separate electron and hole degrees of freedom in the scattering matrix.
+In particular, the conductance of a N-S-junction is given as
+
+.. math::
+
+    G = \frac{e^2}{h} (N - R_\text{ee} + R_\text{he})\,,
+
+where :math:`N` is the number of channels in the normal lead, and
+:math:`R_\text{ee}` the total probability of reflection from electrons
+to electrons in the normal lead, and :math:`R_\text{eh}` the total
+probability of reflection from electrons to holes in the normal
+lead. However, the current version of kwant does not allow for an easy
+and elegant partitioning of the scattering matrix in these two degrees
+of freedom (well, there is one since v0.1.3, see the technical notes
+below).
+
+In the following, we will circumvent this problem by introducing
+separate "leads" for electrons and holes, making use of different
+lattices. The system we consider consists of a normal lead on the left,
+a superconductor on the right, and a tunnel barrier inbetween:
+
+.. image:: ../images/tutorial5b_sketch.*
+
+As already mentioned above, we begin by introducing two different
+square lattices representing electron and hole degrees of freedom:
+
+.. literalinclude:: ../../../examples/tutorial5b.py
+    :lines: 18-19,17,23-24
+
+Any diagonal entry (kinetic energy, potentials, ...) in the BdG
+Hamiltonian then corresponds to on-site energies or hoppings within
+the *same* lattice, whereas any off-diagonal entry (essentially, the
+superconducting order parameter :math:`\Delta`) corresponds
+to a hopping between *different* lattices:
+
+.. literalinclude:: ../../../examples/tutorial5b.py
+    :lines: 25-46
+
+Note that the tunnel barrier is added by overwriting previously set
+on-site matrix elements.
+
+Note further, that in the code above, the superconducting order
+parameter is nonzero only in a part of the scattering region.
+Consequently, we have added hoppings between electron and hole
+lattices only in this region, they remain uncoupled in the normal
+part. We use this fact to attach purely electron and hole leads
+(comprised of only electron *or* hole lattices) to the
+system:
+
+.. literalinclude:: ../../../examples/tutorial5b.py
+    :lines: 49-65
+
+This separation into two different leads allows us then later to compute the
+reflection probablities between electrons and holes explicitely.
+
+On the superconducting side, we cannot do this separation, and can
+only define a single lead coupling electrons and holes:
+
+.. literalinclude:: ../../../examples/tutorial5b.py
+    :lines: 70-80
+
+We now have on the left side two leads that are sitting in the same
+spatial position, but in different lattice spaces. This ensures that
+we can still attach all leads as before:
+
+.. literalinclude:: ../../../examples/tutorial5b.py
+    :lines: 83-87
+
+When computing the conductance, we can now extract reflection from
+electrons to electrons as ``smatrix.transmission(0, 0)`` (Don't get
+confused by the fact that it says ``transmission`` -- transmission
+into the same lead is reflection), and reflection from electrons to holes
+as ``smatrix.transmission(1, 0)``, by virtue of our electron and hole leads:
+
+.. literalinclude:: ../../../examples/tutorial5b.py
+    :lines: 89-97
+
+Note that ``smatrix.submatrix(0,0)`` returns the block concerning reflection
+within (electron) lead 0, and from its size we can extract the number of modes
+:math:`N`.
+
+Finally, for the default parameters, we obtain the following result:
+
+.. image:: ../images/tutorial5b_result.*
+
+We a see a conductance that is proportional to the square of the tunneling
+probability within the gap, and proportional to the tunneling probability
+above the gap. At the gap edge, we observe a resonant Andreev reflection.
+
+.. seealso::
+    The full source code can be found in
+    :download:`examples/tutorial5b.py <../../../examples/tutorial5b.py>`
+
+.. specialnote:: Technical details
+
+    - If you are only interested in particle (thermal) currents you do not need
+      to define separate electron and hole leads. In this case, you do not
+      need to distinguish them. Still, separating the leads into electron
+      and hole degrees of freedom makes the lead calculation in the solving
+      phase more efficient.
+
+    - It is in fact possible to separate electron and hole degrees of
+      freedom in the scattering matrix, even if one uses matrices for
+      these degrees of freedom. In the solve step,
+      `~kwant.solvers.sparse.solve` returns an array containing the
+      transverse wave functions of the lead modes, if
+      ``return_modes=True``. By inspecting the wave functions,
+      electron and hole wave functions can be distinguished (they only
+      have entries in either the electron part *or* the hole part. If
+      you encounter modes with entries in both parts, you hit a very
+      unlikely situation in which the standard procedure to compute
+      the modes gave you a superposition of electron and hole
+      modes. That is still OK for computing particle current, but not
+      for electrical current).
diff --git a/doc/source/whatsnew/0.2.rst b/doc/source/whatsnew/0.2.rst
index 662d1c13..9ae614d6 100644
--- a/doc/source/whatsnew/0.2.rst
+++ b/doc/source/whatsnew/0.2.rst
@@ -3,6 +3,10 @@ What's New in kwant 0.2
 
 This article explains the user-visible changes in kwant 0.2.
 
+New tutorial dealing with superconductivity
+-------------------------------------------
+:doc:`../tutorial/tutorial5`
+
 `~kwant.plotter.plot` more useful for low level systems
 -------------------------------------------------------
 The behavior of `~kwant.plotter.plot` has been changed when a `low level system
diff --git a/examples/tutorial5a.py b/examples/tutorial5a.py
new file mode 100644
index 00000000..995c5b96
--- /dev/null
+++ b/examples/tutorial5a.py
@@ -0,0 +1,70 @@
+# Physics background
+# ------------------
+#  band structure of a superconducting quantum wire in tight-binding
+#  approximation
+#
+# Kwant features highlighted
+# --------------------------
+#  - Repetition of previously used concepts (band structure calculations,
+#    matrices as values in Builder).
+#  - Main motivation is to contrast to the implementation of superconductivity
+#    in tutorial5b.py
+
+import kwant
+
+import numpy as np
+from math import pi
+
+# For plotting
+import pylab
+
+tau_x = np.array([[0,1],[1,0]])
+tau_z = np.array([[1,0],[0,-1]])
+
+def make_lead(a=1, t=1.0, mu=0.7, Delta=0.1, W=10):
+    # Start with an empty lead with a single square lattice
+    lat = kwant.lattice.Square(a)
+
+    sym_lead = kwant.TranslationalSymmetry([lat.vec((-1, 0))])
+    lead = kwant.Builder(sym_lead)
+    lead.default_site_group = lat
+
+    # build up one unit cell of the lead, and add the hoppings
+    # to the next unit cell
+    for j in xrange(W):
+        lead[(0, j)] = (4 * t - mu) * tau_z + Delta * tau_x
+
+        if j > 0:
+            lead[(0, j), (0, j-1)] = - t * tau_z
+
+        lead[(1, j), (0, j)] = - t * tau_z
+
+    # return a finalized lead
+    return lead.finalized()
+
+
+def plot_bandstructure(flead, momenta):
+    # Use the method ``energies`` of the finalized lead to compute
+    # the bandstructure
+    energy_list = [flead.energies(k) for k in momenta]
+
+    pylab.plot(momenta, energy_list)
+    pylab.xlabel("momentum [in untis of (lattice constant)^-1]")
+    pylab.ylabel("energy [in units of t]")
+    pylab.ylim([-0.8, 0.8])
+    pylab.show()
+
+
+def main():
+    flead = make_lead()
+
+    # list of momenta at which the bands should be computed
+    momenta = np.arange(-1.5, 1.5 + .0001, 0.002 * pi)
+
+    plot_bandstructure(flead, momenta)
+
+
+# Call the main function if the script gets executed (as opposed to imported).
+# See <http://docs.python.org/library/__main__.html>.
+if __name__ == '__main__':
+    main()
diff --git a/examples/tutorial5b.py b/examples/tutorial5b.py
new file mode 100644
index 00000000..19bd8466
--- /dev/null
+++ b/examples/tutorial5b.py
@@ -0,0 +1,117 @@
+# Physics background
+# ------------------
+# - conductance of a NS-junction (Andreev reflection, superconducting gap)
+#
+# Kwant features highlighted
+# --------------------------
+# - Implementing electron and hole ("orbital") degrees of freedom
+#   using different lattices
+
+import kwant
+
+# For plotting
+import pylab
+
+# For matrix support
+import numpy
+
+def make_system(a=1, W=10, L=10, barrier=1.5, barrierpos=(3, 4),
+                mu=0.4, Delta=0.1, Deltapos=4, t=1.0):
+    # Start with an empty tight-binding system and two square lattices,
+    # corresponding to electron and hole degree of freedom
+    lat_e = kwant.lattice.Square(a)
+    lat_h = kwant.lattice.Square(a)
+
+    sys = kwant.Builder()
+
+    #### Define the scattering region. ####
+    sys[(lat_e(x, y) for x in range(L) for y in range(W))] = 4 * t - mu
+    sys[(lat_h(x, y) for x in range(L) for y in range(W))] = mu - 4 * t
+
+    # the tunnel barrier
+    sys[(lat_e(x, y) for x in range(barrierpos[0], barrierpos[1])
+         for y in range(W))] = 4 * t + barrier - mu
+    sys[(lat_h(x, y) for x in range(barrierpos[0], barrierpos[1])
+         for y in range(W))] = mu - 4 * t - barrier
+
+    # hoppings in x and y-directions, for both electrons and holes
+    sys[sys.possible_hoppings((1, 0), lat_e, lat_e)] = - t
+    sys[sys.possible_hoppings((0, 1), lat_e, lat_e)] = - t
+    sys[sys.possible_hoppings((1, 0), lat_h, lat_h)] = t
+    sys[sys.possible_hoppings((0, 1), lat_h, lat_h)] = t
+
+    # Superconducting order parameter enters as hopping between
+    # electrons and holes
+    sys[((lat_e(x,y), lat_h(x, y)) for x in range(Deltapos, L)
+         for y in range(W))] = Delta
+
+    #### Define the leads. ####
+    # left electron lead
+    sym_lead0 = kwant.TranslationalSymmetry([lat_e.vec((-1, 0))])
+    lead0 = kwant.Builder(sym_lead0)
+
+    lead0[(lat_e(0, j) for j in xrange(W))] = 4 * t - mu
+    # hoppings in x and y-direction
+    lead0[lead0.possible_hoppings((1, 0), lat_e, lat_e)] = - t
+    lead0[lead0.possible_hoppings((0, 1), lat_e, lat_e)] = - t
+
+    # left hole lead
+    sym_lead1 = kwant.TranslationalSymmetry([lat_h.vec((-1, 0))])
+    lead1 = kwant.Builder(sym_lead1)
+
+    lead1[(lat_h(0, j) for j in xrange(W))] = mu - 4 * t
+    # hoppings in x and y-direction
+    lead1[lead1.possible_hoppings((1, 0), lat_h, lat_h)] = t
+    lead1[lead1.possible_hoppings((0, 1), lat_h, lat_h)] = t
+
+    # Then the lead to the right
+    # this one is superconducting and thus is comprised of electrons
+    # AND holes
+    sym_lead2 = kwant.TranslationalSymmetry([lat_e.vec((1, 0))])
+    lead2 = kwant.Builder(sym_lead2)
+
+    lead2[(lat_e(0, j) for j in xrange(W))] = 4 * t - mu
+    lead2[(lat_h(0, j) for j in xrange(W))] = mu - 4 * t
+    # hoppings in x and y-direction
+    lead2[lead2.possible_hoppings((1, 0), lat_e, lat_e)] = - t
+    lead2[lead2.possible_hoppings((0, 1), lat_e, lat_e)] = - t
+    lead2[lead2.possible_hoppings((1, 0), lat_h, lat_h)] = t
+    lead2[lead2.possible_hoppings((0, 1), lat_h, lat_h)] = t
+    lead2[((lat_e(0, j), lat_h(0, j)) for j in xrange(W))] = Delta
+
+    #### Attach the leads and return the finalized system. ####
+    sys.attach_lead(lead0)
+    sys.attach_lead(lead1)
+    sys.attach_lead(lead2)
+
+    return sys.finalized()
+
+def plot_conductance(fsys, energies):
+    # Compute conductance
+    data = []
+    for energy in energies:
+        smatrix = kwant.solve(fsys, energy)
+        # Conductance is N - R_ee + R_he
+        data.append(smatrix.submatrix(0, 0).shape[0] -
+                    smatrix.transmission(0, 0) +
+                    smatrix.transmission(1, 0))
+
+    pylab.plot(energies, data)
+    pylab.xlabel("energy [in units of t]")
+    pylab.ylabel("conductance [in units of e^2/h]")
+    pylab.show()
+
+
+def main():
+    fsys = make_system()
+
+    # Check that the system looks as intended.
+    kwant.plot(fsys)
+
+    plot_conductance(fsys, energies=[0.002 * i for i in xrange(100)])
+
+
+# Call the main function if the script gets executed (as opposed to imported).
+# See <http://docs.python.org/library/__main__.html>.
+if __name__ == '__main__':
+    main()
-- 
GitLab