-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transpilation can result in rzz gates with invalid angles #2032
Comments
We should consider the case where the circuit is parametrized, and the rzz gate in the transpiled circuit is parametrized. Do you have an idea how to handle it? |
Below is an example of a from qiskit.circuit import QuantumCircuit, Parameter
from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager
from qiskit_ibm_runtime import QiskitRuntimeService
service = QiskitRuntimeService()
backend = service.backend("ibm_fez", use_fractional_gates=True)
p = Parameter("p")
circ = QuantumCircuit(2)
circ.crz(p, 0, 1)
pm = generate_preset_pass_manager(optimization_level=0, target=backend.target)
isa_circ = pm.run(circ)
print(isa_circ) Output:
|
A couple of ideas:
I think Liran's solution is interesting and may be doable. It sometimes makes the circuit longer. I'll check this direction. |
rzz
angles are restricted to the range[0, pi/2]
, but the transpiler doesn't know it. A possible resolution is to flip the sign by adding a transpiler pass that surrounds rzz gates with negative angles by XI on both sides. This can be applied as a post translation plugin in qiskit-ibm-runtime (because the angle limitation is IBM specific).The text was updated successfully, but these errors were encountered: