diff --git a/examples/example_complete_Cu.py b/examples/example_complete_Cu.py index 3ef3142..5875b27 100755 --- a/examples/example_complete_Cu.py +++ b/examples/example_complete_Cu.py @@ -195,9 +195,9 @@ def submit(group: orm.Group = None, run: bool = False, projections="atomic_proje # SKIP the yambo QP step: # this will skip yambo_qp, but be sure to provide QP_DB and parent_folder to ypp inputs. # In general, you can do this if you have already the yambo results. - #builder.pop('yambo_qp') - #builder.ypp.ypp.QP_DB = orm.load_node(13233) - #builder.ypp.parent_folder = orm.load_node(13069).outputs.remote_folder + builder.pop('yambo_qp') + builder.ypp.ypp.QP_DB = orm.load_node(15785) + builder.ypp.parent_folder = orm.load_node(15693).outputs.remote_folder # SET custom K-MESH: kpoints = orm.KpointsData() # to skip the convergence diff --git a/utils/gw2wannier90.py b/utils/gw2wannier90.py index b46afd6..0d888fb 100755 --- a/utils/gw2wannier90.py +++ b/utils/gw2wannier90.py @@ -774,18 +774,21 @@ def gw2wannier90( corrections_mask = np.zeros_like(corrections_val, dtype=bool) idx_b = corrections[:, 0].astype(int) - 1 + print(idx_b) # We may have negative band index: if len(np.where(idx_b<0)[0])>2: idx_b = idx_b - np.min(idx_b) # end negative handling. + print(idx_b) idx_k = corrections[:, 1].astype(int) - 1 corrections_val[idx_k, idx_b] = corrections[:, 2] corrections_mask[idx_k, idx_b] = True # Strip excluded bands - if len(exbands) > 0: + if len(exbands) > 0 and max(idx_b) > nbndDFT: + # The above second condition is imposed in case we do have some QP DB in which we have idx_b larger than the required dft bands. corrections_val = np.delete(corrections_val, exbands, axis=1) corrections_mask = np.delete(corrections_mask, exbands, axis=1) print("G0W0 QP corrections read from ", seedname + ".gw.unsorted.eig") @@ -796,6 +799,7 @@ def gw2wannier90( # if all((ik, ib) in list(corrections.keys()) for ik in range(NKPT)) # ] providedGW = [ib for ib in range(nbndDFT) if np.all(corrections_mask[:, ib])] + print(providedGW) # print(providedGW) f_raw.write("------------------------------\n") f_raw.write("List of provided GW corrections (bands indexes)\n")