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.

Flipping of gate direction in Transpiler for CZ gate

See original GitHub issue

What should we add?

The current version of the transpiler raises the following error when attempting to set the basis gate of a backend as cz

'Flipping of gate direction is only supported for CX, ECR, and RZX at this time, not cz.'

As far as I’m aware and through my own testing flipping of a CZ should be easy to implement as it’s “flip” produces the same unitary operator. There is no direct identity needed.

If this could get added that would be great! I would have done this via a pull request myself but it seems “too easy” of a solution that I must be missing something.

The Qiskit file that would need changing. https://github.com/Qiskit/qiskit-terra/blob/1312624309526812eb62b97e0d47699d46649a25/qiskit/transpiler/passes/utils/gate_direction.py

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
eendebakptcommented, Aug 26, 2022

@JMuff22 I encountered the same issue and took the liberty to create a PR based on your code.

0reactions
epelofske-LANLcommented, Dec 17, 2022

I just got this error with some code I am testing: qiskit.transpiler.exceptions.TranspilerError: 'Flipping of gate direction is only supported for CX, ECR, and RZX at this time, not cz.'. My local version of qiskit terra is qiskit-terra==0.20.2; is the fix not in the most current version of terra?

Read more comments on GitHub >

github_iconTop Results From Across the Web

GateDirection - Qiskit
Modify asymmetric gates to match the hardware coupling direction. ... GateDirection pass. ... Check if the pass is an analysis pass. If the...
Read more >
EdX Inverting CNOT & CZ - YouTube
In this video, we will learn what happens when the control and target terminals of CNOT and CZ are exchanged within a quantum...
Read more >
Operations glossary - IBM Quantum
The NOT gate, also known as the Pauli X gate, flips the state to , and vice versa. The NOT gate is equivalent...
Read more >
Programs and Gates — pyQuil 3.3.2 documentation
The Standard Gate Set¶ · Pauli gates I , X , Y , Z · Hadamard gate: H · Phase gates: PHASE(theta) ,...
Read more >
Constructing quantum circuits with global gates - IOPscience
Let S1 be the set of qubits that have a CZ gate to qubit 1. ... a two-qubit GZZ gate with a single...
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