QCDLJob surfaces failures by raising JobError from result(). That is consistent with Qiskit's JobV1 API.
However, qiskit-experiments seem to expect a job to terminate in JobStatus.ERROR state, with error_message() that reports the error.
The happy path with qiskit-experiments is verified to work; the failure path is not. We need to:
- Check how current
qiskit-experiments (ExperimentData._add_job_data / failure analysis) treats a job whose result() raises vs. one that reports ERROR + error_message().
- Implement
error_message() -> str | None on QCDLJob, aggregating the failure reasons of the underlying QCDL problems (Future.exception()).
- Decide whether
result() should keep raising (probably yes — standard Qiskit behavior) with error_message() as the non-raising complement.
QCDLJobsurfaces failures by raisingJobErrorfromresult(). That is consistent with Qiskit'sJobV1API.However,
qiskit-experimentsseem to expect a job to terminate inJobStatus.ERRORstate, witherror_message()that reports the error.The happy path with
qiskit-experimentsis verified to work; the failure path is not. We need to:qiskit-experiments(ExperimentData._add_job_data/ failure analysis) treats a job whoseresult()raises vs. one that reportsERROR+error_message().error_message() -> str | NoneonQCDLJob, aggregating the failure reasons of the underlying QCDL problems (Future.exception()).result()should keep raising (probably yes — standard Qiskit behavior) witherror_message()as the non-raising complement.