You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
Is your feature request related to a problem? Please describe.
When returning qubits allocated within an operation, the compiler does not flag any issues, however the qubit will try to be deallocated. Currently this issue manifests by causing a ReleasedQubitsAreNotInZeroState exception.
A simple example program which causes this behavior can be found below:
Describe the solution you'd like
There is two solutions that I thought of for this issue:
A check to ensure that returned qubits are still alive and will not be deallocated. Such a check should yield a compiler error/warning
Create a system, similar to C++ unique pointers, to move a qubit's ownership to the function above the call when returning. This is of course a more extensive suggestion that would likely entail more changes than adding move semantics, as it would require ownership support across the board
Is your feature request related to a problem? Please describe.
When returning qubits allocated within an operation, the compiler does not flag any issues, however the qubit will try to be deallocated. Currently this issue manifests by causing a
ReleasedQubitsAreNotInZeroState
exception.A simple example program which causes this behavior can be found below:
Describe the solution you'd like
There is two solutions that I thought of for this issue:
Additional context
There is a related issue filed in the runtime: microsoft/qsharp-runtime#984
The text was updated successfully, but these errors were encountered: