Skip to content

Commit

Permalink
tr/except
Browse files Browse the repository at this point in the history
  • Loading branch information
SamFerracin committed Aug 12, 2024
1 parent 6afdec7 commit 1fcdfd2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions qiskit_ibm_runtime/utils/noise_learner_result_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def decode( # type: ignore # pylint: disable=arguments-differ

data = []
for layer in decoded["data"]:
if isinstance(layer, LayerError):
data.append(layer)
else:
try:
# supports the legacy result format
error = PauliLindbladError(layer[1]["generators"], layer[1]["rates"])
datum = LayerError(layer[0]["circuit"], layer[0]["qubits"], error)
data.append(datum)
except TypeError:
data.append(layer)

return NoiseLearnerResult(data=data, metadata=decoded["metadata"])

0 comments on commit 1fcdfd2

Please sign in to comment.