Preparing the catalog and filters…Katalog ve filtreler hazırlanıyor…
Starter code
module basis_measurement;
@seed(3);
fn main() {
let q: QReg<3> = qreg[3];
H(q[0]);
H(q[1]);
S(q[1]);
let mx: Bit = measure X(q[0]);
let my: Bit = measure Y(q[1]);
let mz: Bit = measure Z(q[2]);
return (mx, my, mz);
}Expected output
q[0] is sampled in X basis after H creates |+>
q[1] is sampled in Y basis after H then S creates |+i>
The Circuit tab labels the measurements as MX, MY, and MZ
Debugging checklist
Run the circuit and read the Output tab
Open the Circuit tab and find MX, MY, and MZ
Change measure X(q[0]) to measure Z(q[0]) and compare the result
Explain why changing the measurement basis can reveal phase information
Extension challenge
Remove S(q[1]) and explain why the Y-basis measurement becomes random.