Example #1
0
    def __init__(self, mol, mints):

        mult = mol.multiplicity()
        nelec = get_nelec(mol)
        self.conv = get_conv()

        self.Na = int(0.5 * (nelec + mult - 1))
        self.Nb = nelec - self.Na

        V = np.array(mints.ao_potential())
        T = np.array(mints.ao_kinetic())
        G = np.array(mints.ao_eri())

        self.S = np.array(mints.ao_overlap())
        self.Hcore = T + V
        self.G = G.transpose((0, 2, 1, 3))
        self.X = np.matrix(la.funm(self.S, lambda x: x**(-0.5)))
        self.Vnu = mol.nuclear_repulsion_energy()

        ##  alpha and beta density matrices
        self.Da = np.random.rand(*self.X.shape)
        self.Da = self.Da + self.Da.T

        self.Db = np.random.rand(*self.X.shape)
        self.Db = self.Db + self.Db.T

        self.E = 0.0
Example #2
0
    def __init__(self,mol,mints):

        mult = mol.multiplicity()
        nelec = get_nelec(mol)       
        self.conv = get_conv()

        self.Na = int( 0.5*(nelec+mult-1) )
        self.Nb = nelec - self.Na

        V = np.array( mints.ao_potential() )
        T = np.array( mints.ao_kinetic() )
        G = np.array( mints.ao_eri() )

        self.S     = np.array( mints.ao_overlap() )
        self.Hcore = T + V
        self.G     = G.transpose((0,2,1,3))
        self.X     = np.matrix( la.funm(self.S, lambda x : x**(-0.5) ) )
        self.Vnu   = mol.nuclear_repulsion_energy()

        ##  alpha and beta density matrices
        self.Da = np.random.rand(*self.X.shape)
        self.Da = self.Da + self.Da.T

        self.Db = np.random.rand(*self.X.shape)
        self.Db = self.Db + self.Db.T

        self.E = 0.0
Example #3
0
 def __init__(self,mol,mints):
     self.docc = get_docc(mol)
     self.nbf = get_nbf(mints)
     self.conv = get_conv()
     self.maxiter = get_maxiter()
     self.rhf = RHF(mol,mints)
     self.E_scf = self.rhf.get_energy()
     self.e = self.rhf.e
     self.G = self.rhf.G
     self.C = self.rhf.C
Example #4
0
 def __init__(self,mol,mints):
     self.nocc = get_nocc(mol)
     self.nbf = get_nbf(mints)
     self.norb = 2*self.nbf
     self.conv = get_conv()
     self.maxiter = get_maxiter()
     self.uhf = UHF(mol,mints)
     self.E_uhf = self.uhf.get_energy()
     self.e = self.uhf.e
     self.g = self.uhf.g
     self.C = self.uhf.C
Example #5
0
 def __init__(self,mol,mints):
     """
     initialize rhf class
     takes objects:
     1. mol: a psi4 molecule, get_active_molecule()
     2. mints: molecular integrals from libmints in psi4
     """
     self.docc = get_docc(mol)
     self.nbf = get_nbf(mints)
     self.conv = get_conv()
     self.maxiter = get_maxiter()
     self.S = np.matrix(mints.ao_overlap() )
     self.X = np.matrix(la.funm(self.S,lambda x : x**(-0.5)))
     self.T = np.matrix(mints.ao_kinetic() )
     self.V = np.matrix(mints.ao_potential() )
     self.H = self.T+self.V
     self.G = np.array(mints.ao_eri() ).swapaxes(1,2)
     self.D = np.zeros((self.nbf,self.nbf))
     self.Vnu = mol.nuclear_repulsion_energy()
     self.E = 0
Example #6
0
   def __init__(self,mol,mints):
      self.nbf = get_nbf(mints)
      self.norb = 2* self.nbf
      self.nocc = get_nocc(mol)
      self.conv = get_conv()
      self.maxiter = get_maxiter()
      m = self.nbf
      N = self.norb

      # overlap matrix
      S = mints.ao_overlap()
      self.Z = block_oei(S)
      self.X = np.matrix(la.funm(self.Z,lambda x : x**(-0.5)))

      # KE matrix
      T = mints.ao_kinetic()
      self.T = block_oei(T)

      # PE matrix
      V = mints.ao_potential()
      self.V = block_oei(V)

      self.Vnu = mol.nuclear_repulsion_energy()

      # Hcore
      self.H = self.T + self.V

      # ERI matrix
      G = np.array( mints.ao_eri() )    ####  mxmxmxm tensor
      self.G = block_tei(G)
      self.g = self.G.swapaxes(1,2)     ####  ( m n | r s ) ->   < m r | n s > 

      # Density matrix
      self.D = np.matrix(np.zeros(self.Z.shape))

      self.E = 0.0