def get_hcore(self, cell=None, kpt=None): if cell is None: cell = self.cell if kpt is None: kpt = self.kpt if self.analytic_int: logger.info(self, "Using analytic integrals") return scfint.get_hcore(cell, kpt) else: return get_hcore(cell, kpt)
def get_hcore(mf, cell, kpts): '''Get the core Hamiltonian AO matrices at sampled k-points. Args: kpts : (nkpts, 3) ndarray Returns: hcore : (nkpts, nao, nao) ndarray ''' nao = cell.nao_nr() nkpts = len(kpts) hcore = np.zeros((nkpts,nao,nao), np.complex128) for k in range(nkpts): kpt = kpts[k,:] if mf.analytic_int: hcore[k,:,:] = scfint.get_hcore(cell, kpt) else: hcore[k,:,:] = pbchf.get_hcore(cell, kpt) return hcore