[FEATURE] Support openqasm3 1.0.2 and lift the <1.0.2 cap

Abierto
#1,570 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
54/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

Read the listed parse call sites in passes/qasm/compat.py, passes/qasm/decompose.py, programs/typer.py, runtime/aws/device.py, and transpiler/conversions/qasm3/qasm3_to_openqasm3.py, then inspect describe_error and the dependency entry in requirements.txt. Run the failing tests listed in the issue with openqasm3 1.0.2 and 1.0.1; done means both versions pass the full suite and the version cap is removed. The issue depends on #1568.

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

Descripción

compatibility 🤝 qasm 🧵
Feature

Support openqasm3 1.0.2 in qbraid and lift the openqasm3[parser]<1.0.2 cap that #1554 added.

Motivation

#1554 capped openqasm3 until pyqasm handled 1.0.2. pyqasm 1.4.0 now does (qBraid/pyqasm#475), but qbraid also calls openqasm3.parse itself. With openqasm3 1.0.2 and pyqasm 1.4.0, 16 tests fail that pass with 1.0.1. qbraid-runtime-api pins openqasm3==1.0.1 for the same reason (qBraid/qbraid-runtime-api#576).

openqasm3 1.0.2 changed two things:

  • parse() rejects any program outside versions 3.0 to 3.1 unless called with ignore_version=True. 1.0.1 has no such keyword.
  • Every syntax error raises QASM3ParsingError("parse failed"). 1.0.1 raised it with no message.
Failing tests with openqasm3 1.0.2
  • OpenQASM 2 input to openqasm3.parse: test_replace_gate_name_qubit_1 and _2 (passes/qasm/compat.py), test_load_qasm2_program_from_parsed_obj, and the IonQ transform and submit tests (test_ionq_device_transform_run_input, test_ionq_device_run_submit_job, test_ionq_failed_job).
  • Error messages that now read parse failed instead of a location: test_describe_error_recovers_location_of_empty_parse_error, test_describe_error_end_of_program, test_transpile_error_lists_parse_location_per_path, test_explain_unrecognized_qasm, test_qasm3_to_braket_syntax_error_names_location_once, test_qasm3_to_cirq_raises_for_invalid_qasm.
Proposed change
  • Pass ignore_version=True to openqasm3.parse where the installed version accepts it, in passes/qasm/compat.py, passes/qasm/decompose.py, programs/typer.py, runtime/aws/device.py and transpiler/conversions/qasm3/qasm3_to_openqasm3.py. pyqasm 1.4.0 detects support through inspect.signature.
  • In describe_error, look up the offending token before using the exception message, as pyqasm 1.4.0 does, so syntax errors still name a location.
Acceptance criteria
  • The full suite passes with openqasm3 1.0.1 and 1.0.2.
  • The <1.0.2 cap is gone from requirements.txt.
Dependencies

#1568 (pyqasm 1.4.0 floor).

Lenguaje dominante
Python
Estrellas
117
Forks
66
Merge medio
1 d 10 h
PR fusionados (30 d)
22

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

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/qBraid

Todos los issues de qBraid/qBraid

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.