def test_state_average(self):
    mc = mcscf.CASSCF(mfr, 4, 4)
    mc.fcisolver = fci.solver(mol, singlet=False)
    mc.state_average_((0.64, 0.36))
    e = mc.kernel()
    e = mc.e_states
    self.assertAlmostEqual(mc.e_tot, (- 108.83342083775061), 7)
    self.assertAlmostEqual(mc.e_average, (- 108.83342083775061), 7)
    self.assertAlmostEqual(((e[0] * 0.64) + (e[1] * 0.36)), (- 108.83342083775061), 7)
    dm1 = mc.analyze()
    self.assertAlmostEqual(lib.fp(dm1[0]), 0.5239692938150043, 4)
    self.assertRaises(TypeError, mc.state_average_, (0.64, 0.36))
def test_state_average(self):
    mc = mcscf.CASSCF(mfr, 4, 4)
    mc.fcisolver = fci.solver(mol, singlet=False)
    mc.state_average_((0.64, 0.36))
    e = mc.kernel()
    e = mc.e_states
    self.assertAlmostEqual(mc.e_tot, (- 108.83342083775061), 7)
    self.assertAlmostEqual(mc.e_average, (- 108.83342083775061), 7)
    self.assertAlmostEqual(((e[0] * 0.64) + (e[1] * 0.36)), (- 108.83342083775061), 7)
    dm1 = mc.analyze()
    self.assertAlmostEqual(lib.fp(dm1[0]), 0.5239692938150043, 4)
    self.assertRaises(TypeError, mc.state_average_, (0.64, 0.36))