-
Notifications
You must be signed in to change notification settings - Fork 11
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 support for arrays #28
Merged
Merged
Conversation
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
anuragm
commented
Mar 17, 2023
PhilReinhold
requested changes
Mar 17, 2023
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.
Looking good! Thanks for putting this together, just a few ideas.
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.
LGTM. I added few comments, which might not need changes.
anuragm
requested review from
jcjaskula-aws and
PhilReinhold
and removed request for
PhilReinhold and
jcjaskula-aws
March 21, 2023 19:07
PhilReinhold
approved these changes
Mar 21, 2023
yitchen-tim
added a commit
to ajberdy/oqpy
that referenced
this pull request
May 2, 2023
* Fix code of conduct link (openqasm#27) Co-authored-by: Jean-Christophe Jaskula <[email protected]> * Add support for arrays (openqasm#28) * Add array variable * Enable indexing * Add a test * More tests * Allow specifying type and dimensions in declaration * Explicitly test setting with variable * Typing: allow assignment to indexed expressions * Union type typealias * Fix comment, provide OQIndexExpression from the module * Pydocstyle Why complain now? * Add base type to ComplexVar and propagate it to arrays * Bump setuptools from 65.4.1 to 65.5.1 (openqasm#30) Bumps [setuptools](https://github.com/pypa/setuptools) from 65.4.1 to 65.5.1. - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/CHANGES.rst) - [Commits](pypa/setuptools@v65.4.1...v65.5.1) --- updated-dependencies: - dependency-name: setuptools dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump cryptography from 37.0.4 to 39.0.1 (openqasm#29) Bumps [cryptography](https://github.com/pyca/cryptography) from 37.0.4 to 39.0.1. - [Release notes](https://github.com/pyca/cryptography/releases) - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](pyca/cryptography@37.0.4...39.0.1) --- updated-dependencies: - dependency-name: cryptography dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add shift and bitwise operations (openqasm#31) * Add shift and logical operations * Add logical OR and AND --------- Co-authored-by: Mitch D'Ewart <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Anurag Mishra <[email protected]> Co-authored-by: Jean-Christophe Jaskula <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: jmdewart <[email protected]> Co-authored-by: Mitch D'Ewart <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds support for native Opqy arrays. Arrays can be defined with an initial expression and can be indexed using any expression that can be converted to an AST expression.
See added tests for example usage.