33#
44# Copyright (C) 2024 The Yambo Team
55#
6- # Authors: HPC, AMS, FP, RR
6+ # Authors: HPC, AMS, FP, RR, MN
77#
88# This file is part of the yambopy project
99#
@@ -134,9 +134,11 @@ def from_db_file(cls,lattice,filename='ndb.BS_diago_Q1',folder='.',Load_WF=True,
134134 r_residual = rer + imr * I
135135
136136 car_qpoint = None
137- if 'Q-point' in list (database .variables .keys ()):
138- # Finite momentum
139- car_qpoint = database .variables ['Q-point' ][:]/ lattice .alat
137+ # Finite momentum
138+ if 'BS_Q' in list (database .variables .keys ()): # Lumen compatibility
139+ car_qpoint = database .variables ['BS_Q' ][...].data / lattice .alat
140+ elif 'Q-point' in list (database .variables .keys ()):
141+ car_qpoint = database .variables ['Q-point' ][...].data / lattice .alat # Yambo compatibility
140142 if Qpt == "1" : car_qpoint = np .zeros (3 )
141143
142144 #eigenvectors
@@ -329,7 +331,7 @@ def real_wf_to_cube(self, iexe, wfdb, fixed_postion=[0,0,0], supercell=[1,1,1],
329331 phase = False
330332 if phase and len (iexe_degen_states ) > 1 :
331333 phase = False
332- print ("Warning: phase plots donot work for degenerate states" )
334+ print ("Warning: phase plots do not work for degenerate states" )
333335
334336 print ('Computing exciton wavefunction (%s density) to real space.' % (name_file ))
335337 sc_latvecs , atom_nums , atom_pos , real_wfc = ex_wf2Real (Akcv , Qpt , wfdb , [np .min (self .table [:, 1 ]),
@@ -351,11 +353,10 @@ def real_wf_to_cube(self, iexe, wfdb, fixed_postion=[0,0,0], supercell=[1,1,1],
351353 real_wfc *= (1.0 / max_normalize_val )
352354 # write to cube file
353355 print ('Writing to .cube file' )
354- write_cube ('exe_wf_%s_% d.cube' % (name_file ,iexe + 1 ),
356+ write_cube ('exe_wf_%s_Qpt%s_state% d.cube' % (name_file , self . Qpt ,iexe + 1 ),
355357 real_wfc , sc_latvecs , atom_pos , atom_nums ,
356358 header = 'Real space exciton wavefunction' )
357359
358-
359360 def get_nondegenerate (self ,eps = 1e-4 ):
360361 """
361362 get a list of non-degenerate excitons
0 commit comments