-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add identity removal pass to presets (#13363)
* Add identity removal pass to presets This commit adds the newly added RemoveIdentityEquivalent transpiler pass to the preset pass managers for optimization levels 2 and 3. The pass is added to the init and optimization stages. For the init stage the pass is run after 3 or more qubit decomposition. While the pass works fine with 3 qubit gates, the thinking behind this placement was it seems less likely for a multi qubit identity equivalent gate to be added while components of it's decomposition are more likely to be equivalent to an identity. For the optimization stage it is added to the optimization loop. One test needed to be updated because the additional pass changes the decomposition outcome in that test. Although the output circuit is different it is equivalent to the other decomposition and the original circuit. A unitary equivalence check is added to the test to verify that. * Fix lint
- Loading branch information
Showing
3 changed files
with
42 additions
and
10 deletions.
There are no files selected for viewing
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
8 changes: 8 additions & 0 deletions
8
releasenotes/notes/add-identity-pass-builtin-2061b29b53b928d3.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
features_transpiler: | ||
- | | ||
The :class:`.RemoveIdentityEquivalent` transpiler pass is now run as part | ||
of the preset pass managers at optimization levels 2 and 3. The pass is | ||
run in the ``init`` stage and the ``optimization`` stage, because the | ||
optimizations it applies are valid in both stages and the pass is | ||
fast to execute. |
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