Transpiler won't remove Gate->Inverse pairs when basis_gates is None
See original GitHub issueReported by @ewoutvandenberg , unless a basis is specified, the transpiler does not remove pairs of gate-inverse gate. e.g.
>>> qc = qk.QuantumCircuit(1)
>>> qc.s(0)
>>> qc.sdg(0)
>>> print(qc)
┌───┐┌─────┐
q_0: |0>┤ S ├┤ Sdg ├
└───┘└─────┘
>>> print(qk.transpile(qc))
┌───┐┌─────┐
q_0: |0>┤ S ├┤ Sdg ├
└───┘└─────┘
>>> print(qk.transpile(qc, basis_gates=['u3']))
q_0: |0>
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Release Notes — Qiskit 0.31.0 documentation
Qiskit Metapackage Version qiskit‑terra qiskit‑aer qiskit‑ignis qiskit‑ibmq‑provider Release...
0.34.1 0.19.1 0.10.2 0.7.0 0.18.3 2022‑01...
0.34.0 0.19.1 0.10.1 0.7.0 0.18.3 2021‑12...
0.33.1 0.19.1 0.9.1 0.7.0 0.18.2 2021‑12......
Read more >Qiskit Pocket Guide
However the X gates may be combined by removing both of them, as they cancel each other. Measuring a quantum circuit. The methods...
Read more >Modular multiplicative inverse - GeeksforGeeks
We can remove the second term on left side as 'My (mod M)' would always be 0 for an integer y. Ax ≅...
Read more >phase gate qiskit Gate. 2020. Let us now introduce a new type ...
Quantum Computing: I want to use the Qiskit transpile function to decompose an arbitrary unitary matrix/ quantum circuit into a special kind of...
Read more >Untitled
There is no need we have this gate now the transpiler working. ... None: None: 3360: Transpiler won't remove Gate->Inverse pairs when basis_gates...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
There is. Without a backend, the transpiler should be able to (and presently does) apply backend-independent, logical optimizations.
This seems related to https://github.com/Qiskit/qiskit-terra/issues/6576 and https://github.com/Qiskit/qiskit-terra/issues/7016.
~I think
InverseCancellation
should just replaceCXCancellation
in level 1.~ because https://github.com/Qiskit/qiskit-terra/issues/7413