From 82b99ef33bf397a1d98ee33bb74b207b703479c9 Mon Sep 17 00:00:00 2001 From: Alexandre Papin Date: Mon, 27 Jul 2026 09:06:18 +0200 Subject: [PATCH] Support full-result format in Pasqal Result Pasqal jobs previously uploaded only a subset of the result (raw counter dict). Now that full results will be uploaded, the output may be wrapped as {"counter": {...}, ...}. Unwrap "counter" when present, falling back to the raw dict for backward compatibility. --- azure-quantum/azure/quantum/target/pasqal/result.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/azure-quantum/azure/quantum/target/pasqal/result.py b/azure-quantum/azure/quantum/target/pasqal/result.py index 7ccf922c7..c2324efe8 100644 --- a/azure-quantum/azure/quantum/target/pasqal/result.py +++ b/azure-quantum/azure/quantum/target/pasqal/result.py @@ -10,7 +10,7 @@ ] import json -from typing import Union, Dict, List, TypeVar, cast +from typing import Any, Union, Dict, List, TypeVar, cast from ...job import Job @@ -44,7 +44,10 @@ def __init__(self, job: Job) -> None: f"(status: {job.details.status}." f"error: {job.details.error_data})" ) - self.data = cast(Dict[str, int], json.loads(job.download_data(job.details.output_data_uri))) + raw = cast( + Dict[str, Any], json.loads(job.download_data(job.details.output_data_uri)) + ) + self.data = cast(Dict[str, int], raw["counter"] if "counter" in raw else raw) def __getitem__(self, register_name: str) -> int: - return self.data[register_name] \ No newline at end of file + return self.data[register_name]