Skip to content

Commit 72e3aaa

Browse files
author
Fulvio Paleari
committed
Small changes after merging PR #57
1 parent fe3055f commit 72e3aaa

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

yambopy/bse/exciton_matrix_elements.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
###
2+
# Authors: MN
23
###
34
# This file contains a genenal functions to compute
45
# < S | O | S'>, where O is an operator.
@@ -34,7 +35,7 @@ def exciton_X_matelem(exe_kvec, O_qvec, Akq, Ak, Omn, kpts, contribution='b', di
3435
ie Omn = < k+q, m, s | O(q) | n, k, s>, where m_bnd and n_bnd are final and initial bands, respectively.
3536
s is spin index
3637
kpts : array_like
37-
K-points used to construct the BSE with shape (nk, 3).
38+
K-points used to construct the BSE with shape (nk, 3) in crystal coordinates.
3839
contribution : str, optional
3940
Specifies the contribution to include in the calculation:
4041
- 'e' : Only electronic contribution.

yambopy/bse/realSpace_excitonwf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
##
2+
# Authors: MN
3+
##
14
### Compute real space exction wavefunction when hole/electron is fixed.
25
import numpy as np
36
from yambopy.kpoints import build_ktree, find_kpt

yambopy/dbs/excitondb.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
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

yambopy/letzelphc_interface/lelphcdb.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def change_convention(self, qpt, elph_iq, convention='yambo'):
253253
if convention.strip() != 'yambo': convention = 'standard'
254254
if self.convention == convention: return elph_iq
255255
if convention == 'standard': factor = 1.0
256-
else :factor = -1.0
256+
else: factor = -1.0
257257
idx_q = find_kpt(self.ktree, factor*qpt[None, :] + self.kpoints)
258258
return elph_iq[idx_q, ...]
259259

@@ -267,7 +267,8 @@ def __str__(self):
267267
app('nmodes: %d'%self.nm)
268268
app('natoms: %d'%self.nat)
269269
app('nbands: %d %d'%(self.nb1,self.nb2))
270-
270+
app('convention: %s'%self.convention)
271+
271272
if self.verbose:
272273

273274
if hasattr(self, 'ph_eigenvectors'):

0 commit comments

Comments
 (0)