Skip to content

The multi-controlled gate by RZGate().control() is less optimized. #13473

@tamiyaonodera

Description

@tamiyaonodera

Environment

  • Qiskit version: 1.3.0rc2
  • Python version: 3.12.6
  • Operating system: Sonoma 14.5

What is happening?

The multi-controlled gate by RZGate().control() is less optimized.

How can we reproduce the issue?

We create a circuit with a 6-qubit multi-controlled RZGate. We then transpile it to an Eagle device, and count the number of entangling gates.

from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager
backend = service.backend("ibm_sherbrooke")
pm = generate_preset_pass_manager(optimization_level=3, backend=backend, seed_transpiler=12345)

import numpy as np
from qiskit import QuantumCircuit, QuantumRegister
from qiskit.circuit.library import RZGate
n=6;  ang=np.pi/7
qr = QuantumRegister(n)
qc = QuantumCircuit(qr)
qc.append(RZGate(ang).control(n-1), qr)

isa_qc=pm.run(qc)
print(isa_qc.count_ops()['ecr'])

What should happen?

The above code outputs 266 in 1.3.0rc2, while 65 in 1.2.4.

Any suggestions?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions