propagator needs to be imported too. and perhaps use np.random.rand instead scipy.rand, or import scipy.