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

Add Rust-based OpenQASM 2 converter #9784

Merged
merged 28 commits into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
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 Mar 11, 2023
5723864
Work around docs failure on Sphinx 5.3, Python 3.9
jakelishman Mar 14, 2023
ea9d7b8
Remove unused import
jakelishman Mar 15, 2023
d730709
Merge remote-tracking branch 'ibm/main' into qasm2/rust-parser
jakelishman Mar 15, 2023
02b3934
Tweak documentation
jakelishman Mar 17, 2023
203c7bb
More specific PyO3 usage
jakelishman Mar 17, 2023
f74c872
Use PathBuf directly for paths
jakelishman Mar 17, 2023
2fffb06
Merge remote-tracking branch 'ibm/main' into qasm2/rust-parser
jakelishman Mar 17, 2023
dedb720
Format
jakelishman Mar 17, 2023
b9b1276
Freeze dataclass
jakelishman Mar 18, 2023
a95e8e4
Use type-safe id types
jakelishman Mar 18, 2023
6048257
Documentation tweaks
jakelishman Mar 30, 2023
9c28c1e
Merge remote-tracking branch 'ibm/main' into qasm2/rust-parser
jakelishman Mar 30, 2023
2eb339a
Fix comments in lexer
jakelishman Mar 30, 2023
d5d7115
Fix lexing version number with separating comments
jakelishman Mar 30, 2023
3c0db61
Add test of pathological formatting
jakelishman Mar 30, 2023
46a62ea
Fixup release note
jakelishman Mar 30, 2023
fdc6a9d
Fix handling of u0 gate
jakelishman Mar 30, 2023
e9ffd41
Merge remote-tracking branch 'ibm/main' into qasm2/rust-parser
jakelishman Mar 30, 2023
af56d2b
Credit reviewers
jakelishman Mar 30, 2023
aebb86e
Add test of invalid gate-body statements
jakelishman Apr 3, 2023
0816bfb
Refactor custom built-in gate definitions
jakelishman Apr 4, 2023
1072db2
Merge remote-tracking branch 'ibm/main' into qasm2/rust-parser
jakelishman Apr 4, 2023
eaa0aab
Credit Sasha
jakelishman Apr 4, 2023
2c54a1a
Merge remote-tracking branch 'ibm/main' into qasm2/rust-parser
jakelishman Apr 12, 2023
bdd373e
Credit Matthew
jakelishman Apr 12, 2023
5f74f1e
Remove dependency on `lazy_static`
jakelishman Apr 12, 2023
f6f980b
Update PyO3 version
jakelishman Apr 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions crates/qasm2/Cargo.toml
Copy link
Collaborator

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.

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"] }
6 changes: 6 additions & 0 deletions crates/qasm2/README.md
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).
Loading