diff --git a/qiskit_aer/backends/aer_compiler.py b/qiskit_aer/backends/aer_compiler.py index 51172f0ec7..544b4a6ed6 100644 --- a/qiskit_aer/backends/aer_compiler.py +++ b/qiskit_aer/backends/aer_compiler.py @@ -122,7 +122,8 @@ def _inline_initialize(self, circ, optype): if isinstance(optype, set) and Initialize not in optype: return circ - for inst, _, _ in circ.data: + for datum in circ.data: + inst = datum.operation if isinstance(inst, Initialize) and ( (not isinstance(inst.params[0], complex)) or (len(inst.params) == 1) ): @@ -132,7 +133,8 @@ def _inline_initialize(self, circ, optype): new_circ = circ.copy() new_circ.data = [] - for inst, qargs, cargs in circ.data: + for datum in circ.data: + inst, qargs, cargs = datum.operation, datum.qubits, datum.clbits if isinstance(inst, Initialize) and ( (not isinstance(inst.params[0], complex)) or (len(inst.params) == 1) ): diff --git a/qiskit_aer/backends/aerbackend.py b/qiskit_aer/backends/aerbackend.py index 7a025d50ce..5f15bba9e5 100644 --- a/qiskit_aer/backends/aerbackend.py +++ b/qiskit_aer/backends/aerbackend.py @@ -562,7 +562,8 @@ def _assemble_noise_model(self, circuits, optypes, **run_options): ): updated_circ = False new_data = [] - for inst, qargs, cargs in circ.data: + for datum in circ.data: + inst, qargs, cargs = datum.operation, datum.qubits, datum.clbits if isinstance(inst, QuantumChannelInstruction): updated_circ = True if not updated_noise: diff --git a/test/terra/backends/test_parameterized_qobj.py b/test/terra/backends/test_parameterized_qobj.py index afe487afdc..c7476ac6ae 100644 --- a/test/terra/backends/test_parameterized_qobj.py +++ b/test/terra/backends/test_parameterized_qobj.py @@ -20,6 +20,7 @@ from test.terra import common +import qiskit from qiskit.compiler import assemble, transpile from qiskit.circuit import QuantumCircuit, Parameter from test.terra.reference.ref_save_expval import ( diff --git a/test/terra/backends/test_runtime_parameterization.py b/test/terra/backends/test_runtime_parameterization.py index 3a0ba3da3c..7c811cb9ad 100644 --- a/test/terra/backends/test_runtime_parameterization.py +++ b/test/terra/backends/test_runtime_parameterization.py @@ -22,6 +22,7 @@ from test.terra import common +import qiskit from qiskit.compiler import assemble, transpile from qiskit.circuit import QuantumCircuit, Parameter from test.terra.reference.ref_save_expval import (