Description
The crz gate is currently parsed and converted to an RZZ gate, which does not produce the same behaviour.
Proposed Fix
I can write a proper PR for that.
Remove crz from the supported gates entirely.
This requires three changes:
README.md, line 52 — Remove the crz row from the supported gates table:
| OpenQASM gate | Graphix instruction |
|------------------------------------------------------------------|---------------------|
| [ccx](https://openqasm.com/language/standard_library.html#ccx) | CCX |
| [cx](https://openqasm.com/language/standard_library.html#cx) | CNOT |
parser.py, line 323 — Remove the crz branch from the gate parsing logic:
instruction: Instruction
if gate == "ccx":
# https://openqasm.com/language/standard_library.html#ccx
instruction = CCX(target=operands[2], controls=(operands[0], operands[1]))
elif gate == "cx":
# https://openqasm.com/language/standard_library.html#cx
instruction = CNOT(target=operands[1], control=operands[0])
tests/test_parser.py, line 88 and 106 — Remove the crz instruction:
ccx q[0], q[1], q[2];
cx q[0], q[1];
assert isinstance(instruction, CCX)
assert instruction.target == 2
assert instruction.controls == (0, 1)
instruction = next(iterator)
assert isinstance(instruction, CNOT)
Description
The
crzgate is currently parsed and converted to anRZZgate, which does not produce the same behaviour.Proposed Fix
I can write a proper PR for that.
Remove
crzfrom the supported gates entirely.This requires three changes:
README.md, line 52 — Remove thecrzrow from the supported gates table:parser.py, line 323 — Remove thecrzbranch from the gate parsing logic:tests/test_parser.py, line 88 and 106 — Remove thecrzinstruction: