Issue while transpiling CCZ for the IQM20 backend #1669
-
|
I constructed circuit with controlled Z in it and run with. Transpiler fails with an error This is a minimal reproducer for an issue. import matplotlib.pyplot as plt
from qibo import Circuit, gates
from qibo.ui import plot_circuit
from qibo.transpiler import (
NativeGates,
Passes,
Unroller
)
sat_solver = Circuit(5)
sat_solver.add(gates.Z(4).controlled_by(*(2, 3)))
# sat_solver.add(gates.X(4).controlled_by(*(2, 3)))
plot_circuit(sat_solver)
plt.title("Original Circuit")
plt.savefig("ccz_orig.png")
glist = [gates.GPI2, gates.RZ, gates.Z, gates.CZ]
natives = NativeGates(0).from_gatelist(glist)
custom_passes = [Unroller(native_gates=natives)]
custom_pipeline = Passes(custom_passes)
transpiled_circuit, _ = custom_pipeline(sat_solver)
plot_circuit(transpiled_circuit)
plt.title("Transpiled Circuit")
plt.savefig("ccz_simple.png")I used both simple transpiler and transpiler which employs connectivity. I tried to debug it's the case that transformation pass for CCZ is not registered in the dictionary but I don't know why since it's present in the code for custom pipeline what I have: what I search in decompositions Please help me to make it work? I'm quite new in qibo🙏🏻 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
|
@geexie Could you provide a minimal code block that reproduces your issue? Also this may be better as a Issue than a Discussion here on Github. |
Beta Was this translation helpful? Give feedback.



Now I added what was missing to make it work with the transpiler. Your code snippet is working for me locally. Can you confirm it is also working for you when you install
qibofrom that branch?