Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Qiskit job result missing attributes cause wrong exception when job fails in VQE

オープン
#415 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
azure, python

調査の方向性

azure/quantum/qiskit/job.py の、issue で参照されている result_dict の構築箇所から始め、その出力を Qiskit Result の期待される内容と比較します。失敗した VQE ジョブのシナリオを再現し、その後、成功したジョブに影響を与えることなく、結果として得られるエラー情報が期待される結果属性から利用できることを確認します。

索引モデルが 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.

image

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時間
マージ済み PR(30日)
1

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/azure-quantum-python のほかの issue

microsoft/azure-quantum-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。