Skip to content

Commit

Permalink
fix Qiskit#519 use scipy.stats.unitary_group
Browse files Browse the repository at this point in the history
  • Loading branch information
ikkoham committed Aug 9, 2018
1 parent cf06614 commit 9f00614
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qiskit/tools/qi/qi.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import numpy as np
import scipy.linalg as la
from scipy.stats import unitary_group

from qiskit import QISKitError
from qiskit.tools.qi.pauli import pauli_group
Expand Down Expand Up @@ -335,8 +336,7 @@ def random_unitary_matrix(length):
Returns:
ndarray: U (length, length) unitary ndarray.
"""
q_matrix = la.qr(__ginibre_matrix(length))[0] # Get only the first element
return q_matrix
return unitary_group.rvs(length)


def random_density_matrix(length, rank=None, method='Hilbert-Schmidt'):
Expand Down

0 comments on commit 9f00614

Please sign in to comment.