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

[FEATURE] Implement a `.merge` method for `QasmModule`

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

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

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

評価

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

調査の方向性

Start with the existing QasmModule class and its .unroll(device_qubits) method, since the merge depends on how they consolidate registers into __PYQASM_QUBITS__ and __PYQASM_CLASSICAL__. Decide how the default device_qubits should be chosen and how gates and operation history from both modules combine. Done means a new merged module comes back with consolidated registers, with the original modules left unchanged, and tests cover merging two modules that use different register layouts.

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

説明

enhancement llm-assisted transformation
Feature Description

Implement a.merge() method with automatic unrolling and register consolidation.

  • Purpose:
    Merge two QasmModule objects into a single module, handling all register consolidation and unrolling transparently.
  • Consolidation & Unrolling:
    • All register consolidation and unrolling is performed automatically during the merge.
    • Uses the existing .unroll(device_qubits) method to ensure both modules are unrolled and consolidated before merging.
  • User Experience:
    • The user only needs to call .merge() on one module, passing the other as an argument.
    • No manual unrolling or consolidation is required.
  • Output:
    • Returns a new, merged module (preferred for immutability).
    • All qubit and classical registers are consolidated into __PYQASM_QUBITS__ and __PYQASM_CLASSICAL__.
Implementation (Optional)
  1. Unroll and Consolidate Both Modules:
    • Call .unroll(device_qubits=...) on both modules before merging.
    • If device_qubits is not specified, use a default large enough to hold all qubits.
    • This ensures all registers are consolidated and unrolled.
  2. Merge Gates and Operation History:
    • Append gates from the second module after the first.
    • Combine operation history lists.
  3. Consolidate the Merged Module (Optional, but Safe):
    • If the merge could introduce new registers (unlikely if both are already consolidated), perform a final consolidation.
    • This step is mostly redundant but ensures robustness.
  4. Return the New Module:
    • Return a new QasmModule with the merged content.
主要言語
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 を短くまとめたダイジェスト。