Skip to content
Snippets Groups Projects
Commit b032b681 authored by Christoph Groth's avatar Christoph Groth
Browse files

docs can be built now without installing kwant (useful i.a. for the debian package)

parent 24c94298
No related branches found
No related tags found
No related merge requests found
...@@ -468,19 +468,22 @@ Python's configparser module ...@@ -468,19 +468,22 @@ Python's configparser module
Building the documentation Building the documentation
========================== ==========================
To build the documentation, Kwant has to be installed as described above. To build the documentation, the `Sphinx documentation generator
Additionally, the `Sphinx documentation generator <http://sphinx.pocoo.org/>`_ <http://sphinx.pocoo.org/>`_ is required. If PDF documentation is to be built,
is required. If PDF documentation is to be built, the tools from the `libRSVG the tools from the `libRSVG <http://live.gnome.org/LibRsvg>`_ (Debian/Ubuntu
<http://live.gnome.org/LibRsvg>`_ (Debian/Ubuntu package ``librsvg2-bin``) are package ``librsvg2-bin``) are needed to convert SVG drawings into the PDF
needed to convert SVG drawings into the PDF format. format.
HTML documentation is built by entering the ``doc`` subdirectory of the As a prerequisite for building the documentation, Kwant must have been built
Kwant package and executing ``make html``. PDF documentation is generated by successfully using ``./setup.py build`` as described above (or Kwant must be
executing ``make latex`` followed by a ``make all-pdf`` in ``doc/build/latex``. already installed in Python's search path). HTML documentation is built by
entering the ``doc`` subdirectory of the Kwant package and executing ``make
html``. PDF documentation is generated by executing ``make latex`` followed by
``make all-pdf`` in ``doc/build/latex``.
Because of some quirks of how Sphinx works, it might be necessary to execute Because of some quirks of how Sphinx works, it might be necessary to execute
``make clean`` between building HTML and PDF documentation. If this is not ``make clean`` between building HTML and PDF documentation. If this is not
done, Sphinx might mistakenly use PNG files for PDF output or other problems may done, Sphinx may mistakenly use PNG files for PDF output or other problems may
appear. appear.
......
...@@ -12,6 +12,10 @@ ...@@ -12,6 +12,10 @@
# serve to show the default. # serve to show the default.
import sys, os import sys, os
from distutils.util import get_platform
sys.path.insert(0, "../../build/lib.{0}-{1}.{2}".format(
get_platform(), *sys.version_info[:2]))
import kwant import kwant
# -- General configuration ----------------------------------------------------- # -- General configuration -----------------------------------------------------
......
################################################################
# Prepend Kwant's build directory to sys.path
################################################################
import sys
from distutils.util import get_platform
sys.path.insert(0, "../../../build/lib.{0}-{1}.{2}".format(
get_platform(), *sys.version_info[:2]))
################################################################
# Define constants for plotting
################################################################
pt_to_in = 1. / 72. pt_to_in = 1. / 72.
# Default width of figures in pts # Default width of figures in pts
......
--- original --- original
+++ modified +++ modified
@@ -16,6 +16,7 @@ @@ -9,6 +9,7 @@
# example, but in the tutorial main text)
# - Modifcations of hoppings/sites after they have been added
# For plotting
from matplotlib import pyplot
+import _defs +import _defs
from cmath import exp
from math import pi
def make_system(a=1, t=1.0, W=10, r1=10, r2=20):
@@ -37,12 +38,13 @@ @@ -37,12 +38,13 @@
sys[lat.shape(ring, (0, r1 + 1))] = 4 * t sys[lat.shape(ring, (0, r1 + 1))] = 4 * t
sys[lat.neighbors()] = -t sys[lat.neighbors()] = -t
......
--- original --- original
+++ modified +++ modified
@@ -10,6 +10,7 @@ @@ -6,6 +6,7 @@
# --------------------------
# - Computing the band structure of a finalized lead.
# For plotting.
from matplotlib import pyplot
+import _defs +import _defs
import kwant
def make_lead(a=1, t=1.0, W=10): # For plotting.
# Start with an empty lead with a single square lattice
@@ -33,10 +34,19 @@ @@ -33,10 +34,19 @@
def main(): def main():
......
--- original --- original
+++ modified +++ modified
@@ -17,6 +17,7 @@ @@ -8,6 +8,7 @@
# - Use of `hamiltonian_submatrix` in order to obtain a Hamiltonian
# matrix.
# For plotting
from matplotlib import pyplot
+import _defs +import _defs
from cmath import exp
import numpy as np
def make_system(a=1, t=1.0, r=10): import kwant
@@ -65,29 +66,39 @@ @@ -65,29 +66,39 @@
energies.append(ev) energies.append(ev)
......
--- original --- original
+++ modified +++ modified
@@ -17,6 +17,7 @@ @@ -8,6 +8,7 @@
# lattice, namely graphene
# For plotting from __future__ import division # so that 1/2 == 0.5, and not 0
from matplotlib import pyplot
+import _defs +import _defs
from math import pi, sqrt, tanh
import kwant
# Define the graphene lattice
@@ -100,22 +101,40 @@ @@ -100,22 +101,40 @@
smatrix = kwant.smatrix(sys, energy) smatrix = kwant.smatrix(sys, energy)
data.append(smatrix.transmission(0, 1)) data.append(smatrix.transmission(0, 1))
......
--- original --- original
+++ modified +++ modified
@@ -10,6 +10,7 @@ @@ -6,6 +6,7 @@
# --------------------------
# - Functions as values in Builder
# For plotting
from matplotlib import pyplot
+import _defs +import _defs
import kwant
# For plotting
def make_system(a=1, t=1.0, W=10, L=30, L_well=10):
@@ -52,19 +53,25 @@ @@ -52,19 +53,25 @@
smatrix = kwant.smatrix(sys, energy, args=[-welldepth]) smatrix = kwant.smatrix(sys, energy, args=[-welldepth])
data.append(smatrix.transmission(1, 0)) data.append(smatrix.transmission(1, 0))
......
--- original --- original
+++ modified +++ modified
@@ -10,6 +10,7 @@ @@ -8,6 +8,7 @@
# - Making scattering region and leads
# - Using the simple sparse solver for computing Landauer conductance
+import _defs
from matplotlib import pyplot from matplotlib import pyplot
import kwant import kwant
+import _defs
# First, define the tight-binding system
@@ -65,7 +66,10 @@ @@ -65,7 +66,10 @@
sys.attach_lead(right_lead) sys.attach_lead(right_lead)
......
--- original --- original
+++ modified +++ modified
@@ -17,6 +17,7 @@ @@ -10,6 +10,7 @@
# --------------------------
# - Numpy matrices as values in Builder
# For matrix support
import tinyarray
+import _defs +import _defs
import kwant
# define Pauli-matrices for convenience # For plotting
sigma_0 = tinyarray.array([[1, 0], [0, 1]])
@@ -67,19 +68,24 @@ @@ -67,19 +68,24 @@
smatrix = kwant.smatrix(sys, energy) smatrix = kwant.smatrix(sys, energy)
data.append(smatrix.transmission(1, 0)) data.append(smatrix.transmission(1, 0))
......
--- original --- original
+++ modified +++ modified
@@ -17,6 +17,7 @@ @@ -10,6 +10,7 @@
# - Main motivation is to contrast to the implementation of superconductivity
# in tutorial5b.py
# For plotting
from matplotlib import pyplot
+import _defs +import _defs
import kwant
tau_x = tinyarray.array([[0, 1], [1, 0]]) import numpy as np
tau_z = tinyarray.array([[1, 0], [0, -1]])
@@ -46,11 +47,20 @@ @@ -46,11 +47,20 @@
# Make system and finalize it right away. # Make system and finalize it right away.
lead = make_lead().finalized() lead = make_lead().finalized()
......
--- original --- original
+++ modified +++ modified
@@ -11,6 +11,7 @@ @@ -7,6 +7,7 @@
# - Implementing electron and hole ("orbital") degrees of freedom
# using different lattices
# For plotting
from matplotlib import pyplot
+import _defs +import _defs
import kwant
# For plotting
def make_system(a=1, W=10, L=10, barrier=1.5, barrierpos=(3, 4),
@@ -82,19 +83,24 @@ @@ -82,19 +83,24 @@
smatrix.transmission(0, 0) + smatrix.transmission(0, 0) +
smatrix.transmission(1, 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