use np.random
@@ -57,8 +57,8 @@ def random_unitary(N): # pylint: disable=invalid-name
Returns:
np.ndarray: a 2-D matrix with np.complex data type.
"""
- x = (aqua_globals.random.random(size=(N, N))*N + 1j *
- aqua_globals.random.random(size=(N, N))*N) / np.sqrt(2)
+ x = (np.random.random(size=(N, N))*N + 1j *
+ np.random.random(size=(N, N))*N) / np.sqrt(2)
q, r = np.linalg.qr(x)
r = np.diag(np.divide(np.diag(r), abs(np.diag(r))))
unitary_matrix = np.dot(q, r)
