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 was archived by the owner on Jan 12, 2024. It is now read-only.
Our existing C# wrapper for the fullstate simulator checks the result of release on a qubit to ensure that the qubit was in a well-known state at release time (see #206 for the detailed discussion of the release semantics). Releasing a qubit that could be entangled can result in problems for the rest of the program, and the simulator gives developers a way to use Q# to validate their algorithms for this. The C++ wrapper around the simulator used in QIR does not check the return of release and therefore doesn't provide this feedback, allowing for algorithms to effectively leak state.
To test this, consider the following Q#:
operationTest() : Unit {
useq=Qubit();
X(q);
}
Because the qubit is not in the ground state and hasn't been measured, running this code on the C# simulator will result in a ReleasedQubitsAreNotInZeroState exception being thrown from QubitManager.cs. We need an equivalent check in the QIR fullstate simulator wrapper.