Commit a24470f
authored
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 lint1 parent 50217b6 commit a24470f
3 files changed
Lines changed: 42 additions & 10 deletions
File tree
- qiskit/transpiler/preset_passmanagers
- releasenotes/notes
- test/python/compiler
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
159 | 167 | | |
160 | 168 | | |
161 | 169 | | |
| |||
580 | 588 | | |
581 | 589 | | |
582 | 590 | | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
583 | 595 | | |
584 | 596 | | |
585 | 597 | | |
| |||
602 | 614 | | |
603 | 615 | | |
604 | 616 | | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
605 | 621 | | |
606 | 622 | | |
607 | 623 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1796 | 1796 | | |
1797 | 1797 | | |
1798 | 1798 | | |
1799 | | - | |
1800 | | - | |
1801 | | - | |
1802 | | - | |
1803 | | - | |
1804 | | - | |
1805 | | - | |
1806 | | - | |
1807 | | - | |
1808 | | - | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
1809 | 1816 | | |
1810 | 1817 | | |
1811 | 1818 | | |
1812 | 1819 | | |
1813 | 1820 | | |
| 1821 | + | |
1814 | 1822 | | |
1815 | 1823 | | |
1816 | 1824 | | |
| |||
0 commit comments