[FEATURE] Support openqasm3 1.0.2 and lift the <1.0.2 cap

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
54/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python

調査の方向性

Read the listed parse call sites in passes/qasm/compat.py, passes/qasm/decompose.py, programs/typer.py, runtime/aws/device.py, and transpiler/conversions/qasm3/qasm3_to_openqasm3.py, then inspect describe_error and the dependency entry in requirements.txt. Run the failing tests listed in the issue with openqasm3 1.0.2 and 1.0.1; done means both versions pass the full suite and the version cap is removed. The issue depends on #1568.

索引モデルが issue の本文から書いたものです。

説明

compatibility 🤝 qasm 🧵
Feature

Support openqasm3 1.0.2 in qbraid and lift the openqasm3[parser]<1.0.2 cap that #1554 added.

Motivation

#1554 capped openqasm3 until pyqasm handled 1.0.2. pyqasm 1.4.0 now does (qBraid/pyqasm#475), but qbraid also calls openqasm3.parse itself. With openqasm3 1.0.2 and pyqasm 1.4.0, 16 tests fail that pass with 1.0.1. qbraid-runtime-api pins openqasm3==1.0.1 for the same reason (qBraid/qbraid-runtime-api#576).

openqasm3 1.0.2 changed two things:

  • parse() rejects any program outside versions 3.0 to 3.1 unless called with ignore_version=True. 1.0.1 has no such keyword.
  • Every syntax error raises QASM3ParsingError("parse failed"). 1.0.1 raised it with no message.
Failing tests with openqasm3 1.0.2
  • OpenQASM 2 input to openqasm3.parse: test_replace_gate_name_qubit_1 and _2 (passes/qasm/compat.py), test_load_qasm2_program_from_parsed_obj, and the IonQ transform and submit tests (test_ionq_device_transform_run_input, test_ionq_device_run_submit_job, test_ionq_failed_job).
  • Error messages that now read parse failed instead of a location: test_describe_error_recovers_location_of_empty_parse_error, test_describe_error_end_of_program, test_transpile_error_lists_parse_location_per_path, test_explain_unrecognized_qasm, test_qasm3_to_braket_syntax_error_names_location_once, test_qasm3_to_cirq_raises_for_invalid_qasm.
Proposed change
  • Pass ignore_version=True to openqasm3.parse where the installed version accepts it, in passes/qasm/compat.py, passes/qasm/decompose.py, programs/typer.py, runtime/aws/device.py and transpiler/conversions/qasm3/qasm3_to_openqasm3.py. pyqasm 1.4.0 detects support through inspect.signature.
  • In describe_error, look up the offending token before using the exception message, as pyqasm 1.4.0 does, so syntax errors still name a location.
Acceptance criteria
  • The full suite passes with openqasm3 1.0.1 and 1.0.2.
  • The <1.0.2 cap is gone from requirements.txt.
Dependencies

#1568 (pyqasm 1.4.0 floor).

主要言語
Python
スター
117
フォーク
66
平均マージ
1日 10時間
マージ済み PR(30日)
22

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

qBraid/qBraid のほかの issue

qBraid/qBraid の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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