-
Notifications
You must be signed in to change notification settings - Fork 93
An issue about the AssertQubitWithinTolerance operation #990
Comments
@QuXing9: I am transferring this issue, since
where a |
Thanks for the reply! I understand the meaning of the tolerance parameter.
ensemblePr will always return 0.500……1. Does this mean that when H operation is applied to a qubit, it returns Zero with a probability of 0.499……9 and One with a probability of 0.500……1 ? Why not just return 0.5?
|
By the way, there is a small suggestion. Since the value of tolerance ranges from 0.0 to 1.0. If it is less than 0.0, the qsharp-runtime/src/Simulation/Simulators/CommonNativeSimulator/AssertProb.cs Lines 27 to 28 in e5be79b
Forgive me if I'm wrong. |
Description
Hello! As shown in the below testcase, a qubit is defined, which is named
NISLVariable0
. WhenH
is applied toNISLVariable0
, it has a 50% chance of being 0 and a chance of 50% being 1. But when excepted is set toZero
and tolerance is set to0.5
, the operationAssertQubitWithinTolerance
throws an exception. Is this a normal behavior of the operation? And what does the tolerance parameter mean?Testcase
Actual Behavior
Expected Behavior
No exception
Environment
Operating system
: Windows 10dotnet version
: 3.1.414QDK
: 0.21.2111177148Command
dotnet run
The text was updated successfully, but these errors were encountered: