Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`OPENQASM 3.1;` is rejected as an unsupported version

Đang mở
#397 2 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@HeaTTap đang làm issue này rồi.

Từ ngày 21/8/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

enhancement good first issue llm-assisted no-qc-knowledge-reqd qasm3 qasm3-coverage

Limitation

The current OpenQASM specification is version 3.1, and the
version string section defines the
OPENQASM M.m; header where the minor version is optional.

pyqasm hard-codes the accepted set to {"2", "2.0", "3", "3.0"}, so any program declaring
itself as 3.1 is refused before analysis begins.

Example QASM failure

OPENQASM 3.1;
include "stdgates.inc";
qubit[1] q;
h q[0];
ValidationError: Unsupported OpenQASM version: 3.1.
                 Supported versions are: {'2', '2.0', '3', '3.0'}

The identical program with OPENQASM 3.0; validates and unrolls without issue, so nothing
beyond the header check is involved.

Change Requested

  1. Accept 3.1 alongside 3 and 3.0.
  2. Prefer a comparison over an enumerated set: accept any 3.x and reject 4.x and above with
    a message that names the highest supported major version. That way the next minor release
    does not require another patch.
  3. Preserve the declared version through dumps() — a program that comes in as 3.1 must go out
    as 3.1, since the existing "preserve QASM version" behaviour (#36) is relied on downstream.
  4. Update the README and docs, which currently state OpenQASM 3.0 support.

Implementation Details

  • The check is in src/pyqasm/entrypoint.py:158, against the SUPPORTED_QASM_VERSIONS
    constant.
  • The module classes in src/pyqasm/modules/ (qasm2.py, qasm3.py) dispatch on the parsed
    version; confirm that a 3.1 header routes to Qasm3Module and that the version string is
    stored verbatim for serialisation rather than normalised to 3.0.
  • Worth stating explicitly in the issue resolution: accepting the 3.1 header does not by itself
    mean full 3.1 semantic coverage. This change removes a blanket rejection so that 3.1-tagged
    programs can be analysed; the remaining coverage gaps are tracked in the companion issues
    filed alongside this one.
  • Tests: tests/test_entrypoint.py — OPENQASM 3.1; loads, unrolls, and round-trips with the
    version preserved; OPENQASM 4.0; still raises a ValidationError.
Ngôn ngữ chính
Python
Star
29
Fork
33
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
16

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của qBraid/pyqasm

Tất cả issue của qBraid/pyqasm

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.