Dear Sebastiano,

If you want to see the potential in the lead you can do this easily with
kwant by making some cells of the lead belong to the system and then plot
your system as usual.

To do So, you can write:

sys.attach_lead(lead, add_cells=10)

By this, you add 10 cells to the system. (These cells have the potential
you defined in the lead)



You can check the documentation [1].

I hope this helps.
Adel




[1]
https://kwant-project.org/doc/1/reference/generated/kwant.builder.Builder.html?highlight=attach_lead#kwant.builder.Builder.attach_lead




On Wed, May 24, 2017 at 11:00 AM, Sebastiano Peotta <[email protected]>
wrote:

> Dear Joseph,
>
> Thanks for the fast answer. I totally agree with adding the float to a
> function, the script does not run.
>
> I missed the Warning in the kwant tutorial, that is the answer to what I
> was looking for. It would be nice to have a working example to be included
> in the tutorial of the use of functions to the define the potential and the
> hoppings in the leads. Moreover it would be useful that the plotting method
> "map" would show the value of a function provided by the user also in the
> leads. Maybe you could think to include these features in the new versions
> of kwant and the documentation.
>
> Thanks a lot!
>
> Sebastiano
>
>
>
> On 24/05/2017 01:04, Joseph Weston wrote:
>
>> Hi Sebastiano,
>>
>> I have seen most of the examples of Kwant usage, but somehow I miss the
>>> usage of functions to define the on-site energy of lattice sites in the
>>> leads. I have attached a simple Kwant script which includes the following
>>> lines
>>>
>>> -----------------
>>>
>>> sym = kwant.TranslationalSymmetry((0, -1.))
>>>
>>> lead = kwant.Builder(sym)
>>>
>>> lead[lat.shape(region_lead,(0.,0.))] = 4. + potential # use the same
>>> potential also for the lead !!!
>>>
>>> lead[lat.neighbors()] = -1.
>>>
>>>
>>> ------------------
>>>
>> You cannot add a number to a Python function, which is what you are
>> attempting to do in line 3 above. You would have to put the "4" inside
>> the definition of "potential" in order to do what you want, exactly
>> as is done in the Kwant tutorial [1].
>>
>>
>> Since the leads are automatically attached to the scattering region I
>>> would
>>> expect that the potential is evaluated at the sites where the leads is
>>> attached and then repeated according to the translational symmetry given
>>> to
>>> the lead. Is this the case? I tried to check this using the "map" method
>>> in
>>> kwant.plotter, but the color in correspondence of the leads is an
>>> uninformative grey, which does not belong to the color scale used in the
>>> scattering region. Somehow in the documentation I was not able to find
>>> what
>>> happens when a function is used to define the onsite energy in a lead.
>>> Can
>>> you fill this gap?
>>>
>> There is a warning in the Kwant tutorial about this exact topic [1].
>> Any value function used by leads *must* have the declared symmetry
>> of the lead -- Kwant evaluates the lead Hamiltonian over an arbitrary
>> unit cell, so you will not get what you expect if your value functions
>> do not satisfy this symmetry.
>>
>> Do you think that we could make this warning more prominent in the
>> tutorial?
>>
>>
>> Happy Kwanting,
>>
>> Joe
>>
>>
>> [1]: https://kwant-project.org/doc/1/tutorial/tutorial2#spatially
>> -dependent-values-through-functions
>>
>
>


-- 
Abbout Adel

Reply via email to