@@ -267,7 +267,7 @@ def __init__(self, n_gauss=None, integrate_way:str="direct", e_grid=None):
267267
268268 def density_integrate_Fiori (self ,e_grid ,kpoint ,Vbias ,block_tridiagonal ,subblocks ,integrate_way ,deviceprop ,
269269 device_atom_norbs ,potential_at_atom ,with_Dirichlet_leads ,free_charge ,E_ref ,
270- eta_lead = 1e-5 , eta_device = 1e-5 ):
270+ eta_lead = 1e-5 , eta_device = 1e-5 , self_energy_save_path = None ):
271271
272272 for eidx , e in enumerate (self .integrate_range ):
273273 if not with_Dirichlet_leads :
@@ -276,14 +276,13 @@ def density_integrate_Fiori(self,e_grid,kpoint,Vbias,block_tridiagonal,subblocks
276276 # to ensure the Neuamnn boundary condition in the leads.
277277 deviceprop .lead_L .self_energy (kpoint = kpoint , energy = e , eta_lead = eta_lead , save = False )
278278 deviceprop .lead_R .self_energy (kpoint = kpoint , energy = e , eta_lead = eta_lead , save = False )
279+ else :
280+ # For the Dirichlet leads, the self-energy of the leads is only calculated once and saved.
281+ # In each iteration, load the pre-computed self-energy from disk.
282+ deviceprop .lead_L .self_energy (kpoint = kpoint , energy = e , eta_lead = eta_lead , save_path = self_energy_save_path )
283+ deviceprop .lead_R .self_energy (kpoint = kpoint , energy = e , eta_lead = eta_lead , save_path = self_energy_save_path )
284+
279285
280- # else:
281- # # For the Dirichlet leads, the self-energy of the leads is only calculated once and saved.
282- # # In each iteration, the self-energy of the leads is not updated.
283- # deviceprop.lead_L.self_energy(kpoint=kpoint, energy=e, eta_lead=eta_lead, save=True)
284- # deviceprop.lead_R.self_energy(kpoint=kpoint, energy=e, eta_lead=eta_lead, save=True)
285-
286-
287286 deviceprop .cal_green_function (energy = e , kpoint = kpoint , block_tridiagonal = block_tridiagonal ,\
288287 eta_device = eta_device ,Vbias = Vbias )
289288
0 commit comments