Download KNIT user guide - Inac
Transcript
for z in range(MyABCwithLeads.fzmax()):
vi= MyABCwithLeads.voisin(i,z)
if vi != -1 and
MyABCwithLeads.sys2res(i)<0 and MyABCwithLeads.sys2res(vi)<0:
Gij= system_solved.getG_lesser(i,z,leadInd)(0,0)
Vji=MyABCwithLeads.get_Hopp(i,z)(0,0).conjugate()
tmp=tmp+((Vji*Gij).real)**2
return sqrt(tmp)
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:
import sys
sys.path.append('../')
from libpy import *
from numpy import *
from libpy.spin import *
39