diff --git a/doc/source/tutorial/tutorial1.rst b/doc/source/tutorial/tutorial1.rst index ee5abb58381f5968a241e81807dbaaa2f3c82b05..8461e8970063558a793162bf2704a3a63048afe7 100644 --- a/doc/source/tutorial/tutorial1.rst +++ b/doc/source/tutorial/tutorial1.rst @@ -53,6 +53,8 @@ The remainder of this section demonstrates how to realize the discretized Hamiltonian in Kwant and how to perform transmission calculations. For simplicity, we choose to work in such units that :math:`t = a = 1`. +.. _tutorial_quantum_wire: + Transport through a quantum wire ................................ @@ -416,16 +418,16 @@ And one ``main`` function. Finally, we use the following standard Python construct [#]_ to execute ``main`` if the program is used as a script (i.e. executed as -``python tutorial1b.py``): +``python quantum_wire_revisited.py``): .. literalinclude:: quantum_wire_revisited.py :start-after: #HIDDEN_BEGIN_ypbj :end-before: #HIDDEN_END_ypbj -If the example, however, is imported inside Python using ``import tutorial1b``, -``main`` is not executed automatically. Instead, you can execute it -manually using ``tutorial1b.main()``. On the other hand, you also -have access to the other functions, ``make_system`` and +If the example, however, is imported inside Python using ``import +quantum_wire_revisted as qw``, ``main`` is not executed automatically. +Instead, you can execute it manually using ``qw.main()``. On the other +hand, you also have access to the other functions, ``make_system`` and ``plot_conductance``, and can thus play with the parameters. The result of the example should be identical to the previous one. diff --git a/doc/source/tutorial/tutorial2.rst b/doc/source/tutorial/tutorial2.rst index 8cede1b9d8860e342259eeeaaaf818d07689ff02..a8ec4e6c270910eab6e8360a985200d71e3b3d66 100644 --- a/doc/source/tutorial/tutorial2.rst +++ b/doc/source/tutorial/tutorial2.rst @@ -136,9 +136,9 @@ case of a position-dependent potential: H = \frac{\hbar^2}{2 m} (\partial_x^2+\partial_y^2) + V(x, y) -The position-dependent potential enters in the onsite energies. -One possibility would be to again set the onsite matrix elements -of each lattice point individually (as in tutorial1a.py). However, +The position-dependent potential enters in the onsite energies. One +possibility would be to again set the onsite matrix elements of each +lattice point individually (as in :ref:`tutorial_quantum_wire`). However, changing the potential then implies the need to build up the system again. Instead, we use a python *function* to define the onsite energies. We diff --git a/doc/source/tutorial/tutorial3.rst b/doc/source/tutorial/tutorial3.rst index e357942f3d33109cb85675fcf4a084a44ae4aa34..ba5ed7c8d79733bbf90582fa7c9a76bb89949326 100644 --- a/doc/source/tutorial/tutorial3.rst +++ b/doc/source/tutorial/tutorial3.rst @@ -27,11 +27,11 @@ invariant system needed for band structure calculations. In the previous examples `~kwant.builder.Builder` instances like the one created above were attached as leads to the ``Builder`` instance of the scattering region and the latter was finalized. The thus created system -contained implicitly finalized versions of the attached leads. But now we are -working with a single lead and there is no scattering region. So we have to -finalized the ``Builder`` of our sole lead explicitly. +contained implicitly finalized versions of the attached leads. However, now +we are working with a single lead and there is no scattering region. Hence, we +have to finalize the ``Builder`` of our sole lead explicitly. -That finalized lead is then passed to `~kwant.plotter.bands`. This function +That finalized lead is then passed to `~kwant.plotter.bands`. This function calculates energies of various bands at a range of momenta and plots the calculated energies. It is really a convenience function, and if one needs to do something more profound with the dispersion relation these energies may be @@ -65,7 +65,7 @@ In this example, we compute the wave functions of a closed circular quantum dot and its spectrum as a function of magnetic field (Fock-Darwin spectrum). To compute the eigenenergies and eigenstates, we will make use of the sparse -linear algebra functionality of `scipy <http://www.scipy.org>`_, which +linear algebra functionality of `SciPy <http://www.scipy.org>`_, which interfaces the ARPACK package: .. literalinclude:: closed_system.py diff --git a/doc/source/tutorial/tutorial4.rst b/doc/source/tutorial/tutorial4.rst index 19850d48018ff94ec78172bb20fc5014e173fe04..ce2e45714d234034fe9bc2e3d82eff97b21d5e2a 100644 --- a/doc/source/tutorial/tutorial4.rst +++ b/doc/source/tutorial/tutorial4.rst @@ -84,8 +84,9 @@ The leads are defined almost as before: Note the method `~kwant.lattice.Polyatomic.vec` used in calculating the parameter for `~kwant.lattice.TranslationalSymmetry`. The latter expects a real-space symmetry vector, but for many lattices symmetry vectors are more -easily expressed in the natural coordinate system of the lattice. The ``vec`` -method of lattices maps a lattice vector to a real-space vector. +easily expressed in the natural coordinate system of the lattice. The +`~kwant.attices.Polyatomic.vec`-method is thus used to map a lattice vector +to a real-space vector. Observe also that the translational vectors ``graphene.vec((-1, 0))`` and ``graphene.vec((0, 1))`` are *not* orthogonal any more as they would have been @@ -108,10 +109,7 @@ in the following piece of code: :end-before: #HIDDEN_END_zydk Here we use in contrast to the previous example a sparse matrix and -the sparse linear algebra functionality of SciPy (this requires -SciPy version >= 0.9.0; since the remaining part of the example does not -depend on this eigenenergy calculation, a ``try``-block simply skips this -calculation if a lower SciPy version is installed.) +the sparse linear algebra functionality of SciPy. The code for computing the band structure and the conductance is identical to the previous examples, and needs not be further explained here.