def test2by2(self): a = 2e0 S11 = 1e0 S12 = (1 + a) * exp(-a) S = array([[S11, S12], [S12, S11]]) H11 = -(0.5e0 + exp(-2 * a)) H12 = -exp(-a) / 2e0 * (3 + a) H22 = -(0.5e0 + exp(-2 * a)) H = array([[H11, H12], [H12, H22]]) E, C = part_b(H, S) print E print C print eigh(H, S)
def variational(self): self.eigvals, self.eigvecs = part_b(self.H, self.S)