Preparing the catalog and filters…Katalog ve filtreler hazırlanıyor…
Starter code
// Two-qubit Grover search: mark |11> and amplify it in one iteration.
module grover_search;
fn main() {
let q = qreg[2];
H(q[0]);
H(q[1]);
// Oracle: change only the phase of |11>.
CZ(q[0], q[1]);
// Diffusion: reflect about the uniform superposition (up to a global phase).
H(q[0]);
H(q[1]);
X(q[0]);
X(q[1]);
CZ(q[0], q[1]);
X(q[0]);
X(q[1]);
H(q[0]);
H(q[1]);
let a: Bit = measure(q[0]);
let b: Bit = measure(q[1]);
return (a, b);
}
Expected output
A two-qubit search space
Marked-state intuition
A measurable result distribution
Debugging checklist
Run the starter code
Change which qubit receives Z
Compare measurements
Explain what is simplified versus full Grover
Extension challenge
Add the playground Grover example and compare it with this minimal sketch.