[FEATURE] Implement a `.merge` method for `QasmModule`
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Python
- Estrellas
- 29
- Forks
- 33
- Merge medio
- 2 d 4 h
- PR fusionados (30 d)
- 15
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de qBraid/pyqasm
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
Los mantenedores suelen responder en 1 día
-
enhancement error-handling program-validation
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Move the QASM 2 printer and its branch pre-processing out of qasm2.pyPosiblemente ocupada @danielgaskins la tomó hace 7 días. Abiertoenhancement qasm2
Dificultad 4/5 3-5 días Aptitud para principiantes 22/100
qBraid/pyqasm#447 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
[BUG] dumps() emits extern calls without a semicolon, producing unparsable QASMPosiblemente ocupada @Jah-yee la tomó hace 16 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
qBraid/pyqasm#438 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Parse failures raise ValidationError with an empty message; the ANTLR diagnostic is lostPosiblemente ocupada @tonycoder-hub la tomó hace 9 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 22/100
qBraid/pyqasm#436 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de qBraid/pyqasm
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
-
[Bug]: Queen's own Ollama model loses num_ctx when a running session switches to itPosiblemente ocupada @anasamin26 la tomó hoy. Abiertobug enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
aden-hive/hive#7508 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
llm translation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
BerriAI/litellm#47884 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
bug 🐛
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
netalertx/NetAlertX#1856 · 1 reacción ·
Los mantenedores suelen responder en 1 día