Hello.
I would like to verify the Landau Levels in the Hall conductance of graphene 
nanoribbons. The code works for conductance, band structure and Hall 
conductance, but I would like to know why the plateaus are not visible. Also, I 
would like to know why the plot of wavefunctions does not return to the 
existence of edge states, which should be for zigzag graphene nanoribbons. 
Attached is the code.

Regards,
James
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[-5.41081952 -4.96120101]\n"
     ]
    }
   ],
   "source": [
    "from math import pi, sqrt, tanh\n",
    "from cmath import exp\n",
    "import numpy\n",
    "from matplotlib import pyplot\n",
    "import scipy.sparse.linalg as sla #for sparse matrix\n",
    "\n",
    "import kwant\n",
    "from kwant.digest import gauss\n",
    "\n",
    "\n",
    "sin_30, cos_30 = (1 / 2, sqrt(3) / 2)\n",
    "\n",
    "graphene = kwant.lattice.general([(1,0),(sin_30, cos_30)], 
[(0,0),(0,1/sqrt(3))])\n",
    "a, b = graphene.sublattices\n",
    "\n",
    "sys = kwant.Builder()\n",
    "\n",
    "def hopping(sitei, sitej, phi = 1 / 701, salt = 0):\n",
    "    xi, yi = sitei.pos\n",
    "    xj, yj = sitej.pos\n",
    "    return -exp(-0.5j * phi * (xi - xj) * (yi + yj))\n",
    "\n",
    "def onsite(site, phi, salt):\n",
    "    return 0.05 * gauss(repr(site), salt) + 1\n",
    "\n",
    "\n",
    "def make_system(pot = 0.1):\n",
    "\n",
    "    def rectangle(pos):\n",
    "        x, y = pos\n",
    "        return 0 < x < 40 and 0 < y < 8\n",
    "    \n",
    "    sys[graphene.shape(rectangle, (1, 1))] = -2\n",
    "    sys[graphene.neighbors()] = -1\n",
    "\n",
    "    sym = kwant.TranslationalSymmetry((-1, 0))\n",
    "\n",
    "# We specify a specific fundamental domain/unit cell for the\n",
    "# translational symmetry: with other_vecs we add a second\n",
    "# (linear independent) lattice vector that complements the\n",
    "# translational vector above. Both vectors then form a basis.\n",
    "#\n",
    "# Note: - other_vecs must be lattice vectors, i.e. integer vectors.\n",
    "#         Also, it only holds for the one (sub)lattice specified in\n",
    "#         add_site_family.\n",
    "#       - in contrast, kwant.TranslationalSymmetry takes a\n",
    "#         real-space vector. This is because it could hold for 
different\n",
    "#         lattices (which have different basis vectors). This 
real-space\n",
    "#         vector is converted internally to a lattice vector for each\n",
    "#         lattice.\n",
    "    sym.add_site_family(graphene.sublattices[0], other_vectors=[(-1, 
2)])\n",
    "    sym.add_site_family(graphene.sublattices[1], other_vectors=[(-1, 
2)])\n",
    "\n",
    "\n",
    "# specify the hoppings of the graphene lattice in the\n",
    "# format expected by builder.HoppingKind\n",
    "    hoppings = (((0, 0), a, b), ((0, 1), a, b), ((-1, 1), a, b))\n",
    "    sys[[kwant.builder.HoppingKind(*hopping) for hopping in hoppings]] = 
hopping\n",
    "\n",
    "# Modify the scattering region hoppping\n",
    "    \n",
    "    sys[a(13, 4), b(13, 4)] = 2\n",
    "    sys[a(13, 4), b(13, 3)] = 2\n",
    "    \n",
    "#ze leads\n",
    "\n",
    "    lead = kwant.Builder(sym)\n",
    "\n",
    "    def lead_shape(pos):\n",
    "        x, y = pos\n",
    "        return 0 < y < 8\n",
    "\n",
    "    lead[graphene.shape(lead_shape, (1,1))] = -1\n",
    "    lead[graphene.neighbors()] = -1\n",
    "\n",
    "    \n",
    "    energy = 2\n",
    "\n",
    "    return sys, [lead]\n",
    "\n",
    "\n",
    "#defining calculations\n",
    "\n",
    "def compute_evs(sys):\n",
    "    # Compute some eigenvalues of the closed system\n",
    "    sparse_mat = sys.hamiltonian_submatrix(sparse=True)\n",
    "\n",
    "    evs = sla.eigs(sparse_mat, 2)[0]\n",
    "    print(evs.real)\n",
    "\n",
    "\n",
    "def plot_conductance(sys, energies):\n",
    "    # Compute transmission as a function of energy\n",
    "    data = []\n",
    "    for energy in energies:\n",
    "        smatrix = kwant.smatrix(sys, energy)\n",
    "        data.append(smatrix.transmission(0, 1))\n",
    "\n",
    "    pyplot.figure()\n",
    "    pyplot.plot(energies, data)\n",
    "    pyplot.xlabel(\"energy [t]\")\n",
    "    pyplot.ylabel(\"conductance [e^2/h]\")\n",
    "    pyplot.show()\n",
    "\n",
    "\n",
    "def plot_bandstructure(flead, momenta):\n",
    "    bands = kwant.physics.Bands(flead)\n",
    "    energies = [bands(k) for k in momenta]\n",
    "\n",
    "    pyplot.figure()\n",
    "    pyplot.plot(momenta, energies)\n",
    "    pyplot.xlabel(\"momentum [(lattice constant)^-1]\")\n",
    "    pyplot.ylabel(\"energy [t]\")\n",
    "    pyplot.show()\n",
    "\n",
    "\n",
    "def main():\n",
    "    pot = 0.1\n",
    "    energy = 0.15\n",
    "    sys, leads = make_system(pot = pot)\n",
    "\n",
    "    # To highlight the two sublattices of graphene, we plot one with\n",
    "    # a filled, and the other one with an open circle:\n",
    "    def family_colors(site):\n",
    "        return 0 if site.family == a else 1\n",
    "\n",
    "    # Plot the closed system without leads.\n",
    "    kwant.plot(sys, site_color=family_colors, site_lw=0.1, 
colorbar=False)\n",
    "\n",
    "    # Compute some eigenvalues.\n",
    "    compute_evs(sys.finalized())\n",
    "\n",
    "    # Attach the leads to the system.\n",
    "    for lead in leads:\n",
    "        sys.attach_lead(lead)\n",
    "        sys.attach_lead(lead.reversed())\n",
    "\n",
    "    # Then, plot the system with leads.\n",
    "    kwant.plot(sys, site_color=family_colors, site_lw=0.1,\n",
    "               lead_site_lw=0, colorbar=False)\n",
    "\n",
    "    # Finalize the system.\n",
    "    sys = sys.finalized()\n",
    "\n",
    "    # Compute the band structure of lead 0.\n",
    "    momenta = [-2 * pi + 0.02 * 2 * pi * i for i in range(101)]\n",
    "    plot_bandstructure(sys.leads[0], momenta)\n",
    "\n",
    "    # Plot conductance.\n",
    "    energies = [-2 * pot + 4. / 50. * pot * i for i in range(51)]\n",
    "    plot_conductance(sys, energies)\n",
    "\n",
    "    # Calculate and plot QHE conductance plateaus.\n",
    "    reciprocal_phis = numpy.linspace(4, 50, 200)\n",
    "    conductances = []\n",
    "    for phi in 1 / reciprocal_phis:\n",
    "        smatrix = kwant.smatrix(sys, energy, args=[phi, \"\"])\n",
    "        conductances.append(smatrix.transmission(0, 1))\n",
    "    pyplot.plot(reciprocal_phis, conductances)\n",
    "    pyplot.xlabel(\"Magnetic Field [B]\")\n",
    "    pyplot.ylabel(\"conductance [e^2/h]\")\n",
    "    pyplot.show()\n",
    "\n",
    "    # Calculate and plot a QHE edge state.\n",
    "    def density(sys, energy, args, lead_nr):\n",
    "        wf = kwant.wave_function(sys, energy, args)\n",
    "        return (abs(wf(lead_nr))**2).sum(axis=0)\n",
    "\n",
    "    d = density(sys, energy, [1/40.0, \"\"], 0)\n",
    "    kwant.plotter.map(sys, d)\n",
    "\n",
    "# Call the main function if the script gets executed (as opposed to 
imported).\n",
    "# See <http://docs.python.org/library/__main__.html>.\n",
    "if __name__ == '__main__':\n",
    "    main()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#終わってくださいあとで。"
   ]
  }
 ],
 "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.4.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}

Reply via email to