Esempio n. 1
0
 def resp(self):
     if self._resp is NotImplemented:
         self._resp = _gen_rhf_response(self.scf_eng,
                                        mo_coeff=self.C,
                                        mo_occ=self.mo_occ,
                                        hermi=1,
                                        max_memory=self.grdit_memory)
     return self._resp
Esempio n. 2
0
 def resp_cphf(self):
     if self.xc_type == "HF":
         return self.resp
     else:
         mf = dft.RKS(self.mol)
         mf.xc = self.scf_eng.xc
         mf.grids = self.cphf_grids
         return _gen_rhf_response(mf,
                                  mo_coeff=self.C,
                                  mo_occ=self.mo_occ,
                                  hermi=1,
                                  max_memory=self.grdit_memory)
Esempio n. 3
0
def rhf_deriv_generator(mf, mo_coeff, mo_occ):
    nao, nmo = mo_coeff.shape
    mocc = mo_coeff[:,mo_occ>0]
    nocc = mocc.shape[1]
    vresp = _gen_rhf_response(mf, mo_coeff, mo_occ, hermi=1)
    def fx(mo1):
        mo1 = mo1.reshape(-1,nmo,nocc)
        nset = len(mo1)
        dm1 = np.empty((nset,nao,nao))
        for i, x in enumerate(mo1):
            dm = np.dot(x*2, mocc.T) # *2 for double occupancy
            dm1[i] = dm + dm.T
        v1 = vresp(dm1)
        return v1
    return fx
Esempio n. 4
0
 def resp(self):
     return _gen_rhf_response(self.scf_eng,
                              mo_coeff=self.C,
                              mo_occ=self.mo_occ,
                              hermi=1,
                              max_memory=self.grdit_memory)