
Dear all, I note that all the shapes of the scattering regions in the tutorials can be simply realized by using one sentence like "return x ** 2 + y ** 2 < r ** 2". I want to try a scattering region with a shape: 0<=x<=5, 0<=y<=10; 6<=x<=10,-5<=y<=15.So it is a combined two square regions. I know that it is very convenient to add and delete sites in Kwant, but is there a simple way to define this scattering region? Can anyone help me with this example? Thanks in advance. Kwok-Long Lee

On 20/01/15 09:16, Lee Kwok-Long wrote:
Dear all, I note that all the shapes of the scattering regions in the tutorials can be simply realized by using one sentence like "return x ** 2 + y ** 2 < r ** 2". I want to try a scattering region with a shape: 0<=x<=5, 0<=y<=10; 6<=x<=10,-5<=y<=15.So it is a combined two square regions. I know that it is very convenient to add and delete sites in Kwant, but is there a simple way to define this scattering region? Can anyone help me with this example? Thanks in advance. Kwok-Long Lee Hi,
You could create a function `square` which returns a function which can then be used by `lattice.shape`: def square(W, H, centre): def shape_function(pos): return (centre[0] - W/2 <= pos[0] <= centre[0] + W/2 centre[1] - H/2 <= pos[1] <= centre[0] + H/2) return shape_function ... system[lattice.shape(square(5, 10, (2.5, 5)), (2.5, 5))] = 0 system[lattice.shape(square(4, 10, (8, 5)), (8, 5))] = 0 Hope this helps, Joe
participants (2)
-
Joseph Weston
-
Lee Kwok-Long