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

Ouverte
#1,570 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
54/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
python

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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).

Langage dominant
Python
Étoiles
117
Forks
66
Merge moyen
1 j 10 h
PR mergées (30 j)
22

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de qBraid/qBraid

Toutes les issues de qBraid/qBraid

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.