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

Generation of random unitary matrix does not draw matrices from Haar measure #519

Closed
pgawron opened this issue May 29, 2018 · 7 comments · Fixed by #760
Closed

Generation of random unitary matrix does not draw matrices from Haar measure #519

pgawron opened this issue May 29, 2018 · 7 comments · Fixed by #760
Labels
type: enhancement It's working, but needs polishing

Comments

@pgawron
Copy link

pgawron commented May 29, 2018

https://github.com/QISKit/qiskit-sdk-py/blob/5c1c68a5aa3dcccdf5c10f9eb307383ebb40826b/qiskit/tools/qi/qi.py#L346

The method of generation random unitary matrices is faulty. It will not generate random matrices drawn from the Haar measure.

Please refer to "How to generate random matrices from the classical compact groups", Francesco Mezzadri, arXiv:math-ph/0609050 p.11.

@nonhermitian
Copy link
Contributor

nonhermitian commented May 29, 2018 via email

@jaygambetta
Copy link
Member

I agree with @pgawron we should update this to be from the Haar measure. After we do this i agree @nonhermitian we should also make the documentation clear and say a random martix from the Haar measure.

@diego-plan9 diego-plan9 added the type: enhancement It's working, but needs polishing label Jun 5, 2018
@delapuente delapuente added this to the 0.6 milestone Jul 31, 2018
@delapuente delapuente added the status: needs information Further information is requested label Jul 31, 2018
@delapuente
Copy link
Contributor

If this is addressable by improving the documentation, let's do it as soon as possible. Is this the case?

@jaygambetta
Copy link
Member

No it needs to write a new algorithm. Its simple but I need to find some time

@delapuente delapuente removed this from the 0.6 milestone Jul 31, 2018
@ikkoham
Copy link
Contributor

ikkoham commented Aug 1, 2018

How about using scipy.stats.unitary_group?

https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.unitary_group.html

@jaygambetta
Copy link
Member

@ikkoham i agree. Can you just submit a Pr and then we can close this issue. I would put a test with it as well.

@delapuente delapuente removed the status: needs information Further information is requested label Aug 2, 2018
@ikkoham
Copy link
Contributor

ikkoham commented Aug 3, 2018

Thanks. OK, I will submit a PR.

ikkoham added a commit to ikkoham/qiskit-terra that referenced this issue Aug 9, 2018
delapuente pushed a commit that referenced this issue Aug 9, 2018
* fix #519 use scipy.stats.unitary_group

* Update CHANGELOG
lia-approves pushed a commit to edasgupta/qiskit-terra that referenced this issue Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement It's working, but needs polishing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants