Dear Anton
I am sorry that I thought Kwant is the next version of Knit. Thanks for your suggestions, and I will keep learning the documentation for Kwant.
Regards,
Qingtian


2014-02-18 4:08 GMT+08:00 Anton Akhmerov <anton.akhmerov@gmail.com>:
Dear Qingtian,

You can use shape with any function, not just a single rectangle, see
for example tutorial 2.3:
http://kwant-project.org/doc/1.0/tutorial/tutorial2#nontrivial-shapes
You can also add sites to the system in several steps by defining
several shape functions, and using something like

sys[lat.shape(shape1, ...)] = value1
sys[lat.shape(shape2, ...)] = value2

Please keep in mind that Kwant is not the next version of Knit, and it
is not guaranteed to have any particular feature of Knit interface.
However you can use things like

sys1 += sys2

in Kwant. This adds all the sites and hoppings from sys2 to sys1. Both
of these things are however explained in the documentation, and I
suggest to read it more attentively.

Best regards
Anton

On Mon, Feb 17, 2014 at 9:11 AM, Qingtian Zhang
<qtzhang@mail.ustc.edu.cn> wrote:
> Dear all,
> I am new to Kwant and python, and I am trying out Kwant by learning the
> examples. I have tried a simple squre scattering region like this:
> def make_system(a=1, t=-2.8, W=9, L=10):
>     lat = kwant.lattice.honeycomb()
>     def squre(pos):
>         x, y = pos
>         return 0<=x<=L and 0<=y<=W
>     sys = kwant.Builder()
> i want to try more complicated shapes, for example 0<=x<=L, 0<=y<=W and
> 2L<=x<=3L,0<=y<=2W. how shoud i change my programme? i note that in the
> previous version Knit we can glue two regions easily,can we do this in Kwant
> similarly£¿
> Thanks! Regards,
> Qingtian Zhang