-
Notifications
You must be signed in to change notification settings - Fork 303
Update Python bridge to properly handled nested expressions and other fixes #3537
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
Open
bettinaheim
wants to merge
111
commits into
NVIDIA:main
Choose a base branch
from
bettinaheim:python-bridge
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 87 commits
Commits
Show all changes
111 commits
Select commit
Hold shift + click to select a range
0351238
first draft for some bridge fixes
bettinaheim 6e2a893
getting closer with the testing
bettinaheim 461a32e
more tests and fixes
bettinaheim 3249b15
finished the tuple testing
bettinaheim 1cf4e67
some clean up
bettinaheim 77c02a8
allow to deconstruct lists
bettinaheim 912c905
more clean up
bettinaheim 1b6024a
don't assume stack size
bettinaheim f8e7835
fixed controlled and adjoint
bettinaheim 9104265
tests for callable kernel args with control and adjoint
bettinaheim 0d8d34d
argument conversion needs reexamination
bettinaheim a5e4944
handling the vect<bool> conversion in the argument conversion
bettinaheim bd73206
minor clean up
bettinaheim 95054ff
some test clean up
bettinaheim 418ae3b
some test clean up
bettinaheim 7fab128
some bridge clean up
bettinaheim c8c699d
added a test
bettinaheim 3ada403
more tests
bettinaheim 7c48168
forgot something
bettinaheim 9d611eb
forgot something
bettinaheim 8f5e619
moving processing of veq functions
bettinaheim a96dccd
minor things
bettinaheim 8ed8d07
reverting a bad change
bettinaheim 6439bca
proper tests for comparison and found some bugs
bettinaheim 6fb2fe7
more tests
bettinaheim cf202a1
Merge branch 'main' into list-comprehension
bettinaheim 0c03364
we have some issues with data conversion for __quantum__* functions i…
bettinaheim e164d88
Merge branch 'list-comprehension' of https://github.com/bettinaheim/c…
bettinaheim 8173b7b
last remaining tests for now
bettinaheim 383584b
forgot to commit matching bridge changes
bettinaheim 4bae1a3
adding missing return
bettinaheim de6e27e
Merge branch 'main' into list-comprehension
bettinaheim e96b872
formatting
bettinaheim db8531d
spelling
bettinaheim 491994a
more formatting
bettinaheim 8c4eb96
more formatting
bettinaheim 62b5caa
pull the modulo change out of this PR
bettinaheim d4f34a5
formatting
bettinaheim a4c1470
draft manually pushing and poping stack frames before making this cle…
bettinaheim 4fbb505
to be reverted/revised
bettinaheim bdbaba1
updating tests for python 3.11-3.13
bettinaheim 277c7f7
Merge branch 'main' into list-comprehension
bettinaheim fd8074e
adjusting tests for the new errors (or lack thereof)
bettinaheim 26ae70c
Merge branch 'list-comprehension' of https://github.com/bettinaheim/c…
bettinaheim 3011f86
support star for expanding qubit arrays in lists
bettinaheim f5b183f
minimal support for binary ops in list comprehension
bettinaheim 84515aa
that should update all tests
bettinaheim 9a24085
Merge branch 'main' into list-comprehension
bettinaheim c49be64
spelling and formatting
bettinaheim 91ee130
Merge branch 'list-comprehension' of https://github.com/bettinaheim/c…
bettinaheim aa56ce0
allowing almost all binary operators in list comprehension
bettinaheim 81e48f6
formatting
bettinaheim 74eb44d
adding some unpack tests
bettinaheim 59050a5
ajusting example to not use the same local variable as a captured value
bettinaheim 2497c9f
formatting
bettinaheim 88f3b95
ajustments after merge
bettinaheim dbecdf9
Merge branch 'main' into python-modulo
bettinaheim 1301201
Merge branch 'main' into python-bridge
bettinaheim e58fc94
Merge branch 'python-modulo' into python-bridge
bettinaheim a64cb69
clean up before making the frames automatic
bettinaheim c11cf08
overlooked a failing test
bettinaheim 87e587b
eliminating the attribute sometimes producing two values
bettinaheim 86f785d
removing the manual pushing and popping of frames
bettinaheim fe3a626
should be an ok structure for the stack
bettinaheim 5961a75
making some decent progress towards making sure we fail when somethin…
bettinaheim 93b975c
validated the gate update
bettinaheim 29ec9d9
just some comments
bettinaheim 486b227
general helper to group values
bettinaheim 01fe16f
minor things
bettinaheim a9f662c
cleaning up loops
bettinaheim 4643b51
eliminating code duplication in visit_for
bettinaheim f107ca5
clean up
bettinaheim f37f20a
more clean up
bettinaheim 55e6177
wip to clean up the handling of reference types
bettinaheim 9b78a5f
more wip
bettinaheim be3884b
some progress with clean up
bettinaheim 4c5c8ba
minor thing
bettinaheim 04aea9c
first complete outline
bettinaheim 05d1892
existing python kernel tests pass
bettinaheim 59c6978
whitespace fixes
bettinaheim da53fcf
clean up
bettinaheim c58e77a
creating list copies when needed
bettinaheim ffa3697
some clean up for the assignment tests
bettinaheim c9f2d8d
more assignment tests
bettinaheim ae0d14b
confirmed value behavior
bettinaheim 74363e9
added an error when we have lists in structs
bettinaheim dd4ac73
that should do for the assignment tests
bettinaheim 2f929cd
updating most mlir tests
bettinaheim 3a81c6e
python tests are ok, but we have some gaps - commit before closing them
bettinaheim f625eb2
close to the final version
bettinaheim 7041ab6
clean up
bettinaheim cf3a0e9
feeling good about assignments now
bettinaheim cf041b3
python kernel and mlir tests pass
bettinaheim d665ffa
updates from main
bettinaheim 024d10b
test updates from merge
bettinaheim cb0e259
fixing list[bool] arg issue
bettinaheim 2a0bb39
other bridge fixes after merge
bettinaheim 64c6d60
python kernel and mlir tests pass
bettinaheim 5a82186
Merge branch 'main' into python-bridge
bettinaheim 02e5fcb
last clean up from merge
bettinaheim bdcb5f7
removing the now unnecessary loads throughout the bridge
bettinaheim 6dfbdd6
some formatting
bettinaheim 692a668
addressing some review comments
bettinaheim b873ec0
minor things
bettinaheim 15cbd2e
whitespace
bettinaheim cf0aebb
undoing change left over from merge
bettinaheim 5156f98
Merge branch 'main' into python-bridge
bettinaheim c9d37e9
formatting
bettinaheim eacfe78
spelling
bettinaheim 53b1e33
formatting
bettinaheim 639ebf2
minor thing
bettinaheim 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
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.
This change appears to be incorrect. Can you explain how these changes can statically determine the size of an object that's size is only known at runtime?
Uh oh!
There was an error while loading. Please reload this page.
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.
Maybe we need a more fine-grained check here. Is dynamic fails for arrays of unknown size (I believe sizeof would need to fail in this case as well), span-like types, and any structs that contain these.
Span-like types are vectors and char spans. For vectors, sizeof should not fail, since the size of the vector is perfectly known (three pointers) - not sure about char spans and how they are used.
isDynamicType is also used in a bunch of contexts, however, for which vectors indeed need to be considered dynamic. I can create a new helper isDynamicallySizedType that indeed reflects when the size of the type itself is not known at compile time.