Dear all users,
Recently I tried to plot band structure using AbinitBandStructureMaker.py but I got this error instead:
File "AbinitBandStructureMaker.py", line 1012, in <module>
dico[k] = '{l%s}' %ctrl.alphabet[L]
KeyError: 27
It is only happen with one dataset of total 4 datasets.
The input file is attached below (problem in dataset 4 only (vector path 3)).
I wish to attach the output file and but unfortunately it is too big (9.5MB).
Thanks.
Band Structure keyerror
Moderator: bguster
Band Structure keyerror
- Attachments
-
input.log
- (2.94 KiB) Downloaded 298 times
Re: Band Structure keyerror
I think I have figured out the solution. AbinitBandStructureMaker.py is recognizing a lot of special k-points. Since this number is greater than 26, (the number of letters in the alphabet), abinit runs into a key error because it has defined ctrl.alphabet to have only 26 options for special k pts. Note: the special k-pts recognized by ABSM.py may not be the points you indicated in your program.
But there is a simple workaround:
ctrl.alphabet={
1:'A', 2:'B', 3:'C', 4:'D', 5:'E', 6:'F', 7:'G', 8:'H', 9:'I',10:'J',11:'K',12:'L',13:'M',
14:'N',15:'O',16:'P',17:'Q',18:'R',19:'S',20:'T',21:'U',22:'V',23:'W',24:'X',25:'Y',26:'Z',27:'27',
28:'28',29:'29',30:'30',31:'31',32:'32',33:'33',34:'34',35:'35',36:'36',37:'37',38:'38',39:'39',40:'40'}
simply change the length of ctrl.alphabet to be really long to make up for any keyerrors. I have added up to 40.
But there is a simple workaround:
ctrl.alphabet={
1:'A', 2:'B', 3:'C', 4:'D', 5:'E', 6:'F', 7:'G', 8:'H', 9:'I',10:'J',11:'K',12:'L',13:'M',
14:'N',15:'O',16:'P',17:'Q',18:'R',19:'S',20:'T',21:'U',22:'V',23:'W',24:'X',25:'Y',26:'Z',27:'27',
28:'28',29:'29',30:'30',31:'31',32:'32',33:'33',34:'34',35:'35',36:'36',37:'37',38:'38',39:'39',40:'40'}
simply change the length of ctrl.alphabet to be really long to make up for any keyerrors. I have added up to 40.