IonQ multi-circuit squash rejects batches that omit gateset

未關閉 適合新手
#1,564 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
82/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
python
領域
backend

研究方向

閱讀 qbraid/runtime/ionq/device.py 第 138 行附近,這裡第一個 circuit 使用 DEFAULT_GATESET,但迴圈回退到 DEFAULT_FORMAT;將兩者對齊到 DEFAULT_GATESET 就是修正。用 issue 中的兩 dict ionq.circuit.v0 snippet 重現,然後檢查 runtime 測試套件下既有的 IonQ device 測試是否有 batch-squash 覆蓋,並為沒有 gateset 的多 circuit 輸入新增一個案例。完成意味著 batch 被 squash 成單一 qis 多 circuit 輸入,且測試套件通過。

由索引模型根據 Issue 內容生成。

描述

bug 🐛
Problem

IonQDevice._squash_multicircuit_input (qbraid/runtime/ionq/device.py:138 on main) gives a missing gateset a different default for the first circuit than for the rest:

input_gateset = batch_input[0].get("gateset", DEFAULT_GATESET)    # "qis"
...
if run_input.get("gateset", DEFAULT_FORMAT) != input_gateset:      # "ionq.circuit.v0"

So any batch of two or more ionq.circuit.v0 dicts that omit the optional gateset key raises ValueError: All run_inputs must have the same value for key 'gateset'.:

c = {"qubits": 1, "circuit": [{"gate": "h", "target": 0}]}
IonQDevice._squash_multicircuit_input([c, dict(c)])  # ValueError
Expected

A missing gateset defaults to DEFAULT_GATESET for every circuit, so the batch squashes into one qis multi-circuit input. qbraid-runtime-api works around this by setting gateset: "qis" itself (qBraid/qbraid-runtime-api#573).

主要語言
Python
星號
117
分支
66
平均合併
1 天 10 小時
30 天內合併 PR
22

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

qBraid/qBraid 的其他 Issue

查看 qBraid/qBraid 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。