Value error raise

Post here any question you encounter when running the scripts of the yambo-py suite. Post here problem strictly to the python interface as problem coming from the yambo runs should go in the appropriate subforum.

Moderators: palful, amolina, mbonacci

Post Reply
sitangshu
Posts: 175
Joined: Thu Jan 05, 2017 8:08 am

Value error raise

Post by sitangshu » Mon Jun 14, 2021 11:20 am

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
Sitangshu Bhattacharya
Indian Institute of Information Technology-Allahabad
India
Web-page: http://profile.iiita.ac.in/sitangshu/
Institute: http://www.iiita.ac.in/

User avatar
palful
Posts: 56
Joined: Tue Jan 26, 2016 11:23 am
Location: Modena and Milan

Re: Value error raise

Post by palful » Mon Jun 14, 2021 12:01 pm

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
Dr. Fulvio Paleari
S3-CNR Institute of Nanoscience and MaX Center
Modena, Italy

sitangshu
Posts: 175
Joined: Thu Jan 05, 2017 8:08 am

Re: Value error raise

Post by sitangshu » Mon Jun 14, 2021 3:12 pm

Hi Fulvio,

Many thanks for reply. Problem solved!


Regards

Sitangshu
Sitangshu Bhattacharya
Indian Institute of Information Technology-Allahabad
India
Web-page: http://profile.iiita.ac.in/sitangshu/
Institute: http://www.iiita.ac.in/

Post Reply