Skip to content

Commit 907e76d

Browse files
committed
feat(noise): better handling ser noise model
1 parent a0b9be9 commit 907e76d

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

qiskit_scaleway/backends/base_job.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def __init__(
5454
self._client = client
5555
self._circuits = circuits
5656
self._config = config
57+
self._last_progress_message = ""
5758

5859
@property
5960
def name(self):
@@ -68,6 +69,9 @@ def status(self) -> JobStatus:
6869
"completed": JobStatus.DONE,
6970
}
7071

72+
if job.progress_message is not None:
73+
self._last_progress_message = job.progress_message
74+
7175
return status_mapping.get(job.status, JobStatus.ERROR)
7276

7377
def submit(self, session_id: str) -> None:
@@ -111,6 +115,7 @@ def submit(self, session_id: str) -> None:
111115
if not model:
112116
raise RuntimeError("Failed to push circuit data")
113117

118+
self._last_progress_message = ""
114119
self._job_id = self._client.create_job(
115120
name=self._name,
116121
session_id=session_id,
@@ -177,6 +182,6 @@ def _wait_for_result(
177182
return self._client.list_job_results(self._job_id)
178183

179184
if status == JobStatus.ERROR:
180-
raise JobError("Job error")
185+
raise JobError(f"Job failed: {self._last_progress_message}")
181186

182187
time.sleep(fetch_interval)

qiskit_scaleway/backends/qsim/job.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ def submit(self, session_id: str) -> None:
6262
# Note 2: Qsim can only handle one circuit at a time
6363
circuit = RemoveBarriers()(self._circuits[0])
6464

65-
programs = [QuantumProgram.from_qiskit_circuit(circuit)]
65+
programs = [
66+
QuantumProgram.from_qiskit_circuit(
67+
circuit, QuantumProgramSerializationFormat.QASM_V2
68+
)
69+
]
6670

6771
options.pop("circuit_memoization_size")
6872
shots = options.pop("shots")

0 commit comments

Comments
 (0)