qit.utils.rand_U

qit.utils.rand_U(n)

Random U(n) matrix.

Parameters

n (int) – matrix size

Returns

random unitary n*n matrix

Return type

array[complex]

The matrix is random with respect to the Haar measure. Uses the algorithm in [29].