-
Notifications
You must be signed in to change notification settings - Fork 160
add quantum volume plotter for individual trials #489
add quantum volume plotter for individual trials #489
Conversation
Suggest reviewer: @dcmckayibm |
@ShellyGarion The errors are similar to other PRs that I submitted: |
This was caused by: Qiskit/qiskit#5058 which has been fixed. You just need to push the update branch (which is a requirement prior to merging anyway) and that will trigger a new ci run. I've done that here so that should resolve that issue. |
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.
Can you add a release note for this new plotter function. See: https://github.com/Qiskit/qiskit-ignis/blob/master/CONTRIBUTING.md#release-notes for more details.
@mtreinish Thanks for fixing the Terra error. Release note is added. |
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.
Looks good, just a small misprint
--- | ||
features: | ||
- | | ||
Add :meth:`qiskit.ignis.verification.quantum_volume.QVFitter.plot_qv_trial` for plotting individual trails leveraging on :meth:`qiskit.visualization.plot_histogram` from Qiskit Terra. |
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.
minor misprint: trails --> trials
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.
Fixed, thank you!
Thanks for the approval! @dcmckayibm and @ShellyGarion |
7208419
ax1.legend() | ||
ax1.set_title(f'Quantum Volume {2**depth}, Trial #{trial_index}', fontsize=14) | ||
|
||
plt.close(fig) # close additional figure |
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.
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.
Sorry I missed that. I have made the changes.
@HuangJunye this has some conflicts from the other PRs that need fixing |
I fixed the conflicts. Please let me know if it is still not able to merge. |
ax1.set_title(f'Quantum Volume {2**depth}, Trial #{trial_index}', fontsize=14) | ||
|
||
# Only close mpl figures in jupyter with inline backends | ||
if fig: |
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.
I don't think this if fig
is necessary since we always set it to a Figure object
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.
That's right. I copied this code from plot_histogram and over there fig = None if ax is provided, but this is not the case here. Shall I change it? https://github.com/Qiskit/qiskit-terra/blob/eb73c4a79704ca4ad2da1600f7f1220dadcfb842/qiskit/visualization/counts_visualization.py#L128
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.
@HuangJunye if its not needed here I say change it, then this looks ready to merge!
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.
@chriseclectic I have made the changes and all checks have passed. I think it's ready to merge!
Summary
Add quantum volume plotter for individual trials
Details and comments
Fixes #224 :
plot_qv_trial()
method for plotting individual trails leveraging onplot_histogram()
from Terrafigsize
kwarg to control figure size. It's useful for showing results for larger QV circuits.Examples: