cirq.testing.random_special_unitary

cirq.testing.random_special_unitary(dim: int, *, random_state: Optional[numpy.random.mtrand.RandomState] = None) → numpy.ndarray[source]

Returns a random special unitary distributed with Haar measure.

Parameters
  • dim – The width and height of the matrix.

  • random_state – A seed (int) or np.random.RandomState class to use when generating random values. If not set, defaults to using the module methods in np.random.

Returns

The sampled special unitary.