Re: [Kwant] STM tip

2019-05-07 Thread Antonio Lucas Rigotti Manesco
Thanks, Joe. It really helped!

Best,
Antonio

Em ter, 7 de mai de 2019 às 04:51, Joseph Weston 
escreveu:

>
> > I want to use KPM to calculate LDOS vs. energy for a given position.
> > Apparently, I can do it using 'where' in kwant.operator.Density, but
> > the input must be a crystal position. I wonder if there is any form to
> > find the closest crystal position for a given position vector that
> > does not necessarily belongs to the crystal.
> Lattices have a method 'closest' that does that.
>
> > Alternatively, can I somehow integrate kwant.operator.Density in a
> > specific region and not over the entire system?
>
> Yes, if you provide a 'where' and 'sum=True' then the density will be
> summed over the sites specified by 'where'. Note that 'where' may be a
> function , so you don't have to specify the sites explicitly.
>
> Happy Kwanting,
>
> Joe
>
>
>
>

-- 
Antônio Lucas Rigotti Manesco
PhD fellow - University of São Paulo, Brazil


Re: [Kwant] STM tip

2019-05-07 Thread Joseph Weston

> I want to use KPM to calculate LDOS vs. energy for a given position.
> Apparently, I can do it using 'where' in kwant.operator.Density, but
> the input must be a crystal position. I wonder if there is any form to
> find the closest crystal position for a given position vector that
> does not necessarily belongs to the crystal.
Lattices have a method 'closest' that does that.

> Alternatively, can I somehow integrate kwant.operator.Density in a
> specific region and not over the entire system?

Yes, if you provide a 'where' and 'sum=True' then the density will be
summed over the sites specified by 'where'. Note that 'where' may be a
function , so you don't have to specify the sites explicitly.

Happy Kwanting,

Joe





signature.asc
Description: OpenPGP digital signature


[Kwant] STM tip

2019-05-06 Thread Antonio Lucas Rigotti Manesco
Dear all,

I want to use KPM to calculate LDOS vs. energy for a given position.
Apparently, I can do it using 'where' in kwant.operator.Density, but the
input must be a crystal position. I wonder if there is any form to find the
closest crystal position for a given position vector that does not
necessarily belongs to the crystal.

Alternatively, can I somehow integrate kwant.operator.Density in a specific
region and not over the entire system?

Thanks in advance.
-- 
Antonio Lucas Rigotti Manesco
PhD fellow - University of São Paulo, Brazil


Re: [Kwant] STM tip as lead

2017-01-08 Thread Abbout Adel
Dear Eric,

Yes, you can use a 3D lattice and define a lead as you proposed, but you
can also  do that more easily and stay in the 2D space. The main idea is to
add a self-energy to the potential of the site below the tip. I suppose
that you want to use 1D lead to mimic the effect of tip so you need just to
be careful about some details:
1) You need a shift in the potential of the supposed 1D lead because the
conduction band for 1D and 2D are not the same. (you chose it in way your
1D lead is also conducting for the Fermi energy of the 2D system )
2) Use the option 'check_hermiticity=False' when you call the scattering
matrix because your Hamiltonian is not Hermitian anymore (it is an
effective complex Hamiltonian due to the self-energy of the tip )
3) The Current in the tip will be the sum of the currents coming from the
left lead and the right lead. Each of them is deduced by M-R-T  where M is
the number of the conducting modes and R,T are the reflection and
transmission respectively (see the script below)
4) You can use the exact form of the self-energy with the correct energy
dependence and a special coupling if you wish.

So, as you see, the self-energy will replace the effect of the lead and
therefore no need to define it.


An small example is provided below.
Finally as a remark, you should notice that if the potential induced by the
tip is real, you will have an  SGM  tip (scanning gate microscopy), where
no current is passing through the tip and only a change in the whole
conductance is induced.

I hope that this helps.
Adel


import kwant
from matplotlib import pyplot
from numpy import *

def make_system(a=1, t=1.0, W=10, L=30):

lat = kwant.lattice.square(a)

sys = kwant.Builder()

#the self energy of a 1D lead with coupling tc
def sigma(energy,V,tc):
return (tc**2)/t
*((energy-V)/(2*t)-1j*sqrt(1-((energy-V)/(2*t)**2)) )

#to the onsite potential add a self energy
def Potential(site, tip_site,energy,V,tc):
if site==tip_site:
return  0.02+4*t+sigma(energy,V,tc)
else: return 0.02+4*t
 Define the scattering region. 
sys[(lat(x, y) for x in range(L) for y in range(W))] = Potential
sys[lat.neighbors()] = -t


 Define and attach the leads. 
# Construct the left lead.
lead = kwant.Builder(kwant.TranslationalSymmetry((-a, 0)))
lead[(lat(0, j) for j in range(W))] = 4 * t
lead[lat.neighbors()] = -t

# Attach the left lead and its reversed copy.
sys.attach_lead(lead)
sys.attach_lead(lead.reversed())

return sys


def plot_conductance(sys,energy,V,tc):
# Compute conductance
data = []
for site in sys.sites:
smatrix = kwant.smatrix(sys,
energy,args=([site,energy,V,tc]),check_hermiticity=False)
number_of_modes=(smatrix.data.shape[0])/2   #conducting modes
T1=number_of_modes-smatrix.transmission(1,
0)-smatrix.transmission(0, 0)
T2=number_of_modes-smatrix.transmission(0,
1)-smatrix.transmission(1, 1)
transmission_to_the_tip= T1+T2
data.append(transmission_to_the_tip)


pyplot.figure()
kwant.plotter.map(sys,data)
pyplot.xlabel("energy [t]")
pyplot.ylabel("conductance [e^2/h]")
pyplot.show()


def main():
sys = make_system()
kwant.plot(sys)
sys = sys.finalized()

plot_conductance(sys,energy=0.1,V=-2,tc=0.1)


if __name__ == '__main__':
main()

On Sun, Jan 8, 2017 at 3:28 AM, Eric Mascot  wrote:

> Hello
>
> I was wondering, is it possible to have a lead that hovers above a 2D
> system?
> I'm guessing that I have to use a 3D system where the system is in the XY
> plane and the lead has a translational symmetry in the Z direction.
>
> Thanks,
> Eric
>



-- 
Abbout Adel


Re: [Kwant] STM tip as lead

2017-01-08 Thread Anton Akhmerov
Hi Eric,

Do you mind providing more information about what you are trying to
achieve? An STM tip is much simpler than an actual lead, so one could
avoid the complexity potentially.

Best,
Anton

On Sun, Jan 8, 2017 at 1:28 AM, Eric Mascot  wrote:
> Hello
>
> I was wondering, is it possible to have a lead that hovers above a 2D
> system?
> I'm guessing that I have to use a 3D system where the system is in the XY
> plane and the lead has a translational symmetry in the Z direction.
>
> Thanks,
> Eric


[Kwant] STM tip as lead

2017-01-07 Thread Eric Mascot
Hello

I was wondering, is it possible to have a lead that hovers above a 2D
system?
I'm guessing that I have to use a 3D system where the system is in the XY
plane and the lead has a translational symmetry in the Z direction.

Thanks,
Eric