def test_wavefunction(self): """Does the volume occupied by the H**O integrate to the correct values? """ data_basis, _ = getdatafile(Gaussian, "basicGaussian09", ["dvb_sp.out"]) data_sp, _ = getdatafile(Gaussian, "basicGaussian09", ["dvb_sp.out"]) vol = volume.Volume((-3.0, -6.0, -2.0), (3.0, 6.0, 2.0), (0.25, 0.25, 0.25)) wavefn = volume.wavefunction(data_sp, vol, data_sp.mocoeffs[0][data_sp.homos[0]]) integral = wavefn.integrate() integral_square = wavefn.integrate_square() self.assertAlmostEqual(integral, 0, delta=1e-6) # not necessarily true for all wavefns self.assertAlmostEqual(integral_square, 1.00, delta=1e-2) # true for all wavefns print(integral, integral_square)
def test_wavefunction(self): """Does the volume occupied by the H**O integrate to the correct values? """ data_basis, _ = getdatafile(Gaussian, "basicGaussian03", ["dvb_sp_basis.log"]) data_sp, _ = getdatafile(Gaussian, "basicGaussian03", ["dvb_sp.out"]) vol = volume.Volume((-3.0, -6.0, -2.0), (3.0, 6.0, 2.0), (0.25, 0.25, 0.25)) wavefn = volume.wavefunction(data_sp.atomcoords[0], data_sp.mocoeffs[0][data_sp.homos[0]], data_basis.gbasis, vol) integral = wavefn.integrate() integral_square = wavefn.integrate_square() self.assertTrue(abs(integral) < 1e-6) # not necessarily true for all wavefns self.assertTrue(abs(integral_square - 1.00) < 1e-3) # true for all wavefns print(integral, integral_square)