Preparing the catalog and filters…Katalog ve filtreler hazırlanıyor…
Starter code
module qft_two;
fn main() {
let q: QReg<2> = qreg[2];
H(q[1]);
CP(q[0], q[1], PI / 2);
H(q[0]);
SWAP(q[0], q[1]);
assert probability(|00>) > 0.2;
assert probability(|11>) > 0.2;
let a: Bit = measure(q[0]);
let b: Bit = measure(q[1]);
return (a, b);
}Expected output
The QFT maps |00> to a uniform superposition
Each basis state lands near 25% probability
The Circuit tab shows H, CP, and SWAP
Debugging checklist
Run the circuit and open the Circuit tab
Change the CP angle and watch the assertions
Compare the state probabilities to 25% each
Replace the manual gates with use std.qft2; and qft2(q)
Explain the role of the final SWAP
Extension challenge
Compare the manual QFT with use std.qft2; then remove the SWAP and describe how the output qubit order changes.