Ejemplo n.º 1
0
 def assert_even(n, ix=0):
     y = makeup01.ode_qmhosc(self.x, self.y0[0], self.y0[1], n)
     assert_almost_equal(y[ix], self.y0, decimal=6)
Ejemplo n.º 2
0
 def test_integration_range(self):
     y = makeup01.ode_qmhosc(self.x, self.y0[0], self.y0[1], 0)
     assert_equal(
         len(y),
         len(self.x),
         err_msg="different number of x values (0 <= x < 6, dx=0.01)")
Ejemplo n.º 3
0
 def assert_even(n, value, ix=-1):
     y = makeup01.ode_qmhosc(self.x, self.y0[0], self.y0[1], n)
     psi = y[:ix, 0]
     norm = 0.5 * scipy.integrate.simps(psi**2, x=self.x[:ix])
     assert_almost_equal(norm, value, decimal=5)
 def assert_even(n, ix=-1):
     y = makeup01.ode_qmhosc(self.x, self.y0[0], self.y0[1], n)
     assert_almost_equal(y[ix], [0, 0], decimal=2)
 def test_integration_range(self):
     y = makeup01.ode_qmhosc(self.x, self.y0[0], self.y0[1], 0)
     assert_equal(len(y), len(self.x),
                  err_msg="different number of x values (0 <= x < 6, dx=0.01)")
 def assert_even(n, value, ix=-1):
     y = makeup01.ode_qmhosc(self.x, self.y0[0], self.y0[1], n)
     psi = y[:ix, 0]
     norm = 0.5 * scipy.integrate.simps(psi**2, x=self.x[:ix])
     assert_almost_equal(norm, value, decimal=5)