def gw_corr_int(self, sn2w, eps=None): """ This computes an integral part of the GW correction at energies sn2e[spin,len(self.nn)] -\frac{1}{2\pi}\int_{-\infty}^{+\infty } \sum_m \frac{I^{nm}(i\omega{'})}{E_n + i\omega{'}-E_m^0} d\omega{'} see eq (16) within DOI: 10.1021/acs.jctc.9b00436 """ if not hasattr(self, 'snmw2sf'): if self.restart_w is True: from pyscf.nao.m_restart import read_rst_h5py self.snmw2sf, msg = read_rst_h5py() print(msg) else: self.snmw2sf = self.get_snmw2sf() sn2int = [np.zeros_like(n2w, dtype=self.dtype) for n2w in sn2w ] eps = self.dw_excl if eps is None else eps # split into mo_energies for s,ww in enumerate(sn2w): # split mo_energies into each spin channel for n,w in enumerate(ww): #print(__name__, 's,n,w int corr', s,n,w) # runs over orbitals for m in range(self.norbs): if abs(w-self.ksn2e[0,s,m])<eps : continue state_corr = ((self.dw_ia*self.snmw2sf[s][n,m,:] / \ (w + 1j*self.ww_ia-self.ksn2e[0,s,m])).sum()/pi).real #print(n, m, -state_corr, w-self.ksn2e[0,s,m]) sn2int[s][n] -= state_corr return sn2int
def gw_corr_int_iter(self, sn2w, eps=None): """ This computes an integral part of the GW correction at GW class while uses get_snmw2sf_iter """ if self.restart_w is True: from pyscf.nao.m_restart import read_rst_h5py self.snmw2sf, msg = read_rst_h5py() print(msg) else: self.snmw2sf = self.get_snmw2sf_iter() return self.gw_corr_int(sn2w, eps=None)