-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Better handling of Bloch sphere output #1091
Merged
jaygambetta
merged 9 commits into
Qiskit:master
from
nonhermitian:updates_to_bloch_sphere
Oct 12, 2018
Merged
Better handling of Bloch sphere output #1091
jaygambetta
merged 9 commits into
Qiskit:master
from
nonhermitian:updates_to_bloch_sphere
Oct 12, 2018
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@nonhermitian did you mean to include those 2 jupyter notebooks in the PR too, or just the changes to bloch.py? |
Opps |
Good find. |
can we call it _bloch |
jaygambetta
approved these changes
Oct 12, 2018
lia-approves
pushed a commit
to edasgupta/qiskit-terra
that referenced
this pull request
Jul 30, 2019
* Fix parallezation in transpile.compile * Revert "Fix parallezation in transpile.compile" This reverts commit 98e78d0. * better handling of bloch sphere output * remove * remove * move to _bloch * fix call to make_sphere
clarebirch
added a commit
to clarebirch/qiskit-terra
that referenced
this pull request
Aug 15, 2020
Updated operator.py to include to_gate, with error (not warning) if the 'gate' is non-unitary
hodgestar
added a commit
to hodgestar/qutip
that referenced
this pull request
Jul 22, 2021
Bloch sphere. Previously .render(...) took fig and axes arguments and overwrote self.fig and self.axes if the arguments were None. The actual values of the arguments were completely discarded (!!). In addition, not supplying a value for fig and axes would overwrite the values passed to the constructor as Bloch(..., fig=fig, axes=axes). The new behaviour is as follows: * If an external figure is passed to the constructor it is retained. * If no figure is supplied, .render() will create a figure if one has not been created yet, or if the figure has been closed, will recreate it. * .render() will always call self.fig.canvas.update() to ensure that any existing figure that is already shown will be updated. Previously it was possible to cause .render() to raise obscure exceptions by, e.g., calling .render(), closing the figure, calling .render() again. See, for example, qutip#1616. The external figure tracking was backported from Qiskit's copy of Bloch and was inspired by PR Qiskit/qiskit#1091.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This fixes an issue where the Bloch sphere could only be output once if called directly. In addition, it cleans up the internals for dealing with user passed
fig
andaxes
. Note that none of this is actually directly used in qiskit, but some users are trying.Details and comments