[Bug?] Transition indexing in get_transitions()
Posted: Tue Jun 20, 2023 5:05 pm
Hello everybody,
I'm trying using Yambopy to build up an analysis tool and I'm not sure about the transition indexing in the method get_transitions().
More specifically, at line 163 of electronsdb.py instructions are:
If I got the idea right, vc is the index of the transition at point k and it should run from 0 to nvalence*nconduction-1. If that is the case, the code seems to have a bug here. Take for instance
then transitions 2 and 3 are overwritten and the indexing stops at 5 instead of 7 as it should. I think that the right instruction should be
If I'm wrong, then I haven't understood what the indexing is meant to do and I apologise for the post.
Cheers
I'm trying using Yambopy to build up an analysis tool and I'm not sure about the transition indexing in the method get_transitions().
More specifically, at line 163 of electronsdb.py instructions are:
Code: Select all
for k,v,c in product(range(nkpoints),range(nvalence),range(nconduction)):
vc = v*nvalence+c
transitions[k,vc] = eigenvalues[k,c+nvalence]-eigenvalues[k,v]
Code: Select all
>>> nkpoints=1 ; nvalence=2 ; nconduction=4
>>> for k,v,c in product(range(nkpoints),range(nvalence),range(nconduction)): print(k, v, c, v*nvalence+c )
...
0 0 0 0
0 0 1 1
0 0 2 2
0 0 3 3
0 1 0 2
0 1 1 3
0 1 2 4
0 1 3 5
Code: Select all
vc = v*nconduction+c
If I'm wrong, then I haven't understood what the indexing is meant to do and I apologise for the post.
Cheers