Dear developers, When I print site_pos in kwant 1.2.2, I find that the index of the atoms for the system are changing every time. site_pos: [[ 0.5 3.17542648] ### site 0 [ 1. 1.73205081] ### site 1 [ 0. 2.30940108] [ 0. 3.46410162] [-0.5 3.17542648] [ 0.5 2.59807621] [ 0. 1.73205081] [-0.5 4.33012702] [ 1. 4.04145188] [ 0.5 4.33012702] [ 0. 4.04145188] [ 1. 3.46410162] [-0.5 2.59807621] [ 0.5 1.44337567] [ 1. 2.30940108] [-0.5 1.44337567]] I run the code again and get: site_pos: [[ 0.5 3.17542648] ### site 0 [ 0.5 4.33012702] ### site 1 [ 0. 3.46410162] [ 1. 2.30940108] [ 0.5 1.44337567] [ 0. 2.30940108] [-0.5 2.59807621] [ 1. 3.46410162] [-0.5 1.44337567] [ 0.5 2.59807621] [ 0. 4.04145188] [-0.5 4.33012702] [ 1. 1.73205081] [-0.5 3.17542648] [ 0. 1.73205081] [ 1. 4.04145188]] I have tried this in kwant 1.0, it gives the same results every time. It seems that it is inconvenient for us to know or overwrite the hopping between two atoms such as sys.hamiltonian(1,0). Is there an easy way to do this in kwant 1.2.2? Best wishes, Weiyuan Tong
Hi Weiyuan, The difference that you're seeing is due to the details of internal implementation of Python 3 vs Python 2. However if you need to modify the hopping in a finalized system, it is better to use functions, like shown in the kwant tutorial: http://kwant-project.org/doc/1/tutorial/tutorial2#nontrivial-shapes Modifying finalized systems like this isn't really a supported way to work with Kwant. Best, Anton On Mon, Feb 15, 2016 at 12:15 PM, Weiyuan Tong <weiyuantongtrans@gmail.com> wrote:
Dear developers, When I print site_pos in kwant 1.2.2, I find that the index of the atoms for the system are changing every time. site_pos: [[ 0.5 3.17542648] ### site 0 [ 1. 1.73205081] ### site 1 [ 0. 2.30940108] [ 0. 3.46410162] [-0.5 3.17542648] [ 0.5 2.59807621] [ 0. 1.73205081] [-0.5 4.33012702] [ 1. 4.04145188] [ 0.5 4.33012702] [ 0. 4.04145188] [ 1. 3.46410162] [-0.5 2.59807621] [ 0.5 1.44337567] [ 1. 2.30940108] [-0.5 1.44337567]]
I run the code again and get: site_pos: [[ 0.5 3.17542648] ### site 0 [ 0.5 4.33012702] ### site 1 [ 0. 3.46410162] [ 1. 2.30940108] [ 0.5 1.44337567] [ 0. 2.30940108] [-0.5 2.59807621] [ 1. 3.46410162] [-0.5 1.44337567] [ 0.5 2.59807621] [ 0. 4.04145188] [-0.5 4.33012702] [ 1. 1.73205081] [-0.5 3.17542648] [ 0. 1.73205081] [ 1. 4.04145188]]
I have tried this in kwant 1.0, it gives the same results every time. It seems that it is inconvenient for us to know or overwrite the hopping between two atoms such as sys.hamiltonian(1,0). Is there an easy way to do this in kwant 1.2.2? Best wishes, Weiyuan Tong
participants (2)
-
Anton Akhmerov
-
Weiyuan Tong