Skip to content

Commit

Permalink
Optimize hybrid stabilizer ApproxCompare()
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Jul 18, 2023
1 parent a1b3ad1 commit d6653d9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/qstabilizerhybrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2013,6 +2013,12 @@ real1_f QStabilizerHybrid::ApproxCompareHelper(QStabilizerHybridPtr toCompare, b
}

if (thisClone && thisClone->stabilizer && thatClone && thatClone->stabilizer) {
if (randGlobalPhase) {
thisClone->stabilizer->ResetPhaseOffset();
}
if (toCompare->randGlobalPhase) {
thatClone->stabilizer->ResetPhaseOffset();
}
if (isDiscreteBool) {
return thisClone->stabilizer->ApproxCompare(thatClone->stabilizer, error_tol) ? ZERO_R1_F : ONE_R1_F;
} else {
Expand Down

0 comments on commit d6653d9

Please sign in to comment.