class MP2: """ Spinorbital version of MP2 (i.e. MP2 using an unrestricted reference) """ def __init__(self, mol, mints): self.uhf = UHF(mol, mints) self.uhf.compute_energy() self.gmo = transform_tei(self.uhf.g, self.uhf.C) def compute_energy(self): uhf = self.uhf e, nocc, norb, gmo = self.uhf.e, self.uhf.nocc, self.uhf.norb, self.gmo Ec = 0.0 for i in range(nocc): for j in range(nocc): for a in range(nocc, norb): for b in range(nocc, norb): Ec += (1/4.0) * gmo[i, j, a, b]**2 / (e[i]+e[j]-e[a]-e[b]) self.E = uhf.E + Ec psi4.print_out('MP2 E Ec\n') psi4.print_out(' {:20.15f} {:20.15f}'.format(self.E, Ec)) return Ec
def __init__(self, mol, mints): uhf = UHF(mol, mints) uhf.compute_energy() self.g = transform_tei( uhf.g, uhf.C ) # antisymmetrized two-electron integrals, spin-orbital (MO) basis self.uhf = uhf
def __init__(self, mol, mints): uhf = UHF(mol, mints) uhf.compute_energy() self.nocc = uhf.nocc self.norb = uhf.norb self.ndet = self.nocc * (self.norb - self.nocc) self.E0 = uhf.E self.e = uhf.e self.g = transform_tei(uhf.g, uhf.C) # antisymmetrized two-electron integrals, spin-orbital (MO) basis
def __init__(self, mol, mints): uhf = UHF(mol, mints) uhf.compute_energy() nbf = uhf.nbf self.nocc = uhf.nocc self.nvirtual = 2 * nbf - self.nocc self.ndet = self.nvirtual * self.nocc self.E0 = uhf.E self.e = uhf.e self.C = uhf.C self.g = uhf.g
def __init__(self, mol, mints): """ Create a class to compute ccd energy """ uhf = UHF(mol, mints) uhf.compute_energy() # import from uhf self.e, self.C, self.G = uhf.e, uhf.C, uhf.g self.maxiter, self.conv = uhf.maxiter, uhf.conv self.nbf, self.nocc = uhf.nbf, uhf.nocc self.nvirt = 2 * self.nbf - self.nocc self.Ec = 0.0 self.t = np.zeros((self.nocc, self.nocc, self.nvirt, self.nvirt))
def __init__(self, mol, mints): uhf = UHF(mol, mints) uhf.compute_energy() self.g = transform_tei(uhf.g, uhf.C) # antisymmetrized two-electron integrals, spin-orbital (MO) basis self.uhf = uhf