-
Notifications
You must be signed in to change notification settings - Fork 169
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 a state preparation pass before synthesis #1854
Conversation
…ate-preparation
…ate-preparation
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Q: Is there some reason this needs to happen before parameter synthesis? Corollary: we can't know what the state vector's value is until parameter synthesis during JIT compilation, so I'm curious if there is a technical issue why we need to synthesize gates before we get the vector's value... |
We do know the vector data and use it for state preparation - the new pass runs just before the quake synthesizer during synthesis and uses the same parameter data, so it is a question of ordering and what to use as input - raw vector data or the IR representing the data (const array attributes?). So the answer to your question is: not really, it is just a current choice (i.e. I preferred to use the parameter data rather than read from the transformation of the parameter created by synthesis, like attributes from a global constant array). As we figure out how to support initializing vectors from inside the kernel from a vector created in the kernel (as opposed to passed as a parameter), I might move it around and update. Btw, if we end up using a const array for that case, then the IR would look very similar to the IR after synthesis and we only might need one implementation, which then could run after synthesis instead. The main part of this PR is the transformation to gates itself, and it should stay the same in both cases. |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
I think this should be done by working at the IR level. The state vector will not necessarily always be some on-the-side information. To wit, the question about inline initialization lists in a kernel. On the other hand, thanks for the explanation. That aids my understanding. |
Replaced by #1891 |
Description