-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add Rust-based OpenQASM 2 converter #9784
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
fccd043
Add Rust-based OpenQASM 2 converter
jakelishman 5723864
Work around docs failure on Sphinx 5.3, Python 3.9
jakelishman ea9d7b8
Remove unused import
jakelishman d730709
Merge remote-tracking branch 'ibm/main' into qasm2/rust-parser
jakelishman 02b3934
Tweak documentation
jakelishman 203c7bb
More specific PyO3 usage
jakelishman f74c872
Use PathBuf directly for paths
jakelishman 2fffb06
Merge remote-tracking branch 'ibm/main' into qasm2/rust-parser
jakelishman dedb720
Format
jakelishman b9b1276
Freeze dataclass
jakelishman a95e8e4
Use type-safe id types
jakelishman 6048257
Documentation tweaks
jakelishman 9c28c1e
Merge remote-tracking branch 'ibm/main' into qasm2/rust-parser
jakelishman 2eb339a
Fix comments in lexer
jakelishman d5d7115
Fix lexing version number with separating comments
jakelishman 3c0db61
Add test of pathological formatting
jakelishman 46a62ea
Fixup release note
jakelishman fdc6a9d
Fix handling of u0 gate
jakelishman e9ffd41
Merge remote-tracking branch 'ibm/main' into qasm2/rust-parser
jakelishman af56d2b
Credit reviewers
jakelishman aebb86e
Add test of invalid gate-body statements
jakelishman 0816bfb
Refactor custom built-in gate definitions
jakelishman 1072db2
Merge remote-tracking branch 'ibm/main' into qasm2/rust-parser
jakelishman eaa0aab
Credit Sasha
jakelishman 2c54a1a
Merge remote-tracking branch 'ibm/main' into qasm2/rust-parser
jakelishman bdd373e
Credit Matthew
jakelishman 5f74f1e
Remove dependency on `lazy_static`
jakelishman f6f980b
Update PyO3 version
jakelishman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "qiskit-qasm2" | ||
# The following options can be inherited with (e.g.) `version.workspace = true` once we hit Rust | ||
# 1.64. Until then, keep in sync with the root `Cargo.toml`. | ||
version = "0.24.0" | ||
edition = "2021" | ||
rust-version = "1.61" | ||
license = "Apache-2.0" | ||
|
||
[lib] | ||
name = "qiskit_qasm2" | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
hashbrown = "0.13.2" | ||
pyo3 = { version = "0.18.2", features = ["extension-module"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# `qiskit._qasm2` | ||
|
||
This crate is the bulk of the OpenQASM 2 parser. Since OpenQASM 2 is a simple language, it doesn't | ||
bother with an AST construction step, but produces a simple linear bytecode stream to pass to a | ||
small Python interpreter (in `qiskit.qasm2`). This started off life as a vendored version of [the | ||
package `qiskit-qasm2`](https://pypi.org/project/qiskit-qasm2). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other reviewers: this file looks good.