[FEATURE] Implement a `.merge` method for `QasmModule`
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Feature Description
Implement a.merge() method with automatic unrolling and register consolidation.
- Purpose:
Merge twoQasmModuleobjects 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.
- The user only needs to call
- Output:
- Returns a new, merged module (preferred for immutability).
- All qubit and classical registers are consolidated into
__PYQASM_QUBITS__and__PYQASM_CLASSICAL__.
Implementation (Optional)
- Unroll and Consolidate Both Modules:
- Call
.unroll(device_qubits=...)on both modules before merging. - If
device_qubitsis not specified, use a default large enough to hold all qubits. - This ensures all registers are consolidated and unrolled.
- Call
- Merge Gates and Operation History:
- Append gates from the second module after the first.
- Combine operation history lists.
- 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.
- Return the New Module:
- Return a new
QasmModulewith the merged content.
- Return a new
- Lingua principale
- Python
- Stelle
- 29
- Fork
- 33
- Merge medio
- 2g 4h
- PR unite (30g)
- 15
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di qBraid/pyqasm
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement error-handling program-validation
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Move the QASM 2 printer and its branch pre-processing out of qasm2.pyForse già presa @danielgaskins l’ha presa 7 giorni fa. Apertaenhancement qasm2
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
qBraid/pyqasm#447 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] dumps() emits extern calls without a semicolon, producing unparsable QASMForse già presa @Jah-yee l’ha presa 15 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
qBraid/pyqasm#438 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Parse failures raise ValidationError with an empty message; the ANTLR diagnostic is lostForse già presa @tonycoder-hub l’ha presa 9 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 22/100
qBraid/pyqasm#436 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di qBraid/pyqasm
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ansys/pyansys-common-mcp#213 ·
I maintainer di solito rispondono entro 3 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
freedomofpress/dangerzone#1594 ·
I maintainer di solito rispondono entro 3 giorni
-
priority:P1 status:in-review type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
randomparity/kdive#3317 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area:ci
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
mesonbuild/meson#16281 ·
I maintainer di solito rispondono entro 1 giorno