Skip to content
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

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

Open
tamiyaonodera opened this issue Nov 21, 2024 · 0 comments · May be fixed by #13475
Open

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

tamiyaonodera opened this issue Nov 21, 2024 · 0 comments · May be fixed by #13475
Labels
bug Something isn't working

Comments

@tamiyaonodera
Copy link

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

@tamiyaonodera tamiyaonodera added the bug Something isn't working label Nov 21, 2024
@Cryoris Cryoris linked a pull request Nov 21, 2024 that will close this issue
2 tasks
@Cryoris Cryoris linked a pull request Nov 22, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant