cirq.testing.random_orthogonal

cirq.testing.random_orthogonal(dim: int) → numpy.ndarray[source]

Returns a random orthogonal matrix distributed with Haar measure.

Parameters:dim – The width and height of the matrix.
Returns:The sampled orthogonal matrix.

References

‘How to generate random matrices from the classical compact groups’ http://arxiv.org/abs/math-ph/0609050