Skip to content

Commit

Permalink
remove assemble
Browse files Browse the repository at this point in the history
  • Loading branch information
doichanj committed Jul 5, 2024
1 parent 3b5e3ef commit a2f1a0a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 17 deletions.
9 changes: 0 additions & 9 deletions qiskit_aer/library/save_instructions/save_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,6 @@ def __init__(self, name, num_qubits, label, subtype="single", params=None):
self._label = label
self._subtype = subtype

def assemble(self):
"""Return the QasmQobjInstruction for the intructions."""
instr = super().assemble()
# Use same fields as Snapshot instruction
# so we dont need to modify QasmQobjInstruction
instr.snapshot_type = self._subtype
instr.label = self._label
return instr

def inverse(self, annotated=False):
"""Special case. Return self."""
return copy.copy(self)
Expand Down
13 changes: 10 additions & 3 deletions qiskit_aer/noise/errors/quantum_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,16 @@ def to_dict(self):
for circ in self._circs:
circ_inst = []
for inst in circ.data:
qobj_inst = inst.operation.assemble()
qobj_inst.qubits = [circ.find_bit(q).index for q in inst.qubits]
circ_inst.append(qobj_inst.to_dict())
inst_dict = {}
inst_dict["name"] = inst.operation.name
inst_dict["qubits"] = [circ.find_bit(q).index for q in inst.qubits]
if inst.operation.params:
inst_dict["params"] = inst.operation.params
if inst.operation.label:
inst_dict["label"] = inst.operation.label
if inst.operation.condition:
inst_dict["condition"] = inst.operation.condition
circ_inst.append(inst_dict)
instructions.append(circ_inst)
# Construct error dict
error = {
Expand Down
2 changes: 0 additions & 2 deletions test/terra/backends/simulator_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
from qiskit_aer import AerSimulator
from test.terra.common import QiskitAerTestCase
from qiskit.circuit import QuantumCircuit
from qiskit.compiler import assemble


class SimulatorTestCase(QiskitAerTestCase):
"""Simulator test class"""
Expand Down
2 changes: 1 addition & 1 deletion test/terra/backends/test_parameterized_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from test.terra import common

from qiskit.compiler import assemble, transpile
from qiskit.compiler import transpile
from qiskit.circuit import QuantumCircuit, Parameter
from test.terra.reference.ref_save_expval import (
save_expval_circuits,
Expand Down
2 changes: 1 addition & 1 deletion test/terra/backends/test_runtime_parameterization.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

from test.terra import common

from qiskit.compiler import assemble, transpile
from qiskit.compiler import transpile
from qiskit.circuit import QuantumCircuit, Parameter
from test.terra.reference.ref_save_expval import (
save_expval_circuits,
Expand Down
2 changes: 1 addition & 1 deletion tools/verify_wheels.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import numpy as np

from qiskit import ClassicalRegister
from qiskit.compiler import assemble, transpile
from qiskit.compiler import transpile
from qiskit import QuantumCircuit
from qiskit import QuantumRegister
from qiskit.quantum_info import Operator, Statevector
Expand Down

0 comments on commit a2f1a0a

Please sign in to comment.