Home

KNIT user guide - Inac

image

Contents

1. Index of the moved site MyABC move site 27 t V MYSIZE 3 SAE SUN Indices of neighbours Coordinates 26 FIG 7 System construction a System is constructed by gluing rectangular blocks b One site is added c Site number 13 is moved Building a system of required geometry shift_system Shifting a system on the vector A delta is equivalent to moving all the system sites to this vector in coordinate space Example We shift the system s below on the vector A 2 1 s shift system 2 1 delta 27 3 0 3 A 0 1 2 3 4 5 6 7 3 x FIG 7 System shift on A 2 1 B LEAD CONSTRUCTION A lead is a semi infinite wave guide that is attached to a mesoscopic system Each system must be attached to at least one lead in order to be solved by KNIT To construct a lead we first create a lead interface the part that will be attached to one of the system sides The lead interface is a system with only one layer of sites i e one of the lead sizes W 1 or H 1 or D 1 then we extend this interface by copying the layer of sites to obtain a semi infinite contact This interface technically represents a rectangular system with one of its sizes equal to 1 Interface Contact knit rectangle iW iH leadX0 leadY0 t V Here iW 1 or iH 1 A pair leadX0 leadYO specify a position where the lead will be finally attached to the system I e typically it should correspond to a b
2. From x y to n m AorB def nmAorB x y emee a a ce men AorB tmp 3 2 i een cl return n m AorB def Neighbours n m AorB voisin S 2 AorBt z voisin 1 return n z z s mt s z 1 z 2 1 AorB We also redefine functions to manipulate sites in graphene def add_one_site n m AorB t Hd monsys x 0 y 0 if AorB A AorB 0 if AorB B AorB 1 D i Um TA eet if monsys indice X x Y y 1 return we for i in range 3 ny yv AOrBvV Nei1ghbours n m AorB 1 XV YV XY nv mv AorBv Ri yv yv ty where monsys indice xv yv if where 1 v append where monsys add site v Hel def move one Site n m AoOrB Ada monsys ina aN yaa if AorB A AorB 0 if AorB B AorB 1 DNO UTILE es v for i in range 3 nv mv AorBv Neighbours n m AorB 1 XV YV XY nv mv AorBv XV XVtX yv yv ty 49 where monsys indice xv yv if where 1 v append where monsys move_site v t Hd X x Y y ind We define a Zigzag constructor for a system To build a sample of graphene ribbon in KNIT we are using a rectangle system constructor to allocate the memory for the needed sites and then move the created sites to build a system with hexagonal lattice i Ligzag rectangle lace From Pert bo rghit AGE 4G Zeca Imc qs restes bel n max m max nmSize fullsize 2 n max m max t2 n max t 2 m max x y Init xy monsys knrt rectangle fullsize 1 x y Hd vv ind 0 MOMei o
3. return args return args return args return return return args return x th coordinate coord 1 y th coordinate coord 2 z th coordinate etc If coord length gt dim gt error int site index Returns the physical coordinates d of a given site ind see also indice site index ind 0 size 1 where size is a system size total number of sites coord int ind int d int ind int d coordinate d 0 dim 1 where dim is a physical dimensionality of the system Example d 0 gt x th coordinate d 1 gt y th coordinate etc int For the site with index ind returns all coordinates O dim 1 of a given site ind in a form of 1D array see also indice site index ind 0 size 1 where size is a system size total number of sites vcoord int ind int ind an array of int with the length dim where dim is a dimensionality of the system similar to int dim get Hdiag int ind Array int 1 For the site with index ind returns the value of its on site energy int ind site index ind 0 size 1 where size is a system size total number of sites scalarM For the site with index ind returns the value of the hopping between ind and its z the neignbour site index ind 0 size 1 where size is a system size total number of sites neighbour index z 0 fzmax 1 get Hopp int ind int z int ind int z scalarM For the site with index ind sets the value
4. 45 Wl1 1 3 W2 4 2 Wso 0 0 Here yMax is a height of our sample or the number of its cross sections Later we will use this parameter to normalize the conductance on each cross section of the sample We specify the function that introduces disorder in our system as follows 41 def putDisorder import random random seed 66 for i in range mySystem3D mySystem3D coord y lt yMax 2 hi Vi new Vi new Vil mew Vi new Vi new mySystem3D put Hdiag i Vi new ksiRe ksilm etaRe etalm POR Z else hi C Solving random random 0 5 spin U set 0 set set set 0 1 m ze y coordinate bottom P 49 lists db 0 0 1 0 Dg la er random random 0 5 random random 0 5 random random 0 5 random random 0 5 in range mySystem3D fzmax ti new spin MC set Socr MMC Set mcus imas oie exe lO isco Eee nde ke mim ae pucr Setu Occ yp lesu idet mySystem3D put Hopp i z ti fin random random 0 5 mySystem3D put Hdiag i spin W hi spin l ti new bottom part Cu NOTE The seed parameter of random function allows generating the same sequences of numbers this is helpful when the same sample has to be reproduces several times To develop several samples with the same geometry we use different seeds To illustrate the result of imposed disorder we plot the 2D potential of the system using colorplot2D
5. E Calculates a self energy of a lead interface for the energy E supposing the lead is connected with a system via inter slice hopping args COMPLEX E value of energy return GF type a Green function represented by an Array COMPLEX 4 gt 59 F get leadHopp int from int to Returns an inter slice hopping in the lead args int from index of a slice in the lead int to index of a slice in the lead return scalarM hopping put leadHopp int from int to scalarM t Sets an inter slice hopping t in the lead between the slices from and to int from index of a slice in the lead int to index of a slice in the lead scalarM t hopping return unreservoirN a pointer to itself GF type defines a Green Function type as a data structure with 4 components GF i alpha j beta Each component is a complex number GF type a scalar value for the system without spin C Total system class systemtotal extends unsysteme Describes an infinite system with leads systemtotal unsysteme s unreservoir lead Constructs an infinite system with a single lead based on s and the lead ead unsysteme s a finite system without spin unreservoir lead reservoir systemtotal systemtotal ss Copy constructor systemtotal ss an infinite system without spin to copy from INFINITE SYSTEM CONSTRUCTION BY ADDING LEADS addlead unreservoir lead Connects a lead to the total infinite system args unreservoir lead lead retu
6. asinthe previous example see Fig 15 We calculate local observables results obs knitANDsew S mySystem3D E We define the function for accumulation count to calculate the conductance at each cross section of the sample along the axis Y considering the active lead lead 1 Cu side 42 MYDATA FIG 16 Calculation of the conductance for y cross sections of the system def getSpinAccum l1i zmax mySystem3D fzmax accum zeros yMax 2 complex for i pes LOI J return res lead 1 in range mySystem3D fsize y mySystem3D coord i y coordinate of the site Gii results getG lesser i zmax li 0 0 results getG lesser i zmax li 1 1 accum y 0 Gii accum y 1 1 zeros yMax complex normalisation of result in range yMax Ces iq accum jJ 0 accum j 1 MYDATA append j res j imag getSpinAccum lead We plot the results iu om UP CES g graph Jr aphy width 000 gra ph axis i near title T y graph axis linear title mu uparrow mu downarrow GQ Clore graph data liste MYDAIA ey arapa style line seve tiam vr eli Tao dee den MT Gavi rec DE SIE SR IRL TORUM a 92 10 S CURIE RS 0 43 0 05 n 0 05 u 1 0 1 0 15 0 5 10 15 20 Y FIG 17 Calculation of the conductance for Y cross sections of the system This result is obtained by averaging on 20 samples Mesoscopic fluctuations are still strong so the curve doesn t h
7. built correctly To do so we propose to start Python and try to import functions from libpy library Usert Er E dee REO A Wotlk y ea dbi eak Ton einem PERON eon A A E O O d cc eS OU S T AN Oo COMI S Ano SIM erp 4 2 3 Ubuntu 4 2 ee tera on linux tTyoe ined Wcopyright VYerecies or Ylicense ror more IM OBmsgtuor Se ECON Jeno ON IPOE a Traceback most recent call last File gc chu s line 1 in lt mocule gt ImportError No module named lippy rr XS OTI enna lenges pu 16 e Ifthe test went fine we execute the example user Linux desktop Work svn_knit trunkS cd examplespy user Linux desktop Work svn knit trunk examplespy python benchmark bar py Sis MMe SI A Soc DI CONSTRUCTION E O6 CONDUCTANCE CALCULATION 63 9291319847 Comment for the history file type enter not to add the data slow Linux desktop userG8Linux desktop Work svn knit trunk examplespy emacs benchmark bar benchmark bar history benchmark bar py user Linux desktop Work svn knit trunk examplespy emacs benchmark bar history amp i 999 user Linux desktop Work svn knit trunk examplespyS gedit benchmark bar history amp 2 5910 eed Done emacs benchmark_bar history user Linux desktop Work svn_knit trunk examplespy Some useful examples can be also found in Work svn_knit trunk tutorialpys We will consider these examples and explain how to create your own KNITable files in the next sections However it is also a good place t
8. dir dir dir dir dir dir dir di dir dir dir dir dir dir dir diro dir dir diro diris 1 MACHINE SPECIFIC PART x ADD LIES CORRESPONDING TO YOUR MACHINE HERE ACKCkCkCk KCk Ck KC KC kCk Kk KCkCk KCk Kok Ko KCk Kok Kok Kk Kok Kok KK Kk KCk Kok Kok Ko Kk Kok Kok k kk kk kk H cHe SHE SE DIRECTIES EOR MC POOK mee E E STER a cree e OO ae e a e CC OTT PYTHDR Library Frameworks Python framework Versions 2 5 include python2 5 Numeric package must be installed here Python h is here Numeric arrayobject h is here BLZHDR opt local var macports software blitz 0 9 0 opt local include blitz array h is here BLZLIB opt local var macports software blitz 0 9 0 opt local lib adole aTe eae e Ibi oy Se bcmos pU Scu ott duse Obsolete ge LELAG se cIWHOMEMEEe omia mdco aenor k Accelerate ud epaekuesdi ius lepus co ede t ane len ed ORI zc ENSE SESTO ze cis meson idee ENELSIMG S 9 39e endif 3 Compile and build KNIT make python 4 Testthe installation cd examplespy 18 python benchmark bar py NOTE Under MacOS KNIT works significantly slower than under LINUX C Windows This installation might be unstable and even if made successfully it is extremely slow Though we strongly believe that none will read this section This is a short help to compile knit on windows using cygwin Note the result only work on cygwin python not on win32 python One would need a different build to do so possibl
9. functionalities were needed People started to develop new codes for other geometries or to add more electrodes or internal degrees of freedom to tackle say superconductivity or magnetism In most cases each new problem was is associated with a new specific code However even though all these different problems can contain very different physics they share a common mathematical structure KNIT is an attempt to write a single program that allows addressing all these very different systems In order to do that we had to overcome two difficulties First we had to generalize the RGF algorithm in such a way that it did not rely on a specific geometry or topology of the model This was done in Ref 1 Second we needed a simple interface that allowed the user to easily build a new system without burying himself inside the code Writing such an interface is very costly and they usually do not age well Our technical 2 choice here was to build KNIT as an extension of the Python language Python is a programming language which is both extremely powerful and easy to learn and handle An almost infinite number of modules have been written for Python so that only a few lines of codes are needed to send an email perform a fast Fourier transform or produce a nice postscript file for a figure KNIT is merely another module of Python We believe that this programming paradigm i e extending language capabilities as opposed to a standalone program is very p
10. of its on site energy to Hii site index ind 0 size 1 where size is a system size total number of sites new on site energy Returns a pointer to itself put Hdiag int ind scalarM V int ind scalarM V unsysteme For the site with index ind sets the value of its hopping with its z th neighbour tot site index ind 0 size 1 where size is a system size total number of sites neighbour index z 0 fzmax 1 new hopping Returns a pointer to itself put Hopp int ind int z scalarM t int ind intz scalarM t unsysteme add Hopp int ind1 int ind2 scalarM t Adds a non existent hopping element t between a site with index ind1 and a site with index ind2 site index site index hopping matrix element Returns a pointer to itself int indi int ind2 const scalarM t unsysteme Msite int ind For the site with index ind returns the diagonal matrix element return zero for sites out of range int ind site index ind 0 size 1 where size is a system size total number of sites scalarM diagonal matrix element on site energy 56 OPERATIONS BETWEEN SITES AND THEIR NEIGHBOURS F voisin int ind int z For the site with index ind returns the index of its z th neighbour args int ind site index ind 0 size 1 where size is a system size total number of sites intz neighbour voisin fr number z 0 zmax 1 where zmax is a maximum number of neighbours for a gi
11. of local observables of the system sew2end Implement the sewing algorithm for the all system calculates local observables of the system We recommend the use of Python interface for this function functions knitANDsew and knitANDsew S from the module obs py getG lesser int ind int z int li Returns the value of Lesser Green function between the site ind and its z th neighbour given that the electrons are injected with probability 1 from the lead li G args int ind The site index which corresponds to i from Eq int z The z th neighbour that is related to i from Eq as j voisin ind z int li Index of the lead corresponds to I from Eq return GF type Green function F getG LL int i1 int lead1 int i2 int lead2 Returns full Green Function between lead1 and lead2 with lead site indices i1 and i2 63 args int il i2 The indices of lead sites i1 0 lead size lead1 1 i2 0 lead size lead2 1 int lead1 lead2 Leads O fNres return GF type Green function getG retarded int ind int z Returns Green Function not Keldysh for the site ind and its neighbour z i zmax on site Lj args intind System site index ind 0 fsize 1 intz Neighbour index z 0 fzmax for z fzmax function returns the on site GF return GF type Green function F getSE int i int j int li For the lead number li and sites i j of this lead returns self energy 2 args intijj The indices of lead sites i j 0 l
12. requirements Table 1 presents the list of required packages and the recommended order of their installation Table 1 ENNIO name 1 C compiler cpp Needed to compile the e usually a part of standard LINUX 2 Python v 2 5 or Needed to build the usually a part of standard LINUX later Not the application distributions version 3 to check version python V http www python org download Python dev that includes header Available in standard installers as apt get Python h Python Numeric Python library for Available in standard installers as apt get numpy numerical computing e should be installed in its default path Blitz Template library for http www oonumerics org blitz download v 0 9 or later numerical computing Contains matrices and tensors PyX isa Python package e http pyx sourceforge net for making 2d and 3d e if Pyx 10 is used change color palette to plots postscript and PDF color gradient files PyX is not completely necessary but it is nice ans some examples won t work without it lapack 2 5 Linear Algebra http www netlib org lapack PACKage sometimes one needs to rename or create an appropriate symbolic link to liblapack so n gt liblapack so where n is the version number This should also install the important BLAS on which lapack relies heavily libg2c mostly Required for linking C sometimes one needs to rename or obsolete know with lapack create an appropriate sym
13. the opposite direction from the lead k to the lead l Namely we are unknitting the sites one by one starting from the site b of a lead k until we reach the site i Using the sewing algorithm the retarded Green function G between two arbitrary system sites i and j of the system can be calculated When the system and its leads are constructed we proceed with system solving In KNIT knitting and suing routines can be accessed via Python interface functions knitonly knitonly_S and knitANDsew knitANDsew_S _S defines the corresponding function for systems with spin In our example we calculate the conductance between leads a matrix G_MATRIX as a function of energy E for 1 in range 10 Ba hock E MP ME G MATRIX obs conductance matrix MyABCwithLeads E print E G MATRIX 1 0 The function conductance matrix uses the function knitonly as its subroutine In the next section we consider more advanced examples where the local observables for the system are calculated Calculation time The algorithm complexity depends not only on the total system size its number of sites but also on the system configuration and knitting sewing direction Considering the rectangular system of the size Noi length L and the width M as shown in fig 9 b we will define the interface size Mint i as the maximum number of sites that at a knitting step i do not have all their neighbors calculated We calculate the computational complexity for the sy
14. these examples knit_makefile This file contains the Makefile of KNIT It should be modified before compilation to tell the compile where to find the various needed libraries see Section 3 Makefile This file is almost empty and links to knit makefile 11 12 4 System requirements and installation guide In this section we explain how to set up KNIT on your computer and make it ready to work The KNIT system is usually easy to install on Linux computers it takes about 20 minutes to install the various needed libraries on say Ubuntu If you dont know much about compiling we recommend that you stick to Linux KNIT has been known to work on Mac OS and we provide a few guidelines for that As for Windows well it is probably possible to compile KNIT for windows but nobody really bothered We did compile KNIT on Windows using cygwin which emulates a linux API on windows once but the result is particularly slow We provide a few guidelines for that as well but don t recommend it Once you have installed all the third party libraries you need to edit the file knit Makefile and modified a few lines in the beginning to tell which version of the libraries you have and where you have installed them Once this is done you should type make python in your terminal and you should be done Section 4 1 specifies a list of packages and libraries that are required by KNIT system In section 4 2 we describe the setup process step by step 4 1 System
15. 2 SelfEnergy unsysteme S lead int sigma int on eta tricot _S knitted_system systemtotal Calculates self energy a b where _S s_total and b are sites of the interface between a system and a lead unsysteme unsysteme_S lead lead I int sigma spin degree of freedom 1 m int eta spin degree of freedom 1 m tricot tricot S knitted system result of knitting pointer on kniter systemtotal systemtotal Ss total the system return COMPLEXT A matrix of the size m x m where m s total lead size lead 7 4 Module system py This module defines functions for visualisation of results E Visualisation of results visualisation simple unsysteme a Makes a simple 2D plot of the system s geometry with black circles see visu2D and saves it to fileimage simple eps unsysteme a a system to plot F visu2D unsysteme a string s Makes a 2D plot of the system a its geometry Saves the image to file s pdf and s eps See also 66 visualisation_ simple unsystemea system to plot string s resulting file visu3D unsysteme a string s Makes a 3D plot of the system a its geometry Saves the image to file s pdf and s eps See also visu2D unsystemea system to plot string s resulting file saveplot2D unsysteme system Saves the system with associated values at each system strings file point calculated using the function myFun Resultinf file function that returns f
16. 447 inagLinux desktop Work svn knit trunk tutorialpy ii FIG 3 Conductance matrix for MyA 7 We 1 399 1 79 1 59 1 39 1 19 0 99 0 79 0 59 0 39 6 19 ir This example above illustrates the calculation of a conductance matrix for the system defined in the 2 dimmentional space Apart from conductance matrix other transport properties and observables of systems can be calculated with KNIT as illustrated in Fig 1 2 3 A flavor of the Theoretical framework The system of N sites is described by the tight biding Hamiltonian with nearest neighbor s interaction of the following form H NGC AC 2 2 Vie Jp p E LE mE H a Sm A A NM ij On e O C i a is a vector composed of C For any site with index i an operator i m operators m defines the number of internal degrees of freedom at a site of the system for O oe example spin e h s p d etc C creates a particle with internal degree of freedom o 1 m on i th site li is am x m hopping matrix V is a m x m on site energy matrix The system is connected to environment via semi infinite leads The leads can be analytically integrated out and appear in the formalism as self energies 2 CE which are functions of energy That provides boundary condition for the interface sites sites which are common for the system and for leads KNIT calculates the following retarded Green function of the system connected to externa
17. ABCwithLeads s pot potential 36 FIG 11 MyABCwithLeads with introduced impurity The method colorplot2D is specified in the module system py This method takes as an obligatory inputs the following parameters a pointer to the system to plot the resulting file name and the function that calculates the values to fill the plot area with corresponding colored squares The color is attributed to the corresponding coordinate in the system Calculation of conductance as a function of impurity strength W Now we calculate the conductance properties of our system MYDATA for i in range l0 WW Ge oa aL 10 e myDisorder W G MATRIX obs conductance matrix MyABCwithLeads E MYDATA append W G MATRIX 2 1 G MATRIX 0 1 G MATRIX 0 2 print W G MATRIX 2 1 G MATRIX 0 1 G MATRIX O 2 Here for each value of disorder or impurity strength W we calculate the conductance as G MATRIX leadIndexTo leadIndexFrom NOTE the lead indexing starts from 0 i e the leads in fig 10 have the following indices lead 1 0 lead 2 1 lead 3 2 Therefore G MATRIX 2 1 calculates the conductance from the lead 2 to the lead 3 from bottom to right G MATRIX 0 1 from 2 to 1 from bottom to left and G MATRIX 0 2 from 3 to 1 from right to left We create the table MYDATA and fill it in based on the values of W 0 2 We also print our results on the screen 37 We can also plot our results as a graph and s
18. KNIT user guide I Rychkova2 V Rychkov K Kazymyrenko S Borlenghi X Waintal 4 1 Service de Physique de l Etat condens DSM DRECAM SPEC CEA Saclay 91191 Gif sur Yvette Cedex France 2 Centre de Recherche en Informatique Universite Paris1 Pantheon Sorbonne 90 Rue de Tolbiac 75013 Paris Cedex France 3 D partement Analyses M caniques et Acoustique AMA T64 EDF R amp D 1 avenue du G n ral de Gaulle 92141 Clamart Cedex France 4 Service de Physique Statistique Magn tisme et Supraconductivit INAC SPSMS CEA 38054 Grenoble Cedex 9 France Abstract KNIT is a library that implements a fast and versatile algorithm to calculate local and global transport properties in mesoscopic quantum systems Within the non equilibrium Green function formalism KNIT applies a generalized recursive Green function technique to tackle multiterminal devices with arbitrary geometries It is fully equivalent to the Landauer Buttiker Scattering formalism KNIT can and has been applied to many different tight biding models for a large class of physical systems including topological insulators graphene ribbons hybrid superconducting systems and ferromagnetic multilayers KNIT main functionality is written in C and wrapped into Python providing a simple and flexible interface for the user Usual input files of numerical codes are replaced by small python scripts where the user builds the system and then compute whatever observable conductanc
19. SIZE 0 t V A coller B A coller C We build the leads also as 3D rectangles interface Contaci l knit rectangle S M SIZE sm Eos qus interface Contact 2 knit rectangle S MYSTZESTT SSMYSTZABEIST 0 TOA MYSIZE IL O E V leadl knit unreservoirN S interface contactl1 t lead2 knit unreservoirN S interface contact2 t mySystem3D knit systemtotal S A leadl mySystem3D addlead lead2 NOTE we use functions from KNIT with a postfix S that stands for spin To plot the 3D system function visu3D can be used Note however that for systems with huge number of sites such image will be difficult to analyze B Introducing a disorder To model properties that correspond to selected materials Py and Cu we add disorder to matrix elements of the corresponding sample parts For Py the disorder is described by the following expression 1 0 n Wy 0 Ti Wo V 0 1 7 B W X Where Re Re7 0 5 0 5 Im Im 0 5 0 5 y 0 5 0 5 W 5 0 0 Wi 1 3 Wz 4 2 For Cu the disorder is defined as follows 40 0 v w 4 0 x Where y 0 5 0 5 and W 0 45 3xMYSIZ 2xMYSIZE 10xMYSIZE 7TxMYSIZE FIG 14 System with 3D geometry FIG 15 2D plot of the system with the parameterization MSIZE 1 Disorder corresponds to the parts made of different materials Py on the bottom and Cu on top First we introduce the disorder parameters in Python yMax 10 MYSIZE W 0
20. TNAME one should use 15 hostname In the example when HOST is equal to Linux desktop the following options are used cc name of c compiler PYTHDR location of Python h to find it use locate Python h BLZHDR location of blitz blitz h BLZLIB location of libblitz so MYBLAS location of 1ibblas so and liblapack so Other libraries such as 1ibpython2 5 so libgfortran so are supposed to be location described by your PATH system variable Some debugging options can be also selected here i ACKCKCkCk KCkCk KC KC kCk KCKk KCKkCk KCKk Kok KK CK KK KU KK KK UK KK KK UK KU KU MK KU KK KG KG KG KK KG KO KG KC Kk kk kk Pie DOO ES OUPSSOESTI ONSSSTBE x KAKKKKKKKKKKKKKKKKKRKKKKKKKKKKKKKKKKKKKKKKKKKKKKEKKKKKKKKKKEKK CEEAGC SS gt SIS De EINIGE SAIS GEE AIcIDIR IS COIUINID AUR SINS CURD ILE hives rare Te CURIDIER 7 AD PCH nA LM I S CELAGS tS 02 EIC NG See OS 2 Pes ental isin cee nie tence US PCMAG oo a Co hn O elaine IO Cle wrote elena te se CIE INGE se D DESI UN IDI SID DIR IBUIG ING BORSE TENE Os IPG CEhAGS D DEBUG TORIS 5g However we do not think that this part of make should be changed 3 Compile and build KNIT We compile the application using make clean and make python commands Example of the trace user8 Linux desktop Work svn knit trunk make clean user iLinux desktop Work svn knit trunk make python 4 Testinstallation e Test if the application was
21. The first figure a illustrates the local current intensity when a bias voltage is applied to lead O and the other contacts are grounded 1 2 million sites blue colors corresponds to no current and red to maximum current One can observes the edge channel which is split by a first quantum point contact beam splitter and then recombined by the second one The second figure b shows the differential conductance between lead 0 and lead 3 as a function of the number of flux quanta through the hole One finds the usual cosine interference pattern See Phys Rev B 77 115119 2008 for more on this issue G e h The following figure shows a calculation of a H shaped sample made out of a p n junction of a topological insulator HgTe HgCdTe heterostrustures in presence of a strong magnetic field The plot shows a strong magneto conductance as a function of a parallel magnetic field along the x and y directions Datta Das transistor A tight binding model with 4 orbitals per sites is used in this calculation Calculation done in the group of Carlo Beenakker in Leiden A R Akhmerov C W Groth J Tworzydlo and C W J Beenakker Switching of electrical current by spin precession in the first Landau level of an inverted gap semiconductor Phys Rev B 80 195320 2009 This is a calculation of the Quantum Hall effect in a graphene Hall bar with zigzag nanoribbons The Hall conductance Oxy and longitudinal resistance px
22. Y shaped sample connected to 2 normal and 1 magnified by magnetic focussing The tight biding model superconducting electrode Group of Arne Brataas includes an electron hole grading to account for Trondheim Crossed Andreev reflection versus superconductivity Calculation done in the group of Arne electron transfer in three terminal graphene devices Brataas Trondheim Focused Crossed Andreev Havard Haugen Daniel Huertas Hernando Arne Reflection Havard Haugen Arne Brataas Xavier Brataas and Xavier Waintal Phys Rev B 81 174523 Waintal and Gerrit E W Bauer arXiv 1007 4653 2010 FIG 1 Examples of using KNIT for modelling mesoscopic systems KNIT computing Kernel is written entirely in C except for the external fortran BLAS library that takes care of the linear algebra An automatic wrapping technique is used to produce the interface with the PYTHON programming language providing fast development and many post and pre processing tools No C C knowledge is needed to use KNIT This document contains some material to get started with KNIT We hope that this tool will be useful to other researchers working in mesoscopic theory or experiment or even for educational purposes 2 KNIT quick tour 2 1 What exactly KNIT can do for you The input of a KNIT calculation is a quantum system connected to electrodes In practice one has to provide a tight biding model that describes the finite quantum region of interest as well as a
23. alid for systemtotal S considering scalarM spinM unreservoirN gt unreservoirN 5 unsysteme gt unsysteme S etc D System solver class tricot This class contains functions for realisation of the knitting algorithm for global transport properties of the system F return args return F args return Energy Returns the energy value COMPLEX energy value set saving level int level get saving level forward int move type Adds sites to the knitting thread int move type defines the way of adding sites For the thread between sites i and j where i j we can make four moves 0 le debut add one site to the beginning of the thread i 1 1 2 la fin add one site to the end of the thread j 1 2 ToEnd move to the End of the thread by adding all sites j 1 N 1 3 ToZero move to the Beginning of the thread by adding all sites i 1 0 backward int move type Removes sites from the knitting thread see forward int move type defines the way of unknitting sites For the thread between sites i and j where i j we can make four move types 0O le debut remove one site from the beginning of the thread i 1 la fin remove one site from the end of the thread j 2 FromEnd if jN 1 removes all sites of the thread starting from j 3 FromZero if i 0 removes all sites of the thread starting from i G LL int li int lj Calculates a contiguously ordered full Gree
24. are plotted as a function of inverse magnetic field a and carrier density b in presence of a small disordered potential 1096 of the hopping matrix elements The anomalous quantum Hall effect specific of graphene is nicely recovered The inset of b shows a zoom of the transition between plateaus Figure c shows the local current intensity when current is injected from both contact 1 and 4 which allows to study the edge channels See Phys Rev B 77 115119 2008 for more on this issue iA M xen This figure shows the spin accumulation profile of a magnetic nanopillar spin valve made of the following stack Copper 5 nm Permalloy 20 nm Copper 5 nm Permalloy 20 nm and Copper 5nm The symbols correspond to the calculations done using KNIT with a spin dependent tight binding model the error bar corresponds to the average over different symbols while the dashed line corresponds to a Random Matrix Theory aproach results not yet published L4 4 2020 e tota 02020 ae e p lt e 4 lt oo gt gt Pe rS b 4 gt z020 ote gt gt od rd pi gt lt M a Pa Ho gt e a Non superconductinz center contact A 0 lt i HHIEMZN ee a 4 ve Fw ZZ FF os MEA xum s f i rv ll oe ri po 4 b Superconducting center contact A U Calculations of Cross Andreev Reflection in a graphene This calculation shows Cross Andreev Reflection
25. ark bar py 20 5 Getting started with modeling 5 1 C kernel vs Python interface The Kernel of the KNIT modeling system is written in C and represents the main functionality of KNIT A user accesses this functionality via an interface written in Python Technically user has to write a simple script a Python program that will be interpreted by KNIT KNIT passes all Python function calls from the user script to its kernel and returns the results in a form defined by the user e g graphs plots flat data files Therefore all the implementation details are hidden from the user and a knowledge of C is not required In more details the KNIT architecture is addressed in section 8 of this document 5 2 Five modeling steps KNIT calculates local and global transport properties of a mesoscopic quantum systems In KNIT one considers a quantum system of N sites connected to several conducting electrodes also called leads User specifies the system its geometry and leads in a script file written in the Python language To write a Python script for KNIT user has to accomplish the following steps System construction Lead construction Total system construction System solving Visualisation of results mow gt In a tutorial below we illustrate how to proceed with these modeling steps We divide this tutorial into 5 parts by the number of steps to accomplish Each part contains a theory and a Python code related to a modelli
26. ave it into PDF file from pyx import g graph graphxy width 10 x graph axis linear title SWS V Guapheaxis linear buie 5o g plot graph data list MYDATA x 1 y 2 graph ot VS a sec bn v Sb el g plot graph data list MYDATA x 1 y 3 graph style line style linewidth Thick style linestyle dashed g plot graph data list MYDATA x 1 y 4 graph style line style linewidth Thin style linestyle dashed g writePDFfile s conductance Ct on m m C1 bo FIG 12 MyABCwithLeads conductance as a function of impurity strength W Solid line conductance from the lead 2 to the lead 3 Thick dashed line conductance from the lead 2 to the lead 1 Thin dashed line conductance from the lead 3 to the lead 1 Local Observables Finally we calculate the local observables System solved obs knitANDsew MyABCwithLeads E print obs conductance matrix MyABCwithLeads E Here function knitANDsew executes a knitting and sewing algorithm calculates local observables of the system conductance matrix calculates the conductance matrix for a given system We plot the local current coming from lead 2 Finally we calculate all the local observables from math import def currentdensity i leadInd 1 tmp 0 38 for z in range MyABCwithLeads fzmax vi MyABCwithLeads voisin i z if vi 1 and MyABCwithLeads sys2res i 0 and MyABCwithLeads sys2res vi lt 0 Gij system solved getG
27. ave the smooth shape To obtain better approximation one can take an average result on the set of many samples Each sample corresponds to the different disorder in its turn it is simulated by changing the seed of the generator of random numbers 6 2 Calculation of angular magneto conductance in magnetic multi layers with 3D geometry In this example we consider the calculation of spin accumulation for a Py Cu sample defined in 3D space In this Figure 18 illustrates the configuration of the sample We define the properties of the system with spin as follows t SPINI V spim 02 E 0 5 A System construction As in the previous example we construct a system as a superposition of three rectangular blocks and attach two leads MYSIZE 2 A knit rectangle_S MYSIZE 7 2 MYSIZE 3 MYSIZE 0 0 0 t V B knit rectangle S 3 MYSIZE 10 MYSIZE 3 MYSIZE 2 MYSIZE 0 0 t V C knit rectangle S MYSIZE 7 2 MYSIZE 3 MYSIZE 0 8 MYSIZE 0 t V A coller B A coller C interface contact l kntt rectangle S MYSTZE 7 15 55MYSTAZE 0 0 0 tV tnter tace Conta t 2 knit rectangles IMr SIZE l o Mro IZEI EOS IZE 1 0 t V 44 leadl knit unreservoirN S interface_contactl t lead2 knit unreservoirN S interface contact2 t mySystem3D knit systemtotal S A leadl mySystem3D addlead lead2 B Introducing a disorder To model properties that correspond to selected materials Py and Cu we add disorder to matrix elem
28. bolic link to better use libg2c so n gt libg2c so where n is the gfortran version number gfortran Required for linking C Available in standard installers as apt get with lapack 10 Swig 1 3 39 Simplified Wrapper http www swig org and Interface Generator Required for C Python code binding Why do I have to install all THIS Well if you want a pure C version of KNIT you need only blitz we used it for the tensor template class and Blas lapack which is THE standard library for linear algebra The program swig is used to generate a python wrapping of the C code i e python class that mimick the C class Those python classes do nothing except call the correct C function when needed Section 8 of this document contains a little more on KNIT architecture 4 2 Installation A LINUX Example Step by step setting up KNIT for LINUX Ubuntu 1 Preset the environment Check for gcc Check for Python python V if not on the machine install Python 2 5 or higher Install other Python dev Numeric numpy from the standard installer as apt get Install Blitz PyX lapack and swig following the instructions provided by these packages 14 e Check for gfortran library Sometimes one needs to create an appropriate symbolic links Iiblapack so XXX gt liblapack so libg2c so XXX gt libg2c so libgfortran so XXX gt libgfortran so Here is an example usere Linu eSkop WOR Sye kn E Era
29. d apyo 0 Op op where I Im 2j The related conductance is given by Landauer formula The non equilibrium local particle density and local current densities are defined through non equilibrium Green function The non equilibrium Green function G can be calculated between arbitrary sites i andj inside the sample using 1 and 3 The general formula using matrix multiplications reads as G GX G f iGI G fG l l l l T Im Z 13 diuo with is a distribution function in th lead that is characterized by chemical potential H l and temperature l lt An element of l can be calculated as follows ap l Lj Gr iGTG i 2 G7 MER GH ab NOTE when appears in a regular expressions not as an index it denotes imaginary unit 10 3 KNIT distribution Once you have downloaded and untared the KNIT archive typically with the command tar xzf knit tar gz under linux you will find a tree of directories Below is a brief description of their contents The directory wich ends with py contains python scripts Those are the interesting ones for most users The other directories are mostly used by the compiler documentation Contains this document as well as all the python examples explained in this document It also contains other documentation material like installation instructions comments on KNIT functions modifications done to KNIT during development knit_ README interface Contai
30. d define the geometry of the system For each site we should specify its hopping matrix t and its on site energy matrix V We specify this system as constructed of three blocks A B and C in 2d space To specify our sites we consider d 1 t knit scalarM 1 V knit scalarM O0 NOTE Dimension m cannot be changed Both t and V should be either scalarM or vectorM Values of t and V are matrices m x m where the selected dimension m defines a number of internal degrees of freedom at the site of the system for example spin e h s p d etc For the moment KNIT supports d 1 2 but can be generalized for arbitrary value of d In Python specification m 1 corresponds to the site type scalarM In this case values of t and V are scalars To specify d 2 we use site type vectorM In this case values of t and V are matrices 2 x 2 22 Building a system System construction is a process that connects sites together by assigning the list of neighbors to each site During construction each site receives its number Enumeration is continuous Fig 4 Example We define the geometry of a system its width W height H and depth D for the 3D space as scalar values that correspond to the number of sites on a given side of the rectangle for example In general to build a system we use function knit rectangle with the following signature knit rectangle W H D x0 y0 z0 t V Here x0 y0 z0 are coordinates of the bottom l
31. description of the electrodes The latter are semi infinite periodic systems The bare output of KNIT are various elements of the retarded Green function of the system Although several observables like the conductance can be obtained directly one has to fall back to the retarded Green function anytime a new observable is needed KNIT calculates only a subpart of all Green function elements a between the leads to study global transport properties of the system such as conductance Shot noise etc b at a given site inside the system to study single particle density c between neighbouring sites inside the system to study local current density As for b and c KNIT calculates the Retarded and the lesser i e non equilibrium Green function of the system If you don t know much about Green functions you can still use KNIT to calculate a few observables conductance mainly but will need to get acquainted with them to proceed further 2 2 A first practical Example The code listing below is a simple script written in Python programming language This is an example of input instructions for KNIT Sy cec cp AC ed m H P eS NP RP RP RP RP RP PP CSO AN DH PWD t knit scalarM 1 V knit scalarM 0 E 0 5 MyA knit rectangle MyB knit rectangle MyA coller MYB SATO UE interface contactl knit rectangle 1 4 0 3 inverrace contact Z knit vectangle 3 1 gt 0 leadl knit unreservoirN interface _contac
32. dex ind 0 size 1 where size is a system size total number of sites intz neighbour number z 0 zmax 1 where zmax is a maximum number of neighbours for a given site return int neighbour number if no neighbour that has an index ind gt return z ind SYSTEM CONSTRUCTION VIA BLOCK GLUING AND SITE MANIPULATION coller unsysteme B Merges itself with a system block B Overlapped part is taken from B system i e when physical coordinates of some native sites are equal to physical coordinates of some sites of B these native sites are replaced with the corresponding sites of B In a resulting system sites are re indexed to keep a continuous enumeration args unsysteme B A system block to glue on top return unsysteme Returns a pointer to itself 57 F addsite See add_site add site Array int 1 voisins adds a new site to the system with the neighbors list Array lt scalarM 1 gt hoppings voisins hopping list hoppings onsite energy V and scalarM V coordinate of this site coordinate Array int 1 coordinate args Array int 1 voisins list of neighbour indices Array Tmicromatrix 1 hoppings list of hoppings Tmicromatrix V on site energy Array int 1 coordinate physical coordinate return unsysteme Returns a pointer to itself move site Array int 1 voisins moves a site iii to a new coordinate coord by Array lt scalarM 1 gt hoppings assigning a new neighbour list voisins hopp
33. e noise local density of states is needed Python also provides simple graphical functions for pre and post treatments This paper is the KNIT documentation it provides the information about KNIT installation and modeling principles that helps new users to start working with KNIT fast it also provides a reference on KNIT functionality and describes the underlying algorithm addressing more advanced users of KNIT The KNIT algorithm is presented in details in the following paper K Kazymyrenko and X Waintal Knitting algorithm for calculating Green functions in quantum systems Phys Rev B 77 115119 2008 The core developers of KNIT are Kyril Kazymyrenko and Xavier Waintal This documentation has been written mainly by Irina Rychkova Other developers include Valentin Rychkov Simone Borlenghi and Havard Haugen KNIT is an open source project and is distributed freely We only ask you to acknowledge the fact that you used KNIT and cite the main KNIT paper ref 1 Phys Rev B 77 115119 2008 in the publications where KNIT was used To get the current version of KNIT contact Xavier Waintal at Xavier Waintal cea fr What you will find in this document 1 Introduction Where does this KNIT code comes from A few examples of calculations that have been performed with KNIT 2 KNIT quick tour a simple practical example and a brief theoretical introduction to the corresponding formalism 3 KNIT distribution what you will
34. ead size li 1 int li Leads O fNres return scalarM value of self energy class tricot S class couture S These classes are modifications of tricot and couture for the system with spin 7 2 Module spin py These module contains simplified Python functions for working with system micromatrices scalar and spin see example 4 3 spin Constructs a zero element spinM equivalent to vectorM 0 spin COMPLEX E Constructs a diagonal element spinM equivalent to vectorM E COMPLEX E value of a micromatrix vectorM zero matrix vectiorM v diagonal matrix v set int row int col complex value Sets the element row col of the matrix element to value int row col indices for spinM row col 0 1 complex value value F rotate spin element Array int 1 axe Rotates the spin element around the axe axe on the float angle angle angle see example 4 3 args spin element micromatrix element to rotate Array int 1 axe axe in the form 1 0 0 gt x 0 1 0 gt y 0 0 1 z float angle angle in radians 64 return spin rotated micromatrix element 7 3 Module obs py This module contains facilities to call the knitting kernel and compute observables D System solver conductance matrix systemetotal system For a given system calculates the COMPLEX Energy conductance matrix for the scalar 1 dim micromatrices args systemetotal system an infinite system with leads COMPLEX Energy energ
35. eft corner of our rectangle In our example we parameterize the system by using a size unit MYSIZE MYSIZE 1 This is advantageous if one wants to scale the system i e Increase the number of sites by keeping the same relative system geometry We build three blocks to produce a resulting geometry as illustrated in fig 5 a MyA knit rectangle MYSIZE 8 4 MYSIZE 0 3 MYSIZE t V MyB knit rectangle 3 MYSIZE 7 MYSIZE 5 MYSIZE 0 t V MyC knit rectangle 2 MYSIZE 6 MYSIZE 0 3 MYSIZE t V Building a system of required geometry In general the system of a required geometry can be constructed by e Gluing one block on top of another Adding sites Moving sites Moving all system shifting Building a system of required geometry coller Gluing is a process of connecting 2 or more system blocks together to produce a system with a required geometry Fig 5 illustrates a system built out of two blocks A B Blocks are glued one by one in our example in Fig 6 the block B is glued on top of A In a resulting system the overlapping parts between A and B are replaced with those of B this literally means gluing on top Technically gluing the lock B on top of the block A from the example in Fig 6 can be seen as 3 tasks 23 1 all sites of A that are overlapping in space with sites of B will be replaced with those of B Knitting of the AB system 2 All sites of the resulting system will be re enumerated to avoid si
36. ents of the corresponding sample parts For Py the disorder is described by the following expression 1 0 E i Wr 0 Em W x V 0 1 7 0 W X Where Re Re7 0 5 0 5 Im Im7 0 5 0 5 y 0 5 0 5 Ws 0 0 0 W 1 3 W2 4 2 For Cu the disorder is mad as follows X O 0 x Where y 0 5 0 5 and W 0 45 V W 2xMYSIZE ee Rotation FIG 18 System with 3D geometry FIG 19 2D plot of the system with the parameterization MSIZE 2 Disorder corresponds to the parts made of different 45 materials Py on the bottom and Cu on top Comparing to the previous example we have now 2 parts of Py and a middle layer of Cu We specify the function that introduces disorder in our system as follows def putDisorder import random random seed 666 for i in range mySystem3D fsize y mySystem3D coord i 1 y coordi te of the site if y gt wPyl and y lt wPyl wCu Cu al Secun lene Te cual dan C 0 s S ig y ever Tem D s Sule ROLAT I Seal CP TRE else Py iL 3e elo emchom 0 55 Vi new Spoiling Val ew seut rOr luxu 1 Vo omewsseut 0 Ll 0 Vil mew serll O 0 Wal new Sect l l fuc MY SV SESS jou HOIA a Wel nen ksiRe random random 0 5 koiriin random 1 S369 t 0 amp etaRe random random 0 5 eue random random 0 5 Ole 42 a E a EC ID sas Ze 8 ti new spin Eu Mew Sei 0 0 Wsio gt ks
37. find in the various directories of the KNIT package 4 System requirements and installation how to make KNIT work on your machine KNIT works very well on Linux It has been seen to work well on Mac If you want to compile it on Windows you re on your own 5 Getting started with modeling A step by step explanation of how to build your own systems and calculate its transport properties This section also explains the main functions needed to adapt the existing examples to your own systems 6 More advanced examples Advanced usage including modeling of graphene and how to optimize the calculation to save your computational resources 7 System functionality advanced usage what other functions are available 8 System architecture advanced understanding how the system is built 1 Introduction Algorithms like the Recursive Green Function RGF algorithm have been around for several decades now Those algorithms are based on a tight biding description of a finite quantum system which is coupled to several semi infinite electrodes In its basic form the RGF algorithm starts from a left electrode and recursively adds layers of the system until one reaches the second right electrode Even this simplest form has proved to be very useful for simulating various mesoscopic systems An early version written by Rodolfo Jalabert was referred in the community as The Program As time went on and numerical simulations became more popular more
38. he block A was positioned incorrectly MyA knit rectangle MYSIZE 8 4 MYSIZE 3 3 MYSIZE t V as a gluing result we obtain the system configuration as shown in Fig 6 b This configuration is incorrect as block C cannot be glued to AB P l 224 251 26 21 28 297 78307 23t FIG 6 Gluing of blocks B and C on top of the block A The images are produced by KNIT the system sites are connected if they have an edge between them Otherwise the sites are disconnected a system ABC is built correctly b Due to incorrect positioning of the block A the block C is disconnected from the system This system will not be solved NOTE geometry type 2D or 3D must be the same for all the building blocks and the leads Building a system of required geometry add site Adding a site we specify a new site in some position newX newY newZ for 3D This is illustrated in Fig 7 b 25 Example We add a site to the system by specifying its coordinates and a neighbor list Coordinates Hnrraddesateu Stell te i eS ale a E n Indices of neighbours Building a system of required geometry Moving a site technically means reassignment of its neighbors In KNIT we can move the site i to a new position newX newY newZ for 3D This is illustrated in Fig 7 c Example In the system fig 7 a we move the site number 13 by assigning to it new coordinates and new neighbor list
39. ider a system with spin system sites should be defined as spinM elements The value v of spinM micromatrix is a matrix 4x4 of COMPLEX numbers vectorM creates a ZERO matrix v vectorM COMPLEX v createsa diagonal matrix v args COMPLEX v value of a micromatrix vectorM zero matrix vectiorM v diagonal matrix v C vectorM vectorM vv copy constructor v vv args vectorM vv a micromatrix to copy from F hconjugate calculates Hermitian conjugate for v return spinM F inverse inverses v v 1 v return spinM set const int i const sets the element i j to E int j COMPLEX E args int i row number O 1 int j column number O 1 E new value return spinM System types class unsysteme represents a system defined with scalarM micromatrix type system without spin C unsysteme Creates an empty system unsysteme unsysteme s Copy constructor creates a copy of s SYSTEM PROPERTIES F fdim Returns system dimension return int F fsize Returns total number of sites in the system return int F fzmax Returns maximum possible number of neighbours for a system site return int OPERATIONS WITH SITES F indice Array lt int 1 gt coord Returns the site index by its coordinates given as a 1D array coord see also coord args Array lt int 1 gt coord similar to int dim where dim is a dimensionality of the system for example coord O 55 return return args
40. ings from scalarM V this site and onsite energy V Array int 1 coordinate int iii args Array int 1 voisins list of neighbours Array scalarM 1 hoppings list of hoppings scalarM V on site energy Array lt int 1 gt coordinate physical coordinate int iii site index return unsysteme Returns a pointer to itself movesite See move_site shift system Array int 1 delta Shifts the hole system on the vector delta in coordinate space All the site properties rest the same args Array int 1 delta shift vector return unsysteme Returns a pointer to the shifted system class rectangle extends unsysteme This class defines a rectangular system without spin All functions of unsysteme are also defined for rectangle Supplementary functions are defined below rectangle Array lt int 1 gt geometry Array lt int 1 gt X Constructor from size hopping and on site bottom left corner energy scalarM t scalarM V Array int 1 geometry physical size of the block given as an Array of integers width height depth for 3D geometry Array int 1 bottom left corner absolute coordinates of the bottom left corner of the block given as an Array of integers xO yO zO for 3D case scalarM t hopping matrix scalarM V on site energy matrix 58 class unsysteme S class rectangle S extends unsysteme S Represent a system with a spin and a rectangular system with a spin i e micr
41. k sudo Tu sv usq lib labo tortran so 2 Zero Emp Gp ET HO SC In our example the package is extracted into work svn knit folder 2 Changes in KNIT package e Extract the svn knit package in some directory e In svn knit Trunk modify knit Makefile by customizing it for your particular machine and OS distribution Example i CAP WAY VAY WAY YAY VAY VAY VeY OS Yay Way CSS Yay AY VAS CAS WAY Gay VAY Yay Ve Yay Yay Cay WAY VAY VAY TARTS Dy ey Way VAY Guy SS CU VAY VAY ay y ey Gay WAY WAY VAY GAY ey Way AY YeY VeY US Yay WAS AY VAY VAY VS L MACHINE SPECIILE IC PART9 e ADD LIES CORRESPONDING TO YOUR MACHINE HERE i TAY TAY TAY TAY TAY VAY VAY T amp v TAY Tay US TAY Tay VAS VAS VAS Vey ANAKA VAS WAY TAY VAY VAS Yay Rey WM TV TS STS DS US US Wy ES Way US Ves CAS TAS GAS VAY Yay Wy Uv LY STS TW DNO DW AS DX DS s lene alinves el Sb weusstelodkc sb Giecleie eV qo Uie eM ilove EUIS xS ails TES POETE HOST Stsmell echo 998O0e1I1B2 E ieee ST rI oO S S error HOSTNAME is not defined endif DRE Chiy boo FOR MY USER LINUX DESKTOP eec eM cibum NE EE S PATER lens dot om CC oft PYTHDR usr include python2 5 EZB Sed de BLZLIB usr lib MYBLAS usr lib BELAG o CETTE ccpod tco armi cues ENS ecce od lpython2 5 LS BLZLIB Iblitz endif Explanations HosT name of the computer Note that on different Linux distributions command echo SHOSTNAME may work differently For example on Ubuntu Linux instead of echo SHOS
42. l leads G E E H i EE m From now on we consider the transport at fixed energy E and omit it as an argument of Greens functions and self energies The Green function G is N X m X N X m matrix where WV is total number of sites in the system m is the number of internal degrees f of freedom An element of Green function ij correspond to the quantum mechanical amplitude to go from I th site in internal state O to j th site in state 7 KNIT allows calculating two types of elements of G matrix 1 a b where a and b sites that belong to the interface between a system and a leads kand 1 6 7 1 m 2 G Where b is a site that belongs to the interface between a system and a lead F i is an arbitrary site inside the system 6 7 1 m Self energy of different leads is also calculated in KNIT The KNIT examples considered in this documentation corresponds to m 1 2 Using the code for larger values of m is straightforward but requires modifying the file swig knit i and recompiling 07 3 a b defines self energy matrix between different sites 1 and i belonging to the same lead I with internal degrees of freedom 0 7 1 respectively Knowing 1 2 and 3 one can calculate different local and global properties of a system Here are several examples The transmission probability between different leads k can be calculated using 1 and 2 eG i 1 2 G DEI CK aJ cb dic aj b c
43. lated recursively taking into account the calculations for all previously added sites Assuming the knitting from to k at each knitting step the algorithm momentarily stores and updates the value of Green function for all sites of the lead and for those sites of the system for which NOT all their neighbors are knitted yet shaded circles These sites are said to belong to the knitting interface Knitting is continued until all the N sites are added Eventually G is calculated Those matrix elements give access to all transport properties like conductance or shot noise but no information on what happens inside the sample For these purposes the sewing algorithm is implemented Direction of knitting Mg i lt M Neotal ML CPU ML CPU 3 8 a b FIG 9 a Knitting System has two leads and k The knitting algorithm adds sites one by one The thick dashed line separates the part already included left from the part that is still to be knitted to the system right b Performance of knitting and sewing algorithms depending on the system geometry The sewing algorithm extends the knitting algorithm to the calculations of local observables For a given site i of the system the sewing algorithm stores a value of the partial Green function G obtained by knitting The second part of this algorithm calculates the exact value of the retarded Green function G by applying the knitting 31 algorithm in
44. lesser i z leadInd 0 0 Vji MyABCwithLeads get Hopp i z 0 0 conjugate tap eNotes ge Galea Re SETTE Leti return sgr Emp print system colorplot2D MyABCwithLeads s cur currentdensity Function getG_lesser returns of Lesser Green function between the site i and its z th neighbour given that the electrons are injected with probability 1 from the lead leadind Function get_Hopp from the module knit py see next section for details returns the hopping between the site i and its z th neighbour FIG 13 MyABCwithLeads current from the lead 2 Red maximum current Blue no current 6 2 Calculation of spin accumulation for a 3D system with spin In this example we consider the calculation of spin accumulation for a Py Cu sample defined in 3D space In this Figure 14 illustrates the configuration of the sample To make spin related calculations we will use the module spin py weiner Sys ccce yori A a ON dLSLIOTO vr SENTO ONCE IE JS OT AUNO ieee from libpy spin import 39 We define the properties of the system with spin as follows t spin l V spin 07 H 0 5 A System construction As in the previous example we construct a system as a superposition of three rectangular blocks MLS adu d A knit rectangle S MYSIZE 7 2 MYSIZE 3 MYSIZE 0 0 0 t V B knit rectangle S 3 MYSIZE 10 MYSIZE 3 MYSIZE 2 MYSIZE 0 0 t V C knit rectangle S MYSIZE 7 2 MYSIZE 3 MYSIZE 0 8 MY
45. loat myFun _ lt S_file gt data unsysteme system a pointer to the system to plot string s file the resulting file name function that returns float myFun the target function colorplot2D unsysteme system Plots the system and fills the system area with colors The string s file color at each system point is calculated based on the value function that returns float myFun of the function myFun calculated at this point unsysteme system a pointer to the system to plot string s file the resulting file name function that returns float myFun the target function that calculates the color values to fill the plot area 67 8 System architecture The KNIT system is based on a C library for calculating Green functions in non interacting tight biding Models KNIT Kernel It is based on a generalization of the standard Recursive Green Function Algorithm The library provides for a very large class of systems convenient tools to 1 build tight biding models for multi terminal systems with complicated geometries and arbitrary internal degrees of freedom like spin or electron hole or s p d orbitals 2 calculate the transport properties of the system conductance shot noise transmission eigenvalues 3 calculate out of equilibrium local quantities inside the system such as local currents or local density of states The library is written in C and can be used in C programs However a much more convenient
46. m pa cde ug ROwaber yl scm e cM sm s obs conductance matrix S sample E MY DAI celtod ESO oan so lo We plot the results from pyx import g graph graphxy width 10 x graph axis linear title S phis y graph axis linear title Sg h e 2 g plot graph data list MYDATA x 1 y 3 graph style 1line style linewidth Thick g writePDFfile fileN cond For more details on plot parameters see documentation for pyx library 4 47 FIG 20 angular magneto resistance for a Py Cu Py sample 6 3 Calculation for a simple graphene ribbon In contrast to the regular square or cubic crystal lattices considered above graphene requires a hexagonal crystal lattice 3 FIG 21 a Hexagonal crystal lattice of graphene b Graphene lattice construction A and B two characteristic site types n m label the hexagons along the two directions Each site in the ribbon can be expressed in terms of its distance from A or from B in units of m and or n For example site x A n m A System construction To implement the hexagonal lattice we introduce the following functions in Python 48 coordonance 4 INTRODUCING THE COORDINATE IN GRAPHENE SPACE n m label the hexagons along the two directions AorB weither we are talking about aA site or a B site 4 From n m AorB to x y def XY n m AorB if AorB A AorB 0 1f AorB B AorB 1 x 3 dx n 2 dx AorB y dy n 2 dy m return x y
47. m b two leads are connected to the system The lead sites substitute the system sites When the system is constructed we attach the leads to our system and obtain the resulting system with leads 29 MyABCwithLeads knit systemt tal MyABC lead1 MyABCwithLeads addlead lead2 To add the second and further leads to the system we use the method addlead NOTE in order to be solved system must have a source of particles i e at least one lead must be specified and attached to the system To verify that the leads are correctly connected to the system we can plot the system using VisuZD system visuZD MyABCwithLeads ANOTHER FILE NAME gt NOTE for displaying 3D systems visu3D should be used instead of visu2D The signature is the same 0 i 2 os A amp 96 7 FIG 9 System MyABCwithLeads Sites of interface contacts are shown here in orange color D SYSTEM SOLVING 30 KNIT solver calculates i global transport properties of the system using the knitting algorithm ii local observables of the system using the sewing algorithm The knitting algorithm calculates the retarded Green function of the system connected to external leads as described in section 1 2 More precisely the Green function G between site a of a lead and a site b of a lead k is calculated fig 9 Calculation is done by adding sites one by one to the knitting thread Green function G for each added site i is calcu
48. m site with the index ind moves it to the new position with coordinates n1 n2 in our 2D model x y associates the this site with the new neighbors v1 v2 and assigns new hopping and onsite energy matrices to this site These and other KNIT functions are specified in more formal way in the next section of this document Now when we have finished with the system geometry let s have a look at the system properties Introducing disorder Until now all the sites of the system had the same value of the on site energy V 0 Now we introduce the disorder to our system by changing the on site energy in a certain part of the system To do so we specify a method myDisorder as follows def myDisorder W import random random seed 666 for ix in range 2 MYSIZE for iy in range 2 MYSIZE y MyABCweXPhMheadsszrxndrcer t ixt245MWESIZE 0y33 MY9T4m MyABCwithLeads put Hdiag i knit scalarM W random random 0 5 This method changes the value of V for the sites in a certain square area within the system To change the value of V for the sites we use the method put Hdiag its first parameter is the index of a target site and the second parameter is a new value of V This is equivalent to introducing the impurities into the system We can also visualize the resulting distribution of potential on the system as follows def potential i return MyABCwithLeads get Hdiag i 0 0 real MYDS Order o print system colorplot2D My
49. n Monen EES Vay Ee e a deel monsys knit rectangle 1 1 x y t Hd for m in range m max ind 1 movo WON ems ieee aly be yee EIC S cou I DICIS OS ind 1 Insee OD ce d EC Oat Exe Ae estes eG TD UNS Ceo OL a for n in range n max for m in range m max tl ind 1 mover one Se dc Dt E d aml Oils S MICH for m in range m max ind 1 Inowceonescq i A NECI ATO DSL CUTS VE PE nt f noma x ind 1 Inowuccsonescgisci modem AO eric Moles ame x 47 return monsys We also introduce a constructor for the lead that builds a zigzag shaped lead d AkGZaAge wor Meith lt om right eked det Zig zagheadhR hy mmus Mama Inna text e Ma SES LR O Left lead LR 1 Right lead if LR RIGHT LR 1 if LR LEFT LR 0 x y Init_xy ee Cine Meme ER monsys knit rectangle 1 1 x X y Y t Ho for m in range m_mint l m_max 1l add_one_site n m LR t Hd monsys x y for m in range momen momexl add one Site n m AER tb Hd moneys x y a knit unreservoirN monsys knit scalarM 0 0 L m max m min i1 for i in range L 50 a put_leadHopp i i L t for i in range L 1 a put_leadHopp i LR i L 1 LR t for i in range L a put_leadHopp i L i knit scalarM 1 e 5 return a Building the system t knit scalarM 1 Hd knit scalarM 0 eua ous mL Me We add two more sites on the edges add one site N M A t Hd a add orne Srece i BU c d We construct leads and make the total sy
50. n function between lead li lead lj amplitudes of transition probability int li lj indices of leads GF type Green function G int sys i int sys j Calculates a Green Function element for system sites i j int i j indices of system sites Array COMPLEX 2 Green function element G Calculates full GF for energy E 62 return GF_type Green function getG LL int i1 int li1 int i2 int li2 Returns retarded Green function between the sites i1 and i2 belonging to the leads li1 and li2 respectively ij args int i1 i2 The indices of lead sites i1 0 lead size li1 1 i2 0 lead size li2 1 int li1 li2 Leads O fNres return GF type Retarder Green function getSE int i int j int li For the lead number li and sites i j of this lead returns self energy args int i j indices on sites on the lead li i j 0 lead size li 1 int li index of a lead li 0 fNrez 1 return scalar value of self energy F p_system Returns the pointer to the total system return systemtotal system with leads SE int li For the lead number li returns value of a contiguously ordered self energy args int In index of a lead return GF type Value of self energy on the lead GF type defines a Green Function type as a data structure with 4 components GF i alpha j beta Each component is a complex number class couture This class contains functions for realisation of the sewing algorithm for calculation
51. ng step 5 3 Tutorial Calculation of conductance matrix for a 2D system with two leads A SYSTEM CONSTRUCTION System and Site In KNIT a system can be specified in 2D 3D space In 2D space for example the system is characterized by its height and with W H and represents a finite number of sites enumerated from 1 toN WxH 21 FIG 4 A simple example of a 2D system A specified as a rectangle 8x4 with 32 sites Along these lines the system in 3D space is specified by a triple H W D and the set of W x H xD sites All the reasoning below can be extended for the 3D systems Each site i i 1 N 1 of the system in KNIT is specified using a micromatrix Vi and a vector tij j 0 maxN of hopping matrices Micromatrix Vi corresponds to the on site energy matrix from the equation 1 for the site i it has a dimension m x m and reflects the microscopic degree of freedom of a system as explained in section 1 3 Vector tij j20 maxN contains hopping matrices Eq 1 between the site i and its j th neighbour For a given site each element of tij specifies probability amplitudes for an electron to hop from this site to its neighbor j maxN is a maximum number of neighbours for a given geometry for regular 2D space maxN 4 for regular 3D space maxN 6 for graphene hexagon structure maxN 3 Example To construct a rectangular system we should specify the sites by defining intersite hopping t and onsite energy V an
52. ns scripts files for the automatic wrapping of the C core into python This directory is only used at compilation times Advanced users might want to modify the file swig knit 1 which defines the links between all C objects classes functions and methods and their corresponding Python objects generated by swig This is necessary to compile the codes with more than two orbitals per site lib Contains some general C files not specific to KNIT libpy Contains KNIT Python module Once the compilation has been done libpy is the only thing that remains useful for the user you can copy it somewhere else and use knit functionalities from there In particular the file knit py contains the main module obtained by the automatic swig wrapping examples C examples of KNIT for developers who prefers not to use Python but C Those were used in the development stage of KNIT Mostly obsolete now examplespy Contains examples of systems modelled with KNIT advanced examples with limited or no comments Whenever you want to create a new system you can have a look at this directory and see if part you need has not been done already Includes examples with graphene magnetic field non collinear spin structures superconductivity basic parallelism tutorialpy Contains well commented basic examples helpful for new users This was the only documentation before this document was written A quick way to learn KNIT is to study and run
53. o finish our installation process by executing the following Serora na deskr on Wom SN DIES erunk OEC e POE O Ea user8 Linux desktop Work svn knit trunk tutorialpy python simplest examplel py b MacOS This is a short help to compile knit on MacOS 1 Preset the environment Install Xcode from the system DVD Check that libblas dylib and liplapack dylib are installed in usr lib Optionally an optimized library libmkl lapack dylib can be installed by installing Intell C compiler for Mac from the intell web site A commercial version only but exists a trial version Using macports install a python sudo port install python b Blitz sudo port install blitz c SWIg sudo port install swig Install numpy an old Python package Numeric will not work Install PyX Check the paths for Python h Numeric arrayobject h blitz array h 17 2 Changes in KNIT package e Extract the svn_knit package in some directory e file interface knit_Python_Data C In the header add new line typedef unsigned int uint e file interface knit_system h Change static int const not lead 1 to static char const not lead 1 e In svn knit Trunk modify knit Makefile by customizing it for your particular machine and OS distribution Example p di di dir di di di dir dir dir dir div di dir div dir dir di div dir dir dir dir dios di dir dir dir dir dir dir dir dir dir dir dir dir dir
54. of conductance matrix for different energies for graphene ribbon Our tutorial does not cover all the knit functionality The rest of the important functions are addressed in section 5 of this document 53 7 List of available KNIT functions and methods KNIT user functions are defined in the svn knit libpy directory Three KNIT modules knit py obs py and system py cover all five KNIT modeling steps defined in section 4 1 System construction Lead construction Total system construction System solving Visualisation of results MOO Wb In this section we provide KNIT functions specifications for each of these steps Abbreviations C class constructor specification F function specification args argument list return return type 7 1 Module knit py This module is built by SWIG from the c Kernel It provides functions to work with a system its sites and their parameters A System construction Site types class scalarM no spin scalarM is a simplest type of micromatrix The value v of a scalarM micromatrix is a COMPLEX number scalarM creates a ZERO element v scalarM COMPLEX v creates a value v args COMPLEX v value of a micromatrix scalarM zero element or O scalarM v value v F hconjugate calculates Hermitian conjugate of the value v return scalarM F inverse inverses the value v of scalarM v 1 v return scalarM 54 class spinM with spin To cons
55. omatrix type is spinM All functions defined for the system without spin see class unsysteme above are also valid for the system with spin assuming that all parameters of the type scalarM are replaced with the corresponding parameters of the type spinM B Leads construction class unreservoir extends unsysteme F green COMPLEX E Calculates a Green function of a lead interface for the energy E selfE COMPLEX E Calculates a self energy of a lead interface for the energy E supposing the lead is connected with a system via inter slice hopping F G SE COMPLEX E Calculates a pair Green Function Self Energy of a lead class unreservoirN extends unreservoir Numerical reservoir lead for a system without spin scalarM type of the micromatrices extends the class unreservoir unreservoirN unreservoirN R a copy constructor unreservoirN R a numerical reservoir to copy unreservoirN unsysteme i scalarM t constructs a semi infinite lead from the interface part i and a hopping matrix t between a system and a lead unsysteme i an interface between the system and a lead typically defined as a system with only one layer of sites in one of its dimensions scalarM t a hopping matrix between a system and a lead green COMPLEX E Calculates a Green function of a lead interface for the energy E args COMPLEX E value of energy return GF type a Green function represented by an Array lt COMPLEX 4 gt selfE COMPLEX
56. ottom left corner of one of the blocks of the system After specifying the interface of the lead we construct the lead itself using a function Lead unreservoirN Interface Contact t formally speaking it repeats the Interface Contact infinite number of times The hopping between different slices of the lead is t In our example we specify the interfaces and create the leads as illustrated in fig 9 a interface contactl knit rectangle 11 MYoSIZE 6 T0 MYSIZE 3l t7 V leadl knit unreservoirN interface contactl t interfaco Contact knit rectangle IM SIZE gt IIIA SN qu Mp 28 lead2 knit unreservoirN interface contact2 t NOTE for a 2D system interface must be also specified as 2D rectangles The same is valid for the 3D system We use the same hopping matrix t for specifying the system and the lead Repeating this step modeler can specify an arbitrary number of leads NOTE The interface sites belong both to the system and to the lead The hopping matrix elements from the lead to the system are exactly the same as those inside lead itself C INFINITE SYSTEM CONSTRUCTION Similarly to a simple rectangular system the lead should be glued on one of the system sides i e it should the lead interface contact that was duplicated to create a lead have correct physical coordinates interface1 a FIG 8 Leads a Specification of the first lead it must overlap exactly one layer of sites of the syste
57. owerful in term of saving human time codes are more versatile age better and easily interact with other software Before going to the technical part of this documentation we quickly show below a few examples of what has already been done with the code Readers interested in the physics and the detailed of the modeling are referred to the corresponding scientific papers Here we merely illustrate the sort of things that KNIT can do Examples include e Calculations of the transport properties of an electronic Mach Zehnder interferometer in a 2D gas in the Quantum Hall Regime Fig 1 upper left e Anomalous Quantum Hall effect in a Hall bar made out of graphene nanoribbons Fig 1 upper right e Calculation of the magneto transport properties in a p n junction made in a 2D topological insulator CdTe HgCdTe heterostructure This work has been done in the group of Carlo Beenakker see Ref 2 Fig 1 middle left e Spin accumulation in a magnetic nano pillar Fig 1 middle right e Cross Andreev Reflection in a graphene Y sample connected to 2 normal and 1 superconducting lead group of Arne Brataas see Ref 6 Fig 1 lower left e Magnetic focussing and Cross Andreev Reflection in a 2DEG group of Arne Brataas see Ref 7 Fig 1 lower right Here we show a calculation of an electronic Mach Zehnder interferometer in the quantum Hall regime where the 2D gas is modeled by a simple scalar tight biding model on a square lattice
58. r results in a tabular form on the screen Graphical using PyX and predefined functions from the library sys One of the methods VisuZD for system visualization was already used in this example system visu2D MyABCwithLeads lt FILE NAME gt Examples visualization using PyX will be explained in the next section of this document 33 6 Advanced KNIT examples 6 1 Calculation of local observables for a 2D system with three leads In this example we take as a basis our ABC system with the geometry as shown in fig 6 a 7 a IMOOLE Sys Sys Paul pedi 2 IET OT J alloyony A OO s bt khit scealarM 1 V knit scalarM 0 R 0 5 We parametrize the system with the parameter MYSIZE 4 MYSIZE 4 Mya iis rectangle i SIZE c dJ MYOGIZEI IO o MYSIZEI V My Bekmit rre ta gee MrS TZE MO TZEI eo MY IZE OI E V MC kait recrangle MSE A ME SIT Zu MSIE s Myo CO len MB MyA coller MyC Here we parametrise the system with MYSIZE 4 this is equivalent to x4 zoom i e we have 4 times more sites for the given geometry then having MSIZE 1 We specify three leads and attach them to our system as follows Making interfaces gm cnamdgcosmeonmt ew inge cmn M Solan S SN SIZE EU Paer traCe Con aa leen ang cus MN Seu s SE oS laterro eon aot kni ree reis Mu eT zm 2e eu Suc Vu E jme S Making leads leadl knit unreservoirN interface contactl t lead2 knit unreservoirN interface contact2 t lead3 knit unre
59. responding index of this site in the system int leadN lead number 0 Nrez 1 int index lead index of a lead site 0 lead size lead 1 int corresponding index of a system site sys2res int ind Interface sites are sites that belong both to a lead and to the system these sites have double indexation For a system interface site with index ind this function returns the lead number to which this site is connected returns not lead if given system site does not belong to any lead index of a system site lead number 0 Nrez 1 or not lead sys2res ind int ind Interface sites are sites that belong both to a lead and to the system these sites have double indexation For a system site with index ind this function returns the corresponding index of this site in the lead see also res2sys int ind index of a system site int corresponding index of a lead site class unreservoir S extends unsysteme S class unreservoirN S extends unreservoir S These classes are modifications of unreservoir and unreservoirN for the system with spin All functions defined for the unreservoir and unreservoirN above are also valid for 61 unreservoirN_S assuming that all parameters of the type scalarM are replaced with the corresponding parameters of the type spinM class systemtotal S extends unsysteme S This class describes an infinite system with leads and spin As above all functions defined for the systemtotal are v
60. rn systemtotal a pointer to itself INFINITE SYSTEM PROPERTIES F fNres Returns number of leads return int number of leads of the system F p lead int leadN For a given lead number eadN returns a pointer to this lead args intleadN lead number return unreservoir a pointer to a lead lead size int leadN For a given lead number leadN returns a size of this lead number of its sites args intleadN lead number return Int lead size return return args return args return args return max lead size Returns a maximum lead size among all connected to the system Int max lead size OPERATIONS BETWEEN LEAD SITES AND THEIR NEIGHBOURS lead voisin int leadN int index lead Similarly to the function voisin defined in the class int z unsysteme for the lead number leadN and its site with index index lead this function returns the index of its z th neighbour if it also belongs to this lead Otherwise returns not lead int leadN lead number 0 Nrez 1 int index lead index of a lead site 0 lead size lead 1 intz neighbour number z 0 zmax 1 where zmax is a maximum number of neighbours for a given site int index of a lead site res2sys int leadN int index lead Interface sites are sites that belong both to a lead and to the system these sites have double indexation For the lead number eadN and a lead site with index index lead this function returns the cor
61. servoirN interface contact3 t Attaching leads MyABCwithLeads knit systemtotal MyA leadl MyABCwithLeads addlead lead2 MyABCwithLeads addlead lead3 In the resulting system we wish to make a hole For this purposes we specify the following method 34 def makeHole posX posY for x in range w for y in range h MyABCwithLeads move site MyABCwithLeads indice posx x 7 MYSIZE y 1 MyABCwithLeads indice posx x 1 7 MYSIZE I t V lA MYSIE x SESS TUS SETUP Ree MyABCwithLeads indice x posX yt CORE M Por Wy This method will make a rectangular hole in our system by moving sites from the central part of the system to its upper part posX posY are x and y coordinates of the bottom left corner of the hole w h are width and height of the hole We apply this method as follows makeHole 4 MYSIZE 5 MYSIZE 1 2 MYSIZE MYSIZE And visualize the result IMPOrt oS S sys argv 0 System visu2D MyABCwithLeads s t system epeal X 0 1 2 8 4 5 G amp G 7 B8 9 HH 17 18 14 1d5 16 17 18 149 20 25 22 29 24 25 26 7T 28 79 9 0 NY lead2 FIG 10 MyABCwithLeads with 3 leads and a hole 35 The method makeHole uses functions defined by KNIT for the system indice and move site Function indice returns the index of the system site providing its coordinates n1 n2 in our 2D model x y Function move site v1 vZ hoppings onsite energy n1 n2 ind does the following finds the syste
62. stem degree DT secu SARI monsys knit systemtotal a lead0 jos Zac g ead ERAN O10 Ole nay iG ih monsys addlead lead1 Result is plotted using standard function visu2D as explained above The plot is illustrated in Fig 22 51 FIG 22 simplest_graphene example the system monsys plotted with visu2D B Solving NOTE With the lead solver than we are currently using the hopping matrix t from one layer to the next of the lead has to be invertible There is no fundamental reason for that and this should be fixed in later releases As this matrix is not invertible for graphene we use a trick of adding a small matrix to t typically 1e 5 smaller than the bandwidth The trick works well for medium size systems but eventually become unstable Using KNIT we calculate the conductance matrix for graphene ribbon and plot the result for different energies MYDATA Ndata 101 for i in range Ndata E oc sec N E 05 G MATRIX obs conductance matrix monsys E MYDATA append E G_MATRIX 0 1 52 print E G MATRIX 0O 1 dor TBI 2o Looe g graph graphxy width 20 x graph axis linear title SES y graph axis linear title G g plot graph data list MYDATA x 1 y 2 forplot sys argv 0 res_new str M X str N g writeEPSfile forplot g writePDFfile forplot 8 XX XX XXX X XX 6 XXXXXC ROKK D OOK XX XXX OOK 4 OOK OOK OOK OX OOX XXXX 2 XXX XXX XX OOOOOOOOOOOOOK XX FIG 22 Calculation
63. stems in fig 9 b as follows N total CPU X M M ML i l This calculation shows that for systems that are longer then wider the calculation time can be substantially reduced For the square systems with M L we can also write CPU L and for the cube with the side equal L CPU L E VISUALIZATION OF RESULTS 32 The last stage of mesoscopic system modeling with KNIT is result visualization After the system is solved a distribution of on site observable parameters in the system or its transport properties can be visualized Apart from simple textual regime KNIT uses the capabilities of the PyX graphical package to produce plots PyX http pyx sourceforge net is a package for creating 2d and 3d plots developed for Python Among the main features of PyX we can list the following PostScript and PDF output for figures Seamless TeX LaTeX integration advanced geometric operations on paths like intersections transformations splitting smoothing etc sophisticated graph generation modular design pluggable axes axes partitioning based on rational number arithmetics flexible graph styles etc For more details we address the reader to the PyX documentation on the official website http x sourceforge net One can implement its own way to represent the data for example using matplotlib package or mayavi package Textual using print a b c In our example operator print displays ou
64. te number duplication 3 Neighbors for each site will be reassigned Note the enumeration of sites of the final system in KNIT depends on the order in which the rectangles are glued and should be verified in each case FIG 5 A System built out of 2 blocks A and B by gluing To build a system of a required geometry modeler has to define necessary blocks and position them in 2D or 3D space by specifying physical coordinates of the bottom left corner of each block xo yo or Xo yo Zo for 3D Based on these coordinates the overlapping parts of the blocks are identified and gluing is made If there is no overlapping between blocks sites cannot be connected for future knitting Example We glue B and C on top of A as follows MyA coller MyB MyA coller MyC The resulting ABC system in fact is constructed on the base of the system myA so we can write MyABC MyA Technically there is a one to one correspondence between the site number i and its physical coordinates x y z 24 To verify that the resulting system has a required geometry the system can be plotted using a python function visu2D system visu2D MyABC SOME FILE NAME gt visu2D makes a plot of our system MyABC and writes this plot into the files lt SOME FILE NAME eps and SOME FILE NAME gt pdf Based on the coordinates of the blocks A B C specified above we obtain the system configuration as illustrated in Fig 6 a Assuming that t
65. tees precision but memory consuming default value O no saving useful only for transmission calculations or very knit only n Saves full GF after each steps n should be order of M where M is a maximum sewing interface size return pointer to the data structure with solved system F knitANDsew S systemtotal S system Implements knitANDsew see above for 65 COMPLEX Energy int savinglevel 1 systems with spin savinglevel level of saving 1 exact version saves full GF at each step guarantees precision but memory consuming default value O no saving useful only for transmission calculations or very knit only n Saves full GF after each steps n should be order of M where M is a maximum sewing interface size return pointer to the data structure with solved system Green unsysteme S lead1 unsysteme S Calculates retarded Green function lead2 int sigma int eta tricot S knitted system systemtotal S s total G where Ct and b are sites that belong to the interfaces between a system and leads k and I respectively unsysteme unsysteme S lead1 lead k unsysteme unsysteme S lead2 lead I int sigma spin degree of freedom 1 m int eta spin degree of freedom 1 m tricot tricot_S knitted_system result of knitting pointer on kniter systemtotal systemtotal S s total the system return COMPLEX A matrix of the size m x n where m s total lead_size lead1 n s total lead size lead
66. tl t lead2 knit unreservoirN interface contact2 t eysteabihionde eatanatienl a a MySystemWithLeads addlead lead2 system visu2D MySystemWithLeads s uysystem Adding the second lead for i in range 10 COM ains E float i 10 2 1 99 G MATRIX RUN conductance matrix MySystemWithLeads E print E G MATRIX I 0 as This 20 lines script does the following 1 zs Defines the hopping matrix t the on site energy matrix V and the energy E at which transport through our mesoscopic system is studied lines 1 3 Defines the building blocks A and B for a system and constructs the system of a required geometry as illustrated in Fig 2 a lines 4 6 3 Creates interface contacts between 2 leads and the systen then leads themselves lines 8 11 4 Creates a total system Fig 2 b by attaching the leads to a system defined in the step 2 lines 13 14 plots the resulting system saving the image in eps and pdf files line 15 5 Calculates the conductance matrix of the constructed system depending on the energy and prints the results for 10 different values of energy E on the screen Fig 3 FIG 2 a System MyA constructed by gluing 2 blocks b Total system with leads Ele Edit View Terminal Tabs Help calculate the conductance as a function of energy E 24439060882 517699480517 393317980007 18915814162 93435916102 96142900593 95987879756 93926989872 66000035396 97249061
67. u level of an inverted gap semiconductor Phys Rev B 80 195320 2009 Also available at http xxx lanl gov PS cache arxiv pdf 0711 0711 3413v2 pdf 3 http en wikipedia org wiki Graphene 4 PyX reference manual Available at http pyx sourceforge net manual index html or http x sourceforge net documentation html 5 S Borlenghi V Rychkov and X Waintal in preparation 6 Crossed Andreev reflection versus electron transfer in three terminal graphene devices Havard Haugen Daniel Huertas Hernando Arne Brataas and Xavier Waintal Phys Rev B 81 174523 2010 7 Focused Crossed Andreev Reflection Havard Haugen Arne Brataas Xavier Waintal and Gerrit E W Bauer arXiv 1007 4653 69
68. ulkerrkesul ihm 1s bal ew Sei 0p l Weererake e calm T sn id Mews Sei CL 0 Web tse Issues Il y Cl ew Sei l l Wee ke ake Kkeial ou Lo j jp udi ec Pure M ie als oles MVS veces D Sule ODIO uo zy ab Cain putDisorder C Solving We calculate the conductance matrix without rotation S obs conductance matrix S mySystem3D E D Introducing magnet rotation We define the function that rotates the bottom magnet def RotatePyl sample angle for i in range mySystem3D fsize y sample coord i 1 y coordinate of the site if y gt 0 and y lt wPy1 Bottom part of Py old Hd sample get Hdiag i new Hd rotate old Hd 0 1 0 angle sample put Hdiag i new Hd 46 Here function rotate is defined in the module spin py see Section 5 it rotates the input matrix old Hd around one of the axes x y z parameter 0 1 0 corresponds to the axis y on the angle defined by parameter angle Function put Hdiag assigns a new value of Vii defined by parameter new Hd to the site i We calculate the conductance matrix for the sample depending of the rotation angle We turn the bottom magnet mm times on the z mm angle to obtain the complete rotation on the angle t We make mm intermediate measurements and plot them mm 1 0 sample mySystem3D MYDATA phi 0 d phi float 1 mm pi delta_phi S obs conductance matrix S sample E MYDATA append phi phi 180 pi s 1 0 for i in range m
69. ven site return int site index Mvoisin int ind int z For the site with index ind returns matrix element between this site and its z th neighbour voisin ind z intind site index ind 0 size 1 where size is a system size total number of sites intz neighbour number z 0 zmax 1 where zmax is a maximum number of neighbours for a given site return scalarM hopping value vvoisin int ind Similar to voisin For the site with index ind returns the list of indices of all neighbours in the form of 1D array args int ind site index ind 0 size 1 where size is a system size total number of sites return Array lt int 1 gt an array of int with the length zmax where zmax is a number of neighbours for a given site vMvoisin int ind For the site with index ind returns matrix elements between this site and all its neighbours voisin ind 0 voisin ind zmax 1 args int ind site index ind O size 1 where size is a system size total number of sites return Array lt scalarM 1 an array of the length zmax with elements of the type scalarM where zmax is a number of neighbours for a given site z voisin int ind int z For the initial site with index ind and its z th neighbour i e the site with indexz ind backtracks the initial site ind from z ind and returns the neighbour number of ind in the list of neighbours of thez ind indzvoisin voisin ind z z voisin ind z int ind site in
70. way of using it is through its PYTHON wrapping PYTHON a simple and very powerful programming language allows for a very flexible use of developed libraries for physical calculations and offers a set of intuitive and simple functions for working with graphics Python Interface VA SWIG as FIG 9 User s commands written in Python specify calls for both native Python functions and C functions of the KNIT core The latter is done by using SWIG SWIG is a powerful tool for bridging the gap between Python and C languages Compiling the C modules with SWIG Python interfaces for all C functions are automatically generated allowing a modeler to use these functions seamlessly within Python specifications 6 1 Class diagram 68 knit general h eee xi e general Error Be SRS SSS Sa Sie q 73 some constants I H 1 F 1 I 1 i 1 I 1 1 I 1 I 1 I 1 I 9 References 1 K Kazymyrenko and X Waintal Knitting algorithm for calculating Green functions in quantum systems Phys Rev B 77 115119 2008 Main KNIT paper Also available at http xxx lanl gov PS cache arxiv pdf 0711 0711 3413v2 pdf 2 A R Akhmerov C W Groth J Tworzydlo C W J Beenakker Switching of electrical current by spin precession in the first Landa
71. y return Float matrix of the size fNres x fNres fNres is a number of leads in the system knitonly systemetotal system Executes a knitting algorithm and calculates transport COMPLEX Energy int savinglevel 1 X between leads but not local observables savinglevel level of saving 1 exact version saves full GF at each step guarantees precision but memory consuming default value O no saving useful only for transmission calculations or very knit only n Saves full GF after each steps n should be order of M where M is a maximum sewing interface size return tricot A pointer to the data structure with solved system knitANDsew systemetotal system Executes a knitting and sewing algorithm calculates COMPLEX Energy int savinglevel 1 local observables of the system args savinglevel return tricot A pointer to the data structure with solved system conductance matrix S systemetotal S system For a given system calculates the COMPLEX Energy conductance matrix for the 2x2 2 dim micromatrices i e systems with spin args Systemetotal Ssystem an infinite system with leads and with spin COMPLEX Energy energy return float matrix of the size fNres x fNres fNres is a number of leads in the system knitonly S systemetotal S system Implements knitonly see above for systems COMPLEX Energy int savinglevel 1 with spin savinglevel level of saving 1 exact version saves full GF at each step guaran
72. y with visual C If you are used to comile programs in Windows you can probably do a much better job than this 1 Preset the environment e Installing Blitz Straightforward download then type configure CXX g make install I had one problem the configure script did not work because of DOS ending instead of UNIX ending whatever that means This can be cured with d2u dou coniu e OU Ul SCONE TOUS e SWIG BLAS LAPACK already available in cygwin e Install PYX download and type Ove IMO Sepe o I cM 2 Changes in KNIT package e Extract the svn knit package in some directory e In svn_knit Trunk modify knit Makefile by customizing it for your particular machine and OS distribution 19 Example KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKEKK fe MAC HONE Sih Ghee PARI ADD LIES CORRESPONDING TO YOUR MACHINE HERE KAKKKKKKKKKKKKKKKKKRKKKKKKKKKKKKKKKKKKKKKKKKKKKKEKKKKKKKKKKEKK 7 DURE Oe Myr T EORNM TA POPs INTEL DUAL TC ORE eius ifeq strip HOST DREC HB 002386 CC gtt EXER usce cle py cinom 47 PYTLIB bin BLZHDR usr local include BuAnIB usr7 local lib LFLAGS E HOME export dynamic llapack lpython2 4 LS BLZLIB lblitz POI I found the location of libpython so with fund shane libpythons 3 Compile and build KNIT MES o Ded sue eee alle c mo a TE e Changethenameof knit so to knit dll 4 Testthe installation python benchm

Download Pdf Manuals

image

Related Search

Related Contents

Logitech 920-005618  mOde d`emplOi - Mairie de Saulxures-lès  REF-METER-OCTA 4679462 - Refco Manufacturing Ltd.  Cámaras domo de red AXIS P5512/-E PTZ  DATA-MANSHRT_EUROLIVE_POR_Rev C.p65  Télécharger - Bienvenue sur le site des Thèses d`exercice  Manuel d`installation  Manuel d`Auto-coaching - TDAH  PRO CL−200E - Bank Service  Bedienungsanleitung  

Copyright © All rights reserved.
Failed to retrieve file