def z(self): """ Calculate the partion function . """ from scipy.integrate import dblquad from numpy import pi return dblquad(self.prob, 0., 2 * pi, lambda x: 0., lambda x: 2 * pi)