|View source on GitHub|
Random qubit unitary distributed over the Haar measure.
cirq.google.optimizers.two_qubit_gates.math_utils.random_qubit_unitary( shape: Sequence[int] = (), randomize_global_phase: bool = False, rng: Optional[np.random.RandomState] = None ) -> np.ndarray
The implementation is vectorized for speed.
||The broadcasted shape of the output. This is used to generate a tensor of random unitaries with dimensions tuple(shape) + (2,2).|
||(Default False) If True, a global phase is also sampled randomly. This corresponds to sampling over U(2) instead of SU(2).|
||Random number generator to be used in sampling. Default is numpy.random.|