diff --git a/qiskit_ibm_runtime/utils/json.py b/qiskit_ibm_runtime/utils/json.py index f0b85483c..3a5fa9b6e 100644 --- a/qiskit_ibm_runtime/utils/json.py +++ b/qiskit_ibm_runtime/utils/json.py @@ -51,6 +51,7 @@ QuantumCircuit, QuantumRegister, ) +from qiskit.transpiler import CouplingMap from qiskit.circuit.parametertable import ParameterView from qiskit.result import Result from qiskit.version import __version__ as _terra_version_string @@ -236,6 +237,8 @@ class RuntimeEncoder(json.JSONEncoder): """JSON Encoder used by runtime service.""" def default(self, obj: Any) -> Any: # pylint: disable=arguments-differ + if isinstance(obj, CouplingMap): + return list(obj) if isinstance(obj, date): return {"__type__": "datetime", "__value__": obj.isoformat()} if isinstance(obj, complex): diff --git a/release-notes/unreleased/2026.bug.rst b/release-notes/unreleased/2026.bug.rst new file mode 100644 index 000000000..51e758405 --- /dev/null +++ b/release-notes/unreleased/2026.bug.rst @@ -0,0 +1,2 @@ +``CouplingMap`` was added to :class:`~.RuntimeEncoder` so it can now be passed to +the :class:`~.NoiseLearner` program. \ No newline at end of file