Skip to content

Error transpiling circuit containing MCMT gate #13563

@cqc-alec

Description

@cqc-alec

Environment

  • Qiskit version: 1.3.1
  • Qiskit_aer version: 0.15.1
  • Python version: 3.12.3
  • Operating system: Linux

What is happening?

Transpiling a circuit containing an MCMT gate with the aer_simulator_unitary fails. A very long exception trace ends with: AttributeError: 'Instruction' object has no attribute 'num_ctrl_qubits'.

This is a regression from qiskit 1.2.4.

How can we reproduce the issue?

from qiskit import QuantumCircuit, QuantumRegister, transpile
from qiskit.circuit.library import MCMT, RYGate
from qiskit_aer import Aer


qr = QuantumRegister(2, "q")
qcirc = QuantumCircuit(qr)
ry_gate = RYGate(0.1)
cry_gate = MCMT(gate=ry_gate, num_ctrl_qubits=1, num_target_qubits=1)
qcirc.append(cry_gate, [qr[0], qr[1]])

backend = Aer.get_backend("aer_simulator_unitary")

transpile(qcirc, backend)

What should happen?

Transpilation should succeed (as it does with qiskit 1.2.4).

Any suggestions?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmod: circuitRelated to the core of the `QuantumCircuit` class or the circuit library

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions