{ "cells": [ { "cell_type": "markdown", "metadata": { "ein.tags": [ "worksheet-0" ] }, "source": [ "# Scattering\n", "\n", "Previously, we saw how to create finite systems. Now we will create quasi-1d translationally invariant systems and look at their band structures. As a second step, we will attach such infinite systems as leads to a finite system, thus creating a scattering setup, of which we will calculate the scattering matrix.\n", "\n", "## Translationally invariant systems" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "autoscroll": "json-false", "collapsed": false, "ein.tags": [ "worksheet-0" ] }, "outputs": [], "source": [ "import numpy as np\n", "import kwant\n", "%run matplotlib_setup.ipy\n", "from matplotlib import pyplot" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "autoscroll": "json-false", "collapsed": false, "ein.tags": [ "worksheet-0" ] }, "outputs": [], "source": [ "lat = kwant.lattice.square()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Observe how providing a symmetry parameter when creating the `kwant.Builder` object allows to create a translationally invariant system. A builder with a symmetry will always preserve it. That's why it is sufficient to add only a single transverse row of sites to create the full infinite system." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "autoscroll": "json-false", "collapsed": false, "ein.tags": [ "worksheet-0" ] }, "outputs": [], "source": [ "def make_lead_x(W=10, t=1):\n", " syst = kwant.Builder(kwant.TranslationalSymmetry([-1, 0]))\n", " syst[(lat(0, y) for y in range(W))] = 4 * t\n", " syst[lat.neighbors()] = -t\n", " return syst" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The convenience function `kwant.plotter.bands` is often handy to plot bandstructure. If you need to access the actual band structure data (perhaps to plot it in a different way) you may use `kwant.physics.Bands`." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "autoscroll": "json-false", "collapsed": false, "ein.tags": [ "worksheet-0" ] }, "outputs": [], "source": [ "_lead = make_lead_x()\n", "kwant.plot(_lead)\n", "kwant.plotter.bands(_lead.finalized());" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We see cosine-shaped bands that for low energies match the parabolic bands of the continuum model. As expected (see previous notebook) the tight-binding approximation breaks down at high energies." ] }, { "cell_type": "markdown", "metadata": { "ein.tags": [ "worksheet-0" ] }, "source": [ "#### Your turn!\n", "The next two cells are almost an identical copy of the previous two (The two changes are that the function got a different name and the lead is no longer plotted.) Your task is now to add one hopping that connects the first with the last site in y-direction, making the lead thus periodic in y-direction. \n", "\n", "So far, we only used ``lat.neighbors()`` to add hoppings to all lattice sites. We can also modify individual hoppings using\n", "\n", " sys[lat(x1, y1), lat(x2, y2)] = something\n", " \n", "to set the hopping from $(x_2, y_2)$ to $(x_1, y_1)$ to ``something``.\n", "\n", "Observe how the bands become degenerate. Where does this degeneracy come from?\n", "\n", "To see the degeneracy clearly, you may want to reduce the value of the “wrapped” hopping by a factor of, say, `0.8`." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "autoscroll": "json-false", "collapsed": false, "ein.tags": [ "worksheet-0" ] }, "outputs": [], "source": [ "def make_periodic_lead(W=10, t=1):\n", " syst = make_lead_x(W, t)\n", " #### Add periodic boundary conditions here.\n", " return syst" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "autoscroll": "json-false", "collapsed": false, "ein.tags": [ "worksheet-0" ] }, "outputs": [], "source": [ "_lead = make_periodic_lead()\n", "kwant.plotter.bands(_lead.finalized());" ] }, { "cell_type": "markdown", "metadata": { "ein.tags": [ "worksheet-0" ] }, "source": [ "## Transmission through a quantum wire\n", "\n", "Now we will use the method `attach_lead` of Kwant builders to attach infinite quasi-1d systems as leads to a finite system." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "autoscroll": "json-false", "collapsed": false, "ein.tags": [ "worksheet-0" ] }, "outputs": [], "source": [ "def make_wire(W=10, L=30, t=1):\n", " # Construct the scattering region.\n", " sr = kwant.Builder()\n", " sr[(lat(x, y) for x in range(L) for y in range(W))] = 4 * t\n", " sr[lat.neighbors()] = -t\n", "\n", " # Build and attach lead from both sides.\n", " lead = make_lead_x(W, t)\n", " sr.attach_lead(lead)\n", " sr.attach_lead(lead.reversed())\n", "\n", " return sr" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The following function will plot transmission and reflection from lead 0 to lead 1 as a function of Fermi energy." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "autoscroll": "json-false", "collapsed": false, "ein.tags": [ "worksheet-0" ] }, "outputs": [], "source": [ "def plot_transmission(syst, energies):\n", " # Compute conductance\n", " trans = []\n", " refl = []\n", " for energy in energies:\n", " smatrix = kwant.smatrix(syst, energy)\n", " trans.append(smatrix.transmission(1, 0))\n", " refl.append(smatrix.transmission(0, 0))\n", " pyplot.plot(energies, trans, '.')\n", " pyplot.plot(energies, refl, 'o')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's now put the above functions to work by creating a system, plotting it, and then plotting transmission through it. Since we have chosen the Hamiltonian of the scattering region (black dots) to be the same as in the leads, our system is still translationally invariant and there is no back-scattering: we see conductance steps that are characteristic of a clean quantum wire. Compare the transmisison plot with the band structure plot above to verify that the steps occur whenever the Fremi energy reaches a new band." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "autoscroll": "json-false", "collapsed": false, "ein.tags": [ "worksheet-0" ] }, "outputs": [], "source": [ "_wire = make_wire()\n", "kwant.plot(_wire)\n", "plot_transmission(_wire.finalized(), np.linspace(0, 2, 101))" ] }, { "cell_type": "markdown", "metadata": { "ein.tags": [ "worksheet-0" ] }, "source": [ "#### Your turn!\n", "Copy the previous cell below this one and modify `_wire` in some way, e.g. by removing one site. Compare the transmission/reflection plot." ] }, { "cell_type": "markdown", "metadata": { "ein.tags": [ "worksheet-0" ] }, "source": [ "## Beyond the wire geometry\n", "\n", "We are, of course, not restricted to a simplistic wire geometry. Let's build a system that is a bit more complicated: a round quantum dot." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "autoscroll": "json-false", "collapsed": false, "ein.tags": [ "worksheet-0" ] }, "outputs": [], "source": [ "def make_dot(center, radius, t=1):\n", " def is_inside(pos):\n", " x, y = pos - center\n", " return x**2 + y**2 < rr\n", "\n", " rr = radius**2\n", " syst = kwant.Builder()\n", " syst[lat.shape(is_inside, center)] = 4 * t\n", " syst[lat.neighbors()] = -t\n", "\n", " return syst" ] }, { "cell_type": "markdown", "metadata": { "ein.tags": [ "worksheet-0" ] }, "source": [ "First, execute the cell below as-is. A round quantum dot is constructed and one x-directed lead attached to it. Note how `attach_lead` added new sites to the scattering region to create a clean interface for the lead. The Hamiltonian of these sites is taken from the lead that is being attached, such that the physics is unchanged." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "autoscroll": "json-false", "collapsed": false, "ein.tags": [ "worksheet-0" ] }, "outputs": [], "source": [ "_dot = make_dot((3, 7), 13)\n", "_dot.attach_lead(make_lead_x(10))\n", "kwant.plot(_dot);\n", "#### Attach the y-directed lead here." ] }, { "cell_type": "markdown", "metadata": { "ein.tags": [ "worksheet-0" ] }, "source": [ "#### Your turn!\n", "\n", "As an exercise, let's add a second lead that is perpendicular to the first one. Copy the cell that defines the function `make_lead_x` from the beginning of this notebook and paste it above this cell. Use this as a base to define a function `make_lead_y`. Then use this function in the cell below to attach a y-directed lead.\n", "\n", "If you like, you can then calculate and plot transmission through the system. You can simply reuse the function `plot_transmission`.\n", "\n", "Of course, one can attach more than two leads to a scattering region. For example, one could modify the previous cell to also attach the “reversed” versions of both leads (using ``sys.attach_lead(lead.reversed())``).\n", "\n", "With more than two leads it becomes possible to do compute non-local conductances. This is beyond the scope of this tutorial, but see the Kwant paper, and specifically the example `valve.py` in http://downloads.kwant-project.org/examples/kwant-examples-njp.zip." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.1+" } }, "nbformat": 4, "nbformat_minor": 0 }