diff --git a/qiskit/providers/ibmq/runtime/utils.py b/qiskit/providers/ibmq/runtime/utils.py index 18e8ff8b4..cd05188e2 100644 --- a/qiskit/providers/ibmq/runtime/utils.py +++ b/qiskit/providers/ibmq/runtime/utils.py @@ -36,7 +36,6 @@ from qiskit.circuit import (Instruction, ParameterExpression, QuantumCircuit, qpy_serialization) -from qiskit.circuit.library import BlueprintCircuit from qiskit.result import Result @@ -184,9 +183,6 @@ def default(self, obj: Any) -> Any: # pylint: disable=arguments-differ if hasattr(obj, 'to_json'): return {'__type__': 'to_json', '__value__': obj.to_json()} if isinstance(obj, QuantumCircuit): - # TODO Remove the decompose when terra 6713 is released. - if isinstance(obj, BlueprintCircuit): - obj = obj.decompose() value = _serialize_and_encode( data=obj, serializer=lambda buff, data: qpy_serialization.dump(data, buff) diff --git a/releasenotes/notes/runtime-decompose-c6f719f99ae6f7c3.yaml b/releasenotes/notes/runtime-decompose-c6f719f99ae6f7c3.yaml new file mode 100644 index 000000000..dc847cf16 --- /dev/null +++ b/releasenotes/notes/runtime-decompose-c6f719f99ae6f7c3.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fix delivered in `#1094 `__ for + the issue wherein :class:`qiskit.providers.ibmq.runtime.RuntimeEncoder` + does an extra `decompose()` if the circuit being serialized is a ``BlueprintCircuit``. diff --git a/test/ibmq/test_ibmq_jobmanager.py b/test/ibmq/test_ibmq_jobmanager.py index bd3ab936d..eb90e1721 100644 --- a/test/ibmq/test_ibmq_jobmanager.py +++ b/test/ibmq/test_ibmq_jobmanager.py @@ -143,7 +143,7 @@ def test_job_qobjs(self): job_set.results() for i, qobj in enumerate(job_set.qobjs()): rjob = self.fake_api_provider.backend.retrieve_job(jobs[i].job_id()) - self.maxDiff = None # pylint: disable=invalid-name + self.maxDiff = None # pylint: disable=attribute-defined-outside-init,invalid-name self.assertDictEqual(qobj.to_dict(), rjob.qobj().to_dict()) def test_error_message(self):