INNER CODE UNIT · C++
outcome
aromanro/QCSim · QCSim/CliffordTests.cpp:905
const bool outcome = single.MeasureQubit(0); // Previously asserted on the paired destabilizer.
if (!CliffordCheck(single.MeasureQubit(0) == outcome && single.GetQubitProbability(0) == double(outcome),
"Measurement after S,H must collapse consistently"))
return false;
for (size_t n : {2, 65, 1025})
{
// Two GHZ groups have four equally likely basis outcomes. S,H ensures
// the probability path also encounters a pivot with an X destabilizer.
CliffordRegressionSimulator groups(n);
groups.SetMultithreading(false);
groups.ApplyS(0);
groups.ApplyH(0);
groups.ApplyS(1);
groups.ApplyH(1);
for (size_t q = 2; q < n; ++q)
groups.ApplyCX(q, q % 2);
const CliffordRegressionSimulator before(groups);