Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate legacy qasm2 parser for 0.46 #11347

Merged
merged 3 commits into from
Jan 2, 2024

Conversation

mtreinish
Copy link
Member

Summary

The legacy qasm2 parser was remvoed on the main branch already in #11308 for the 1.0.0 release. To ensure that users of the 0.x release series are warned of this API change this commit marks the functionality removed in #11308 as deprecated for the 0.46.0 release.

Details and comments

The legacy qasm2 parser was remvoed on the main branch already
in Qiskit#11308 for the 1.0.0 release. To ensure that users of the 0.x release
series are warned of this API change this commit marks the functionality
removed in Qiskit#11308 as deprecated for the 0.46.0 release.
@mtreinish mtreinish added Changelog: Deprecation Include in "Deprecated" section of changelog mod: qasm2 Relating to OpenQASM 2 import or export labels Nov 30, 2023
@mtreinish mtreinish added this to the 0.46.0 milestone Nov 30, 2023
@mtreinish mtreinish requested a review from a team as a code owner November 30, 2023 12:28
Comment on lines +15 to +18
legacy parser is removed. If you were previously using this, you can
instead parse your OpenQASM 2 files into a :class:`.QuantumCircuit` using
the :meth:`.QuantumCircuit.from_qasm_file` or
:meth:`.QuantumCircuit.from_qasm_str` constructor methods and then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may have forgotten about this in the other PR, but weren't we planning to get rid of these and require use of qasm2.loads as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We kept them in the other PR. At least for me the circuit constructor class methods still have value just in that I don't need to remember all the extra arguments to the parser to get it to behave like the legacy parser did (which is the only mode I ever really use for parsing qasm2).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fair. I think we ought to remove those methods once we've implemented #10737 and made qasm2.dumps match it, at which point qasm2.loads will load the output of qasm2.dumps without any additional modifications. The arguments in favour of removing QuantumCircuit.qasm also imo hold for from_qasm_str, it's just the usability concern that you're correctly pointing out in the way, I think.

qiskit/converters/ast_to_dag.py Outdated Show resolved Hide resolved
@jakelishman jakelishman added this pull request to the merge queue Jan 2, 2024
Merged via the queue into Qiskit:stable/0.46 with commit 273945c Jan 2, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Deprecation Include in "Deprecated" section of changelog mod: qasm2 Relating to OpenQASM 2 import or export
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants