Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the random unitary generation from the Haar measure (#760) #760

Merged
merged 3 commits into from
Aug 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Fixed
- Fixed swap mapper using qubits after measurement (#691).
- Fixed error in cpp simulator for 3+ qubit operations (#698).
- Fixed issue with combining or extending circuits that contain CompositeGate (#710).
- Fixed the random unitary generation from the Haar measure (#760).

`0.5.6`_ - 2018-07-06
=====================
Expand Down
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