Preparing the catalog and filters…Katalog ve filtreler hazırlanıyor…
Starter code
module teleportation;
fn main() {
let q: QReg<3> = qreg[3];
H(q[0]);
H(q[1]);
CNOT(q[1], q[2]);
CNOT(q[0], q[1]);
H(q[0]);
let m0: Bit = measure(q[0]);
let m1: Bit = measure(q[1]);
let syndrome: Bit = m0 xor m1;
if (m1 == 1) { X(q[2]); }
if (m0 == 1) { Z(q[2]); }
return (m0, m1, syndrome);
}Expected output
Bell measurement produces two classical bits
syndrome is derived with xor from the measured bits
if blocks run only when the measured bit is 1
The payload is recovered on q[2]
Debugging checklist
Run the circuit and read the Trace tab
Find the Classical Bit syndrome line in Output
Find where the X and Z corrections fire
Remove a correction and explain what breaks
Explain why this derived Bit is useful for syndrome-style checks
Extension challenge
Prepare q[0] with X before teleporting and confirm q[2] still matches.