Skip to content

Optimize consecutive RZZ gates into a single RZZ gate #13428

@t-imamichi

Description

@t-imamichi

What should we add?

Since the fractional gates are available, RZZ can be used as a basis gate.
But, optimization of consecutive RZZ gates does not seem to be enough as follows.
It would be nice to merge them into a single RZZ.

from qiskit import generate_preset_pass_manager, QuantumCircuit

qc = QuantumCircuit(2)
qc.rzz(0.1, 0, 1)
qc.rzz(0.2, 0, 1)

pm = generate_preset_pass_manager(optimization_level=3, basis_gates=["rzz"])
qc2 = pm.run(qc)
print(qc2)

output (both 1.2.4 and main branch)

q_0: ─■─────────■────────
      │ZZ(0.1)  │ZZ(0.2)
q_1: ─■─────────■────────

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions