Page 1 of 1

Value error raise

Posted: Mon Jun 14, 2021 11:20 am
by sitangshu
Dear all,

I am using yambo 5.0.2 database and files and complied yambopy accordingly.
While trying to plot the excitonic weights along the band structure, I found the following error while running plot-excitondb.py:

=======================YamboLatticeDB=======================
lattice:
5.67584789 0.00000000 0.00000000
-2.83792395 4.91542846 0.00000000
0.00000000 0.00000000 37.98349510
atom positions:
7 0.00000000 0.00000000 -0.01142852
51 0.66666667 0.33333334 0.04476185
Ground state energy: 2.894271
Intensity: 0.025703
1st-excited state energy: 2.917207
Intensity: 0.024973
Traceback (most recent call last):
File "plot-excitondb.py", line 44, in <module>
exc_bands = yexc.get_exciton_bs(save,path,states,size=1)
File "/opt/anaconda2/envs/yambopy/lib/python3.7/site-packages/yambopy-0.1-py3.7.egg/yambopy/dbs/excitondb.py", line 425, in get_exciton_bs
bands_kpoints, energies, weights = self.exciton_bs(energies_db, path.kpoints, excitons, debug)
File "/opt/anaconda2/envs/yambopy/lib/python3.7/site-packages/yambopy-0.1-py3.7.egg/yambopy/dbs/excitondb.py", line 287, in exciton_bs
weights = self.get_exciton_weights(excitons)
File "/opt/anaconda2/envs/yambopy/lib/python3.7/site-packages/yambopy-0.1-py3.7.egg/yambopy/dbs/excitondb.py", line 307, in get_exciton_weights
k,c,v = kcv-1
ValueError: too many values to unpack (expected 3)


Can't recognize what could it be due to... I noticed that this new version do not generate file ndb.BS_diago_Q01. While trying to debug, I found that this following portion of the code although do not seems to have problem:

# Exciton database read from db file
if os.path.isfile('bse/yambo/ndb.BS_diago_Q01'):
yexc = YamboExcitonDB.from_db_file(lat,filename='ndb.BS_diago_Q01',folder='bse/yambo')
if os.path.isfile('bse/yambo/ndb.BS_diago_Q1'):
yexc = YamboExcitonDB.from_db_file(lat,filename='ndb.BS_diago_Q1',folder='bse/yambo')

print("Ground state energy: %lf" % yexc.eigenvalues[0].real )
print("Intensity: %lf" % (yexc.get_intensities()[0].real+yexc.get_intensities()[1].real) )
print("1st-excited state energy: %lf" % yexc.eigenvalues[2].real )
print("Intensity: %lf" % (yexc.get_intensities()[2].real+yexc.get_intensities()[3].real) )

# List of states to be merged
states = [17,17]

Regards,
Sitangshu

Re: Value error raise

Posted: Mon Jun 14, 2021 12:01 pm
by palful
Dear Sitangshu,

Is it possible that you have an outdated version of yambopy, which has not been updated to yambo version 5+?
Try to do git pull the yambopy repository: it should download the upgrades. Then just reinstall yambopy.

Let us know it it worked.

Cheers,
Fulvio

Re: Value error raise

Posted: Mon Jun 14, 2021 3:12 pm
by sitangshu
Hi Fulvio,

Many thanks for reply. Problem solved!


Regards

Sitangshu