Skip to content

Commit

Permalink
Debug ApplyBuffer() classical shadows
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Nov 12, 2024
1 parent ffff8c6 commit a13117f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/qunit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4048,9 +4048,10 @@ void QUnit::ApplyBuffer(PhaseShardPtr phaseShard, bitLenInt control, bitLenInt t
const real1_f pch = Prob(control);
const real1_f phHi = pth > pch ? pth : pch;
const real1_f phLo = pth > pch ? pch : pth;
const bool phState = abs(phHi - (ONE_R1_F / 2)) >= abs(phLo - (ONE_R1_F / 2));
const bitLenInt th = pth > pch ? control : target;

if ((2 * phHi) > ONE_R1_F) {
if (phState) {
Phase(ONE_CMPLX, -ONE_CMPLX, th);
logFidelity += log(phHi);
} else {
Expand Down
2 changes: 1 addition & 1 deletion test/benchmarks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ void benchmarkLoopVariable(std::function<void(QInterfacePtr, bitLenInt)> fn, bit
qftReg->SetReactiveSeparate(false);
}

sampleFailureCount++;
++sampleFailureCount;
}
}

Expand Down

0 comments on commit a13117f

Please sign in to comment.