def __init__(self, scfwfn, mints):
     nocc = scfwfn.nalpha() + scfwfn.nbeta()
     dim = mints.basisset().nbf() * 2
     Vnu = psi4.get_active_molecule().nuclear_repulsion_energy()
     indx = Index(dim, 'pqrsPQRS')
     indx.add_index_range(0, nocc, 'ijkl')
     indx.add_index_range(nocc, dim, 'abcd')
     # grab integrals and project out symmetry
     C1 = mints.petite_list().sotoao()  # Sym -> C1 projection matrix
     Fa = psi4.Matrix(dim / 2, dim / 2)
     Fb = psi4.Matrix(dim / 2, dim / 2)
     Fa.remove_symmetry(scfwfn.Fa(), C1)
     Fb.remove_symmetry(scfwfn.Fb(), C1)
     Sa = mints.ao_overlap()
     Ta = mints.ao_kinetic()
     Va = mints.ao_potential()
     Ga = mints.ao_eri()
     # build and diagonalize spin-orbital Fock matrix
     F = block_matrix_ab(Fa, Fb)
     S = block_matrix_aa(Sa)
     s, U = la.eigh(S)
     U = np.matrix(U)
     x = 1. / np.sqrt(s).real
     X = U * np.diag(x) * U.T
     tF = X * F * X
     e, tC = la.eigh(tF)
     C = X * tC
     # compute integrals
     H = block_matrix_aa(Ta) + block_matrix_aa(Va)
     G = block_4darray(Ga).swapaxes(1,
                                    2)  # < mu nu | rh si >, phys. notation
     self.nocc, self.dim, self.Vnu, self.indx = nocc, dim, Vnu, indx
     self.e, self.C, self.S, self.H, self.G, self.F = e, C, S, H, G, F
예제 #2
0
 def __init__(self, dim, nocc):
   indx = Index(dim, 'pqr')
   indx.add_index_range(   0, nocc, 'ijk')
   indx.add_index_range(nocc,  dim, 'abc')
   self.indx, self.no, self.nv = indx, nocc, dim - nocc