Dear Jaja,

Your definition of "moving average" is not clear.
In all cases, adding disorder or extracting the hamiltonian is done the
same way for all systems.
H=sys.finalized().hamiltonian_submatrix(params=My_parameters)

You can find in the forum many examples dealing with disorder.

I hope this helps,
Adel

On Tue, Oct 24, 2023 at 10:41 PM Jaja Li <c24096041096...@gmail.com> wrote:

> Dear Kwant developers and users,
>
> I'm trying to add disorder on graphene by method below. I randomly add
> on-site energy on lattice point. Now I want to make disorder smooth by
> using moving average.  What I thought is first print the Hamiltonian matrix
> , then moving average the on-site energy elements , then replace the old
> matrix with the new one for calculating conductance ,  but I have no idea
> how to print the Hamiltonian matrix and re place the matrix or there are
> better ways to simulating smooth disorder.  Could you please help me?
> Thanks a lot for reading my questions!
>
>
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
> def makeSystem(W, L): #L = 99.5
>     # the geomertry of scattering matrix
>     def rectangle(pos):
>         x, y = pos
>         return x > 0 and x < W and y > 0 and y < L
>
>
>     def disorder(site, params):
>         (x, y) = site.pos
>         if(y > L/2):
>             y = L - y
>         e = np.random.normal(0, 5 * params.U0 / 3 * np.exp(-y/L*20) +
> params.U0 / 3 / 2)
>         # params.sum += np.abs(e)
>         return e
>
>
>     def lead0_shape(pos):
>         x, y = pos
>         return (0 < y < L)
>
>
>     # modeling bilayer graphene scattering region
>     syst = kwant.Builder()
>
>     syst[graphene.shape(rectangle, (0, 0))] = disorder
>     syst[[kwant.builder.HoppingKind(*hopping) for hopping in hoppings]] = t
>
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>
> Best,
> JC Lee
>


-- 
Abbout Adel

Reply via email to