-
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
Add hinton diagram to plot_state methods #1246
Conversation
The interactive js plot_state visualizations had an additional method 'hinton' for drawing a hinton diagram of the quantum state. However this method was missing from the non-js plot_state function. This commit adds the missing method. THe hinton diagram implementation here is based on the example from the matplotlib documentation, which can be found here: https://matplotlib.org/gallery/specialty_plots/hinton_demo.html
can you post a version of the figure |
@jaygambetta this is what it does now: Basically just a 2d version of the cities plot: I still need to look into adding the x and y ticks and labels. Personally I don't find this super useful, especially compared to the 3d bar plot, but I only pushed the PR because the iplot_state function (for the js version) supports this method and it was missing from the local version. (as part of #1229 ) |
great. I agree and it looks good but i will not use it. |
You need a colorbar as well to make it useful: http://qutip.org/docs/latest/images/visualization-rho-ss.png |
@nonhermitian oh, actually this implementation doesn't do color shading. It's binary colors, black (negative) or white (positive) and only the size is adjusted for the value. I didn't check qutip and just referred to the matplotlib docs which did it that way. |
yeah there is no color bar its the size of the square |
does it have to be one above the other. Can they go next to each other |
@jaygambetta sure, I'll put them side by side. I just did top to bottom because I copied the subplot setup from the 3d bar graph function. |
Great. I think we should change the city as well to be side by side |
also I think we should change the order of the city labels to match this |
@jaygambetta sure, can you open an issue for the improvements to the city plots (just so I don't forget about it) |
* Add hinton diagram to plot_state methods The interactive js plot_state visualizations had an additional method 'hinton' for drawing a hinton diagram of the quantum state. However this method was missing from the non-js plot_state function. This commit adds the missing method. THe hinton diagram implementation here is based on the example from the matplotlib documentation, which can be found here: https://matplotlib.org/gallery/specialty_plots/hinton_demo.html * Add imaginary component subplot * Add tick marks and labels * Put plots next to each other
Summary
The interactive js plot_state visualizations had an additional method
'hinton' for drawing a hinton diagram of the quantum state. However
this method was missing from the non-js plot_state function. This commit
adds the missing method.
Details and comments
The hinton diagram implementation here is based
on the example from the matplotlib documentation, which can be found
here: https://matplotlib.org/gallery/specialty_plots/hinton_demo.html