-
Notifications
You must be signed in to change notification settings - Fork 277
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
Amplitude-agnostic unit tests #304
Comments
The main reason for not being amplitude agnostic is for the tests to complete within a reasonable amount of time (e.g., direct access to probabilities without having to sample). |
Thank you for the response. The benefit I see in amplitude agnostic tests is that we might expect them to "just work" on true quantum hardware, in addition to simulators, without modification. For example, instead of an IBM back end unit test set, and everything else running on the simulator, it might be possible to apply virtually the full set of unit tests on top of the IBM back end, and switch out the back end throughout with a single configuration option. It's totally understandable if this not a priority or a change you'd like to see, for the moment. If there's nothing else to discuss, we can close the issue. |
The user front-end assumes nothing more than a physical quantum computer can do, i.e., one can only write gate operations and measurement. Additional information by specific back-ends need to be accessed via Access to amplitudes makes it much easier to check, for example, that the global phase of a subroutine is correct. If one uses such a subroutine in a |
Damian, I wasn't really aware of that Part of the difficulty I personally found with trying integrate Qrack as an optional simulator for ProjectQ is that Qrack was designed to force the user not to rely on direct complex amplitude checks. For example, by default, we apply a randomized global phase factor on initialization and on measurement. (This can be turned off in constructors.) I wonder if some other simulators won't also go this route, because it gives a different kind of consistency checking. It's been easier to know that we're not relying on nonobservables in a breaking way. Of course, having to accommodate both approaches, to try swap out the simulator everywhere in ProjectQ with a compilation option, we've triangulated a number of bugs that were easier to miss, doing it our way. (Thank you!) Obviously, the current ProjectQ method works. I understand the separation you mention, now, and it's been a good thing for Qrack. It might be "6 and half-a-dozen," ultimately. |
ProjectQ would be made even better by keeping its public interfaces agnostic to complex-valued physically nonobservable probability amplitudes. The compiler already can be used this way, as is demonstrated by its compatibility with the genuine quantum hardware of the IBM back end. However, reimplementing the unit tests in a probability amplitude agnostic form would be a huge step toward total interchangeability of genuine quantum hardware and simulators, within an open source quantum compiler.
Virtually the full set of unit tests could be immediately applied to genuine quantum hardware. It would encourage "hygiene" in quantum interface and quantum program design in an open source community that has to rely on simulators to prepare for better genuine quantum hardware.
If you approve, I would like to contribute a PR for this. Do you have any comments, design suggestions, ideas, or approaches you would like me to follow?
The text was updated successfully, but these errors were encountered: