-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Plot State City Visualization Fixes #10590
Conversation
|
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
Looks like the qiskit-terra test failed on Run image test, specifically
|
Since your PR changes the output of the |
Pull Request Test Coverage Report for Build 5799800653
💛 - Coveralls |
I believe this PR should be ready for review, sorry about the multiple merges; I wasn't sure if I should keep my PR up-to-date or not. |
If this PR could be reviewed and closed soon, that would be great. Thanks! |
Thanks a lot for your contribution. Original, the bug in #10862 was introduced by a rounding error that made testing. Do you know if your changes are sensitive to them? I never understood why there is a color difference for 0.0: The RGB values shouldn't be the same? |
Regarding a rounding error that made testing, I removed this line altogether without using any substitute code. I didn't quite understand why this was an issue. It sounded like bars with zero height were considered negative in the visualization, but I'm wondering if this was just a problem with how the dividing zero plane was plotted in which that has been corrected. |
Take a look to the black issue. Dropping the label for the axes ( |
Yes. I figured putting subtitles over each subplot would be easier to read instead. The primarily reason why the y-axis labels were moved was because of spacing issues related to #8413. |
Co-authored-by: Luciano Bello <bel@zurich.ibm.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
* fix zordering and labels outside of plot * lint and reno * Changed reference image for state city * correct visual of negative real value bars * added release notes for negative real bars fix * remove debug print statement in plot_state_city * fix with tox eblack * append rho to title Co-authored-by: Luciano Bello <bel@zurich.ibm.com> --------- Co-authored-by: Luciano Bello <bel@zurich.ibm.com> (cherry picked from commit 4b5546f)
* fix zordering and labels outside of plot * lint and reno * Changed reference image for state city * correct visual of negative real value bars * added release notes for negative real bars fix * remove debug print statement in plot_state_city * fix with tox eblack * append rho to title Co-authored-by: Luciano Bello <bel@zurich.ibm.com> --------- Co-authored-by: Luciano Bello <bel@zurich.ibm.com> (cherry picked from commit 4b5546f) Co-authored-by: AlexanderGroeger <46076580+AlexanderGroeger@users.noreply.github.com>
This is my first PR, please correct me as needed. :)
Summary
The
qiskit.visualization
module has a functionplot_state_city
which yields a matplotlib 3d bar chart representing the density matrix of a quantum state.Fixes #8413
Fixes #3315
Related to #10862
Details and comments
Note for some extreme choices of
figsize
, the plot labels can still be cut off. The primary issue is matplotlib cannot usetight_layout
because there's a lack of space.