Predict the output
Sampling this circuit 1024 times on the seeded simulator (seed 4559), how many shots land on |101⟩? Estimate P(|101⟩) × 1024 and pick the closest option.
const c = circuit(3);
c.h(0); c.h(1); c.h(2);
// Oracle for |101⟩: flip q1 (so all three are |1⟩), apply CCZ, flip q1 back.
// CCZ via H-CCX-H on the target qubit (q2).
for (let i = 0; i < 2; i++) {
c.x(1);
c.h(2);
c.ccx(0, 1, 2);
c.h(2);
c.x(1);
// Diffuser
c.h(0); c.h(1); c.h(2);
c.x(0); c.x(1); c.x(2);
c.h(2);
c.ccx(0, 1, 2);
c.h(2);
c.x(0); c.x(1); c.x(2);
c.h(0); c.h(1); c.h(2);
}
return c;Commit your prediction for counts of |101⟩ over 1024 shots — then run it.