feat: Transversal overloads of builtin quantum operations#1490
feat: Transversal overloads of builtin quantum operations#1490rmfisher26 wants to merge 6 commits intoQuantinuum:mainfrom
Conversation
|
Hi @rmfisher26, thanks for your ongoing work on In the meantime, I recommend the following: Whenever you plan to work on an issue, comment and ask for relevance (as you have done in previous issues). Most issues older than a couple of months may be outdated / stale in some other way, or they have remained open since they sparked controversy (like this one). I have also tagged a few issues that are explicitly meant to be worked on, which you can find here (perhaps not the one that is That being said, we really do appreciate your commitment to improving the Guppy language, and we will welcome any additional PRs / suggestions you send our way, regardless of the status of this PR! |
Thank you @maximilianruesch for providing some more context about this and for your guidance. I will ensure next time that I confirm the work is relevant going forward. If there's an opportunity to return to this later on, I'd be glad to pick it back up! |
|
Hi @rmfisher26, we had another look at this, and found that making these (naturally heavily used) functions overloaded would restrict them from being used as higher-order functions (see #1387 for some issues around that, it is non-trivial to resolve). Thus, it would be a pretty big breaking change to the language / allowed / compiling programs, and for that reason we will have to further defer this PR. If you have any further questions just let me know! |
|
Thank you for taking the time to review this further and sharing your analysis. So, I do not have any further questions at this time. I hope the pull request in its current state was still beneficial to your team. |
Summary
h, x, y, z, t, s, v, cx, cy, cz, tdg, sdg, vdg) to accept array[qubit, N] in addition to single qubit argumentsmeasure,discard, and reset to also acceptarray[qubit, N], replacing the need for separatemeasure_arrayanddiscard_arraycallsguppylang.std.quantum.functionalmeasure_array,discard_array,reset_array) pointing to the internal array implementationstrace_callthat is needed to correctly handle inout arguments for overloaded functions during comptime tracingMotivation
Now users can simply write:
Test plan
test_1qb_op_array)test_2qb_op_array)test_measure_overload, test_discard_overload)test_functional_1qb_array, test_functional_2qb_array)Notes:
Error snapshots were updated for these 2 tests since now
hwas changed from a regular function to and overloaded one, However, I don't know if this is correct/intended behavior for these 2 tests:tests/error/modifier_errors/higher_order.errtests/error/poly_errors/non_linear2.err