diff --git a/doc/source/tutorial/tutorial1.rst b/doc/source/tutorial/tutorial1.rst index 31a74dc90fb6c737f431e9bab092042053c8f53f..8d52163c241e2353b849a9dbcbfdaf9b568a4131 100644 --- a/doc/source/tutorial/tutorial1.rst +++ b/doc/source/tutorial/tutorial1.rst @@ -355,14 +355,14 @@ and Finally, we use a python trick to make our example usable both as a script, as well as allowing it to be imported as a module. We collect all statements that should be executed in the script -in a ``main()``-function: +in a ``main``-function: .. literalinclude:: quantum_wire_revisited.py :start-after: #HIDDEN_BEGIN_cjel :end-before: #HIDDEN_END_cjel Finally, we use the following python construct [#]_ that executes -``main()`` if the program is used as a script (i.e. executed as +``main`` if the program is used as a script (i.e. executed as ``python tutorial1b.py``): .. literalinclude:: quantum_wire_revisited.py @@ -370,10 +370,10 @@ Finally, we use the following python construct [#]_ that executes :end-before: #HIDDEN_END_ypbj If the example however is imported using ``import tutorial1b``, -``main()`` is not executed automatically. Instead, you can execute it +``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 -``plot_conductance()``, and can thus play with the parameters. +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 9e5e9d6bc76bafafe368ad5e245a55909c643cba..232cab4865c1bc19fe3c9b99f6f6324ff5260638 100644 --- a/doc/source/tutorial/tutorial2.rst +++ b/doc/source/tutorial/tutorial2.rst @@ -152,7 +152,7 @@ This function takes two arguments: the first which is of type `~kwant.builder.Site`, from which you can get the real-space coordinates using ``site.pos``, and the value of the potential as a second argument. Note that we can use global -variables to define the behavior of `potential()`: `L` and `L_well` +variables to define the behavior of `potential`: `L` and `L_well` are variables taken from the namespace of `make_system`. kwant now allows us to pass a function as a value to @@ -163,10 +163,10 @@ kwant now allows us to pass a function as a value to :end-before: #HIDDEN_END_coid For each lattice point, the corresponding site is then passed as the -first argument to the function `onsite()`. The values of any additional +first argument to the function `onsite`. The values of any additional parameters, which can be used to alter the Hamiltonian matrix elements -at a later stage, are specified later during the call to `solve()`. -Note that we had to define `onsite()`, as it is +at a later stage, are specified later during the call to `solve`. +Note that we had to define `onsite`, as it is not possible to mix values and functions as in ``sys[...] = 4 * t + potential``. @@ -249,7 +249,7 @@ provided by the lattice: :start-after: #HIDDEN_BEGIN_lcak :end-before: #HIDDEN_END_lcak -Here, ``lat.shape()`` takes as a second parameter a (real-space) point that is +Here, ``lat.shape`` takes as a second parameter a (real-space) point that is inside the desired shape. The hoppings can still be added using `~kwant.builder.Builder.possible_hoppings` as before. @@ -273,7 +273,7 @@ is again that we want to vary the flux through the ring, without constantly rebuilding the system -- instead the flux is governed by the parameter `phi`. -For the leads, we can also use the ``lat.shape()``-functionality: +For the leads, we can also use the ``lat.shape``-functionality: .. literalinclude:: ab_ring.py :start-after: #HIDDEN_BEGIN_qwgr diff --git a/doc/source/tutorial/tutorial4.rst b/doc/source/tutorial/tutorial4.rst index e51ad152017598f5bd3e4c769b676ea701c274d7..d8a71af29d2b91a15393f998dc61881e97dcf8b0 100644 --- a/doc/source/tutorial/tutorial4.rst +++ b/doc/source/tutorial/tutorial4.rst @@ -25,7 +25,7 @@ itself forms a regular lattice of the same type as well, and those *sublattices* are referenced as `a` and `b` above. In the next step we define the shape of the scattering region (circle again) -and add all lattice points using the ``shape()``-functionality: +and add all lattice points using the ``shape``-functionality: .. literalinclude:: graphene.py :start-after: #HIDDEN_BEGIN_shzy @@ -34,7 +34,7 @@ and add all lattice points using the ``shape()``-functionality: As you can see, this works exactly the same for any kind of lattice. We add the onsite energies using a function describing the p-n junction; in contrast to the previous tutorial, the potential value is this time taken -from the scope of `make_system()`, since we keep the potential fixed +from the scope of `make_system`, since we keep the potential fixed in this example. As a next step we add the hoppings, making use of @@ -117,8 +117,7 @@ calculation if a lower SciPy version is installed.) The code for computing the band structure and the conductance is identical to the previous examples, and needs not be further explained here. -Finally, in the `main()` function we make and -plot the system: +Finally, in the `main` function we make and plot the system: .. literalinclude:: graphene.py :start-after: #HIDDEN_BEGIN_itkk @@ -149,7 +148,7 @@ should yield two eigenvalues similar to `[ 3.07869311 +1.02714523e-17j, -3.06233144 -6.68085759e-18j]` (round-off might change the imaginary part which would be equal to zero for exact arithmetics). -The remaining code of `main()` attaches the leads to the system and plots it +The remaining code of `main` attaches the leads to the system and plots it again: .. image:: ../images/graphene_sys2.*