Version: 0.8.2
In src/qrisp/interface/converter/pytket_converter.py, the controlled-phase gate cp is mapped to OpType.CRz:
elif op.name == "cp":
if hasattr(op, "ctrl_state"):
tket_ins = OpType.CRz # <-- controlled-Rz, not controlled-phase
CRz != CP. Controlled-phase is diag(1,1,1,e^{iλ}), but the conversion yields diag(1,1,e^{-iλ/2},e^{iλ/2}) — an observable error (not a global phase), inconsistent with qrisp's own get_unitary() for cp:
import qrisp
from qrisp.circuit.library import CPGate
qc = qrisp.QuantumCircuit(2); qc.append(CPGate(0.7), [0, 1])
# diag(qc.get_unitary()) -> [1, 1, 1, e^{0.7i}]
# diag(qc.to_pytket unitary) -> [1, 1, e^{-0.35i}, e^{0.35i}]
Fix: map cp to OpType.CU1 (pytket's controlled-phase).
Discovered during PR review integrating Qrisp as a supported framework in the qBraid-SDK: qBraid/qBraid#1211
Version: 0.8.2
In
src/qrisp/interface/converter/pytket_converter.py, the controlled-phase gatecpis mapped toOpType.CRz:CRz != CP. Controlled-phase isdiag(1,1,1,e^{iλ}), but the conversion yieldsdiag(1,1,e^{-iλ/2},e^{iλ/2})— an observable error (not a global phase), inconsistent with qrisp's ownget_unitary()forcp:Fix: map
cptoOpType.CU1(pytket's controlled-phase).