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
Describe the bug
When the code in a notebook contains @EntryPoint(), the adjoint of any within block is not applied.
(Thanks to @cgranade for finding and reporting this issue.)
To Reproduce
Steps to reproduce the behavior:
Execute the following code in a Q# notebook cell:
operation HXH() : Unit {
using (q = Qubit()) {
within { H(q); }
apply { X(q); }
}
}
@EntryPoint()
operation DoNothing() : Unit {}
Run %simulate HXH.
This fails with the error: Released qubits are not in zero state. Inspection of the generated C# code reveals that the final H operation is not being applied.
Expected behavior
Operation should run successfully, since if compiled correctly, the qubits would be in the zero state when released.
Note that if the @EntryPoint() line is removed, everything works fine.
Screenshots
If applicable, add screenshots to help explain your problem.
Describe the bug
When the code in a notebook contains
@EntryPoint(), the adjoint of anywithinblock is not applied.(Thanks to @cgranade for finding and reporting this issue.)
To Reproduce
Steps to reproduce the behavior:
Execute the following code in a Q# notebook cell:
Run
%simulate HXH.This fails with the error:
Released qubits are not in zero state.Inspection of the generated C# code reveals that the finalHoperation is not being applied.Expected behavior
Operation should run successfully, since if compiled correctly, the qubits would be in the zero state when released.
Note that if the
@EntryPoint()line is removed, everything works fine.Screenshots

If applicable, add screenshots to help explain your problem.
System information