Dera Djawad,
I do not see why the angle is different. From my side, I have updated my
system recently and I am having a problem with the 3D plot in kwant
''AttributeError: 'Path3DCollection' object has no
attribute'_z_markers_idx'''.
However, I can suggest the following propositions.
1. Since you are not using a magnetic field in your system, the angle does
not affect your results. In fact the physical quantities would only depend
on the hopping, scattering direction and number of sites. So you can step
forward with this structure.
2. In the def main():you have written *syst.attach_lead(lead)* I don't see
why since you have already attached the lead in your main script.
3. Try to see the following link which provides an example on how to add a
lead in a 3d space (scroll down and you will see).
*ps *
*https://kwant-project.org/doc/dev/tutorial/faq
https://kwant-project.org/doc/dev/tutorial/faq*
Cheers, Adel
Le dim. 20 juin 2021 à 10:45, tavakkolidjawad
On 2021-06-19 01:30, Adel Belayadi wrote:
Dear Javad tavakoli,
I think you need to see the kwant documentation carefully. From the first look at your script I can notice the following statements.
So let us start with the symmetry and the shape of your lead.
First you have used * kwant.TranslationalSymmetry((0,0,1))* which means you are going along the z direction where -2pi/z
Second you have defined the lead shape as a finite shape since you have included 10 <= z < 25
*def lead_shape(pos): x,y,z = pos return 0 <= x < a and 0 <= y < b and 10 <= z < 25*
I guess if you omit *10 <= z < 25* from *def lead_shape(pos)* you would get something meaningful.
Try to fix this problem and let me know if working or not Best wishes Adel
Le ven. 18 juin 2021 à 22:33, tavakkolidjawad
a écrit : Dear all
In the following code I have defined a three-dimensional structure. The geometry of the lead and the scattering region are the same, but the lead is not ploted as I expected. I expected the lead to have a cubic structure. What is the problem with my code?
Thanks
Javad tavakoli
############################################################################
############################################################################
import kwant
lat = kwant.lattice.general([(0, 0.5, 0.5), (0.5, 0, 0.5), (0.5, 0.5, 0)], [(0, 0, 10), (0.25, 0.25, 10.25)], name=['a1', 'a2']) a1, a2 = lat.sublattices
def make_system(a=10, b=10, c=30):
syst = kwant.Builder()
def cuboid_shape(pos): x, y, z = pos return 0 <= x < a and 0 <= y < b and 0 <= z < 10
syst[a1.shape(cuboid_shape, (0, 0, 0))] = 1 syst[a2.shape(cuboid_shape, (0, 0, 0))] = 1 syst[lat.neighbors()] = 1
def lead_shape(pos): x,y,z = pos return 0 <= x < a and 0 <= y < b and 10 <= z < 25
lead = kwant.Builder(kwant.TranslationalSymmetry((0,0,1))) lead[a1.shape(lead_shape, (0, 0, 10))] = 1 lead[a2.shape(lead_shape, (0, 0, 10))] = 1 lead[lat.neighbors()] = 1
syst.attach_lead(lead) syst.attach_lead(lead.reversed())
return syst , lead
def main():
syst,lead= make_system()
kwant.plot(syst)
syst,lead = make_system(a=1.1, b=1.1, c=1.1)
syst.attach_lead(lead)
if __name__ == '__main__': main()
###########################################################################
Dear Adel
I greatly appreciate your consideration.
I fix the problem. Now I have the same shape in the scattering region and lead.
A new problem that arises is that the angles of the structure are different.