microsoft / qsharp-language

Official repository for design of the quantum programming language Q# and its core libraries
MIT License
235 stars 56 forks source link

Specification should say that allocated qubits can be released early if possible #47

Closed bamarsha closed 3 years ago

bamarsha commented 3 years ago

The page on Quantum Memory Management says this about using statements:

The using-statement allocates the qubits from the quantum processor's free qubit heap, and returns them to the heap after the statement terminates.

This should be updated to say that the qubits could be released before the end of the statement if the qubits are not used after a certain point in the block. The same could apply to the borrowing statement as well:

The borrowed qubits are in an unknown state and go out of scope at the end of the statement block.