Hi Jonas,

is in example that is here
<https://kwant-project.org/doc/1/tutorial/discretize#building-a-kwant-system-from-the-template>
 passed parameter should be a function.

If your potential only depends on the spatial coordinates you can follow as
in linked example.

>From the code you posted I see that you want your potential function to be
gate dependent.
To achieve that you need to modify your Hamiltonian to

hamiltonian = "k_x**2 + k_y**2 + V(x, y, V_gate)"

and define your potential function that takes exactly these arguments.

In your example it should be enough to pass

dict(V=gate, V_gate=5)

to the kwant.smatrix.

Please, let me know if it helps.

Regards,
Rafal






--
Rafał Skolasiński

GitHub: https://github.com/RafalSkolasinski
Kwant GitLab: https://gitlab.kwant-project.org/r-j-skolasinski

On 4 June 2018 at 17:15, <[email protected]> wrote:

> Hi everybody,
>
> I hope my problem is rather simple to solve/explain.
> I would like to create a rectangular system using the function kwant.
> continuum.discretize, apply a local potential, and plot the conductance
> of the system as a function of this potential.
> My Problem is: How to pass the function potential to the system.
>
> So far I used a similar version of the code from tutorial 2.10
>
>
> *def system(L=70, W=40):        hamiltonian = "k_x**2 + k_y**2 + V(x, y)"
>   template = kwant.continuum.discretize(hamiltonian)        def
> shape(site):        (x, y) = site.pos        return (0 <= y < W and 0 <= x
> < L)            def lead_shape(site):        (x, y) = site.pos
> return (0 <= y < W)    syst = kwant.Builder()    syst.fill(template, shape,
> (0, 0));    lead = kwant.Builder(kwant.TranslationalSymmetry([-a, 0]))
> lead.fill(template, lead_shape, (0, 0))    syst.attach_lead(lead)
> syst.attach_lead(lead.reversed())    kwant.plotter.map(syst, lambda s: V(s,
> 0.5));           return syst*
>
> Then, I defined a potential which returns for a given position x,y a
> number (This is taken from a kwant tutorial named: Transport through a
> barrier)
>
>
>
>
>
>
> *def rectangular_gate_pot(distance, left, right, bottom, top):        d,
> l, r, b, t = distance, left, right, bottom, top    def g(u, v):
> return atan2(u * v, d * sqrt(u**2 + v**2 + d**2)) / (2 * pi)    def func(x,
> y, voltage):        return voltage * (g(x-l, y-b) + g(x-l, t-y) +
>                 g(r-x, y-b) + g(r-x, t-y))    return funcgate =
> rectangular_gate_pot(10, 30, 40, -10, 50)*
>
> *def potential(site, V):*
>     x, y = site.pos
>     return gate(x, y, V)
>
> Next, I would like to calculate the conductance. I used again a snipped
> from the tutorial but I do not understand how I can properly address the
> potential
>
> *def plot_transmission(syst, energy, voltages):*
> *    trans = []*
> *    for voltage in voltages:*
> *        smatrix = kwant.smatrix(syst, energy, *dict(V=potential(*what do
> I have to put in here or does it not work this way??*)*)*
> *        trans.append(smatrix.transmission(1, 0))*
> *    pyplot.plot(params, trans)*
>
>
>

Reply via email to