eigs = np.vstack(scipy.linalg.eigvals(x) for x in xs)
x = np.arctan(eigs.imag/eigs.real)
h = np.histogram(x.flatten())[0]
// The angles "x" of the eigenvalues should be uniformly distributed
// We are not checking that the range is correct; maybe we should?
// Overall this seems to be a necessary but weak test of the distribution.
After Change
// Overall this seems to be a necessary but weak test of the distribution.
eigs = np.vstack(scipy.linalg.eigvals(x) for x in xs)
x = np.arctan2(eigs.imag, eigs.real)
res = kstest(x.ravel(),
lambda x: uniform(0, 2*np.pi).cdf(x + np.pi))
// Note that this should be uniform(-pi, pi), but uniform"s
// range can"t seem to include 0 as an interior point