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

[FEATURE] Add support for `pragma`

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

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
compilers

調査の方向性

Start with the Qasm3Module class in src/pyqasm/modules/qasm3.py, where the parsed program state would hold the new read-only pragma mapping, and read the OpenQASM directives page linked in the issue to confirm the pragma syntax. The open decisions are the identifier schema (__device_name__, __device_native_gates__, and so on) and whether unknown pragmas are ignored or stored, so the maintainers need to settle these before code is written. Done means pragma key/value pairs are parsed into a MappingProxyType on the module and can be read back, with tests for known and unknown keys.

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

説明

enhancement qasm3 qasm3-coverage
Feature Description
  • Add support for pragma in openqasm
  • Motivation: Adding pragma compiler directives enables more granular optimization for specific programs. Eg. we can embed the device information in the openqasm program itself enabling target specific transformations / optimizations for an openqasm compiler.
Implementation (Optional)
  • Since the structure of #pragma annotations are left for the compiler to handle, we can use key value pairs such as -
pragma __device_name__ : "simulator_1" 
pragma __device_native_gates__ : { "h", "cx", "s", "t" }
  • We can have a list of predefined pragma identifiers such as __device_name__, __native_gate_set__, __device_qubits__, and so on, with a specified value schema. Following is a good place to start -

    • __device_name__ : string
    • __device_num_qubits__ : string
    • __device_native_gates__ : set of string
    • __device_architecture__ : string
  • Any other pragma values are ignored OR optionally stored as key value pairs without parsing the value further

  • These values can be stored using the MappingProxyType ( as an immutable dict ), inside the Qasm3Module objects and retrieved as required.

主要言語
Python
スター
29
フォーク
33
平均マージ
2日 4時間
マージ済み PR(30日)
15

環境構築

はじめの一歩

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

qBraid/pyqasm のほかの issue

qBraid/pyqasm の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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