Qiskit job result missing attributes cause wrong exception when job fails in VQE
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- azure, python
调研方向
从 azure/quantum/qiskit/job.py 中 issue 提及的 result_dict 构造部分开始,并将其输出与 Qiskit Result 的预期进行比较。复现 VQE job 失败的场景,然后验证生成的错误信息可以通过预期的结果属性获取,同时不影响成功的 job。
由索引模型根据 Issue 内容生成。
描述
If running the VQE sample and it fails to run on a quantum_instance (for instance, if Quantinuum is out of credits), then instead of printing the error code and message, it prints that an attribute "status" could not be found.

It looks like this is throwing from when it tries to read result.status from run_circuits.py.
Looking at the latest definition of Result object in qiskit, it looks like for the error_data message to be shown, we should encode the error_data into status field as well.
This is where we encode job result into Qiskit result as part of azure-quantum: https://github.com/microsoft/qdk-python/blob/944fac0ee64e962b65b73f29635a2c65abf332d7/azure-quantum/azure/quantum/qiskit/job.py#L93
Current:
result_dict = {
"results" : [results],
"job_id" : self._azure_job.details.id,
"backend_name" : self._backend.name(),
"backend_version" : self._backend.version,
"qobj_id" : self._azure_job.details.name,
"success" : success,
"error_data" : None if self._azure_job.details.error_data is None else self._azure_job.details.error_data.as_dict()
}
Proposed change:
error_msg = None if self._azure_job.details.error_data is None else self._azure_job.details.error_data.as_dict()
result_dict = {
"results" : [results],
"job_id" : self._azure_job.details.id,
"backend_name" : self._backend.name(),
"backend_version" : self._backend.version,
"qobj_id" : self._azure_job.details.name,
"success" : success,
"error_data" : error_msg,
"status": error_msg,
}
We may optionally want to add the other missing attributes on Qiskit result that are currently not populated, such as date, header, in case they also cause errors down the road.
- 主要语言
- Python
- 星标
- 160
- 派生
- 113
- 平均合并
- 6 天 23 小时
- 30 天内合并 PR
- 1
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/azure-quantum-python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 4/5 3-5 天 新手友好度 38/100
-
Export types 未关闭
难度 2/5 1-3 小时 新手友好度 55/100
-
难度 4/5 3-5 天 新手友好度 38/100
microsoft/azure-quantum-python#650 · 1 条评论 ·
-
azure-quantum
难度 2/5 1-3 小时 新手友好度 20/100
查看 microsoft/azure-quantum-python 的全部 Issue
相似的 Issue
-
area: harness bug status: needs-triage
难度 2/5 1-3 小时 新手友好度 75/100
Human-Agent-Society/reef#625 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 1/5 1 小时以内 新手友好度 80/100
learningequality/kolibri#15351 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
Name consistency 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
eellak/triplestore#65 · 1 条评论 ·