Exemple #1
0
 def dens_elec(self, coords, dm): # Compute electronic density for a given density matrix and on a given set of coordinates
   from pyscf.nao.m_dens_libnao import dens_libnao
   from pyscf.nao.m_init_dm_libnao import init_dm_libnao
   from pyscf.nao.m_init_dens_libnao import init_dens_libnao
   if not self.init_sv_libnao : raise RuntimeError('not self.init_sv_libnao')
   if init_dm_libnao(dm) is None : raise RuntimeError('init_dm_libnao(dm) is None')
   if init_dens_libnao()!=0 : raise RuntimeError('init_dens_libnao()!=0')
   return dens_libnao(coords, self.nspin)
 def dens_elec(self, coords, dm):
     """ Compute electronic density for a given density matrix and on a given set of coordinates """
     from pyscf.nao.m_dens_libnao import dens_libnao
     from pyscf.nao.m_init_dm_libnao import init_dm_libnao
     from pyscf.nao.m_init_dens_libnao import init_dens_libnao
     if not self.init_sv_libnao:
         raise RuntimeError('not self.init_sv_libnao')
     if init_dm_libnao(dm) is None:
         raise RuntimeError('init_dm_libnao(dm) is None')
     if init_dens_libnao() != 0: raise RuntimeError('init_dens_libnao()!=0')
     return dens_libnao(coords, self.nspin)
Exemple #3
0
    def __init__(self, rr, pp, sv=None, dm=None):
        """ Basic """
        from pyscf.nao.m_init_dm_libnao import init_dm_libnao
        from pyscf.nao.m_init_dens_libnao import init_dens_libnao

        self.interp_rr = log_interp_c(rr)
        self.interp_pp = log_interp_c(pp)
        self.rr3_dr = rr**3 * np.log(rr[1] / rr[0])
        self.four_pi = 4 * np.pi
        self.const = np.sqrt(np.pi / 2.0)
        self.sv = None if sv is None else sv.init_libnao()
        self.dm = None if dm is None else init_dm_libnao(dm)
        if dm is not None and sv is not None: init_dens_libnao()
Exemple #4
0
 def __init__(self, rr, pp, sv=None, dm=None):
   """ Basic """
   from pyscf.nao.m_init_dm_libnao import init_dm_libnao
   from pyscf.nao.m_init_dens_libnao import init_dens_libnao
   
   self.interp_rr = log_interp_c(rr)
   self.interp_pp = log_interp_c(pp)
   self.rr3_dr = rr**3 * np.log(rr[1]/rr[0])
   self.dr_jt  = np.log(rr[1]/rr[0])
   self.four_pi = 4*np.pi
   self.const = np.sqrt(np.pi/2.0)
   self.pp2 = pp**2
   self.sv = None if sv is None else sv.init_libnao()
   self.dm = None if dm is None else init_dm_libnao(dm)
   if dm is not None and sv is not None : init_dens_libnao()