question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transpiler won't remove Gate->Inverse pairs when basis_gates is None

See original GitHub issue

Reported 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:open
  • Created 4 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
kdkcommented, Oct 31, 2019

There is. Without a backend, the transpiler should be able to (and presently does) apply backend-independent, logical optimizations.

0reactions
1ucian0commented, Dec 14, 2021

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 replace CXCancellation in level 1.~ because https://github.com/Qiskit/qiskit-terra/issues/7413

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found