Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[BUG] Unsupported Controlled QASM operations

Abierto
#252 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@ryanhill1 ya está trabajando en esto.

Desde el 20/10/2026.

  • #459 de @ryanhill1 — abierto

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
18/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python

Línea de trabajo

The error comes from map_qasm_ctrl_op_to_callable, where a TODO notes that controls should be decomposed when not built in. Start by reading that function to see how controlled gates with three or more controls are currently rejected, and check the maintainers' linked issues #32, #121 and #125 for the intended design. Done means the reproducer gate Z_on_two3 with ctrl@ on three qubits validates and produces the expected operations, but the maintainers have not settled on a decomposition approach, so confirm direction in the thread first.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug
Environment
  • PyQASM version: 0.3.2
  • Python version: 3.12.8
  • Operating system: Windows
What happened?

This may be a feature request, but it looks like a partially stubbed implementation based on #32, #121, and #125.

When attempting to define and run a custom gate with multiple controls:

gate Z_on_two3 aa, ab, ac {
    x ac;
    ctrl(2) @ z aa, ab, ac;
    x ac;
}
ctrl@ gate Z_on_two3 qb[0], qb[1], qb[2];

I encounter the following error:

ValidationError: Unsupported controlled QASM operation: z with 3 controls
Source

The error originates from map_qasm_ctrl_op_to_callable, which currently contains the following comment:

# TODO: decompose controls if not built in

Expected Behavior(?)

Support for decomposing multi-controlled operations (e.g., z with 3+ controls), or clarification on whether this is intentionally unsupported.

Suggestions (Optional)

IDK if this is a semantic decomposition or needs full function decomposition to base gate ie through Solavay Kiteav or Cartan. Id assume it can be left to a semantic decomp as openqasm parsing itself accepts gate modifiers directly. LMK future development intent in this category

Lenguaje dominante
Python
Estrellas
29
Forks
33
Merge medio
2 d 4 h
PR fusionados (30 d)
15

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de qBraid/pyqasm

Todos los issues de qBraid/pyqasm

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.