Hi,

>
> I am trying to attach a 3D lead to a 3D system that I have built, but
> am facing troubles in the same. I am aware of another thread
> (https://mailman-mail5.webfaction.com/pipermail/kwant-discuss/2014-May/000125.html)
> highlighting my question, but having gone through that thread I was
> still unable to successfully attach a lead to my system.
>
> Ideally, I want to attach gold leads to my system but I started by
> attaching a simple cubic lattice (by breaking it into 2 different
> lattices). Following is my code.
>

You define your scattering region over what you call 'lat0' and 'lat1',
which are 2D lattices *embedded in 3D space*.

You then create a new lattice 'lat0_lead' using 'kwant.lattice.square',
which creates a 2D lattice *embedded in 2D space*.

You then add sites from 'lat0_lead'  to the scattering region, so the
scattering region now contains sites that are embedded in 2D realspace
and 3D realspace. Kwant is totally fine with this, but the plotter does
not know how to plot this, so an exception is raised.

You can easily get around this by defining 'lat0_lead' to be a 2D
lattice embedded in 3D:

    # 2 orthogonal lattice vectors in 3D space
    lat0_lead = kwant.lattice.general([(dy, 0, 0), (0, dy, 0)])
    sym_lead0 = kwant.TranslationalSymmetry((dy, 0, 0))


The exception raised is:

> ValueError: Input has irregular shape.

This is a bit cryptic, and I've opened an issue [1] against this
usability bug,



Happy Kwanting,

Joe

P.S. I also note that *you never actually attach the lead that you
created*; is this really what you want?

[1]: https://gitlab.kwant-project.org/kwant/kwant/issues/222

Reply via email to