-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Give IGate a no-op definition
#7403
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
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d6550d6
Give IGate a no-op definition
jakelishman 195cb38
Merge remote-tracking branch 'ibm/main' into fix/igate-definition
jakelishman 95ec70c
Update documentation around IGate
jakelishman f4751cf
Merge remote-tracking branch 'ibm/main' into fix/igate-definition
jakelishman 1d8876a
Merge branch 'main' into fix/igate-definition
jakelishman d6e3854
Update wording surrounding IGate
jakelishman 37570d3
Merge remote-tracking branch 'ibm/main' into fix/igate-definition
jakelishman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
24 changes: 24 additions & 0 deletions
24
releasenotes/notes/fix-igate-definition-7385cff02e663867.yaml
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| fixes: | ||
| - | | ||
| Fixed a bug where certain operations, such as | ||
| :meth:`.QuantumCircuit.control`, would crash if an identity operation | ||
| represented by an :class:`.IGate` was present in a :class:`.QuantumCircuit`. | ||
| For example, the following code was previously an error, but will now function | ||
| correctly:: | ||
|
|
||
| from qiskit import QuantumCircuit | ||
|
|
||
| qc = QuantumCircuit(1) | ||
| qc.i(0) | ||
| controlled = qc.control() | ||
|
jakelishman marked this conversation as resolved.
|
||
| upgrade: | ||
| - | | ||
| Qiskit Terra will now generally treat the identity gate :class:`.IGate` (with corresponding | ||
| circuit method :meth:`.QuantumCircuit.i`) as a quantum no-op, and more aggressively remove it | ||
| during calls to :func:`.transpile`. This is a change to previous behaviour that supported | ||
| legacy IBM Quantum systems where the ``id`` instruction was a short-hand for a delay of the | ||
| same duration as a non-virtual single-qubit gate (usually ``sx``). | ||
|
|
||
| This changes removes a lot of surprises when working with :class:`.IGate` at a high-level; | ||
| various circuit and synthesis operations would previously be unable to handle the gate because | ||
| it appeared as a "magic" opaque instruction. | ||
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.