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.
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
State synthesis for quantum devices #2291
base: main
Are you sure you want to change the base?
State synthesis for quantum devices #2291
Changes from 11 commits
ac01dd1
21a87c1
3fc56de
7969a75
755d0d1
dc5e77e
382bc99
d3a05d4
ac151f2
51ef054
0cdf3e9
5307aa4
a7f5387
eb8db13
9f0937f
2f3a623
b381350
dc87ca4
e4c7735
53a34c9
30777f3
fe6d409
48704e3
137f621
ad7c6bc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 violates the semantics of Quake: all quantum memory allocations happen at the top-level and cannot be returned from other kernels.
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.
It is only temporary and does not seem to break anything until the Inlining fixes the semantics... But returning allocations (instead of passing them as a parameter) is much easier to implement. Let me know if it is a showstopper, I can revisit passing allocations as a parameter.
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.
Well, it's a bug even if it "works" for now, so I think we ought to deal with it now.
I don't see why returning is any easier. Updating the "init kernel" from something like
to a "modified init kernel" of
is easy enough.
Also, if we pass in the allocated qubits, we don't have to erase them at the top-level or rely on inlining to get things normalized, etc.
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.
The callee can have multiple allocations, so I would need to know how to split the
qvector
to pass to those allocations. Not sure how to do that yet (process the function to get allocation sizes first? The size can be a result of a_getNumberOfQubits
call though...)I need time to try changing to passing allocations as parameters, probably won't fit into this release, unless I only support a trivial case of one allocation in a callee kernel. Do you think this part can be done in a later PR?