This repository was archived by the owner on Jul 24, 2024. It is now read-only.
Enable id->delay translation on all backends#468
Merged
Conversation
The use of id as a gate equivalent to the single qubit gate delay on IBM backends has been deprecated for > 1 yr. As new backends are being released that do not support using id in this manner anymore we should be translating the id for IBM backends to the delay during transpilation otherwise users who manually insert id into their circuit on new backends without id as a supported gate will get a error. Additionally, Qiskit 0.23.0 will likely change the definition of IGate to be a typical identity which will be optimized away (or translated to Rz(0) if no optimization is specified) which will break user assumptions if they were manually using Id as a single qubit gate delay. This commit enables default translation during transpile() by creating a separate translation stage plugin which is the default basis translation with the ConvertIdToDelay prepended to it. This plugin is then set as the default with the IBMBackend class using the backend default stage plugin hook points which override the default stage plugin to use during transplation when targeting the backend. This means if a user runs transpile() targeting an IBMBackend object on a cirucit that contains id gate it will be translated to delay as part of that process.
Member
Author
|
The docs failure will be fixed by #469 |
Pull Request Test Coverage Report for Build 3823921282
💛 - Coveralls |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
The use of id as a gate equivalent to the single qubit gate delay on IBM backends has been deprecated for > 1 yr. As new backends are being released that do not support using id in this manner anymore we should be translating the id for IBM backends to the delay during transpilation otherwise users who manually insert id into their circuit on new backends without id as a supported gate will get a error. Additionally, Qiskit 0.23.0 will likely change the definition of IGate to be a typical identity which will be optimized away (or translated to Rz(0) if no optimization is specified) which will break user assumptions if they were manually using Id as a single qubit gate delay.
This commit enables default translation during transpile() by creating a separate translation stage plugin which is the default basis translation with the ConvertIdToDelay prepended to it. This plugin is then set as the default with the IBMBackend class using the backend default stage plugin hook points which override the default stage plugin to use during transplation when targeting the backend. This means if a user runs transpile() targeting an IBMBackend object on a cirucit that contains id gate it will be translated to delay as part of that process.
Details and comments