This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
ToffoliSimulator outputs different result when executing Adjoint ApplyAnd
#677
Labels
Kind-Bug
Something isn't working
Describe the bug
When running the following Q# program, the result of running on ToffoliSimulator is different from running on QuantumSimulator and SparseSimulator.
This behavior might be due to the different implementations among the three simulators. Since ToffoliSimulator does not support
H
gate, a specific version ofApplyAnd
is designed on this page. However, when the values oft1
,t2
,qs
are|1>
,|1>
,|0>
, the return value ofCCNOT(t1, t2, qs)
is|1>
,|1>
,|1>
, which violate the initial input rule thatqs
must be|0>
, resulting in different outputs among three simulators.To Reproduce
Outputs
The output of QuantumSimulator and SparseSimulator:
The output of ToffoliSimulator:
System information
The text was updated successfully, but these errors were encountered: