]> foleosoft.com Git - QAnsel.git/commitdiff
Tue Mar 19 06:46:53 PM EDT 2024
authormiha-q <>
Tue, 19 Mar 2024 22:46:53 +0000 (18:46 -0400)
committermiha-q <>
Tue, 19 Mar 2024 22:46:53 +0000 (18:46 -0400)
examples/bb84.txt

index 29acc29b462e4cf2a74c583edac61f9e68003dc4..60a44b3d6658fb14fc3e66dd7f8b02ff98c603b1 100644 (file)
@@ -1,7 +1,26 @@
 qreg q[2];
 creg c[1];
 
+//Alice sends two bits 00 
 h q[0];
 h q[1];
 
-density q[0];
\ No newline at end of file
+//Eve tries to measure the first
+measure q[0] -> c[0];
+
+//Bob applies the gate before measuring
+h q[0];
+h q[1];
+
+//The first should now be random noise
+//  while the second unmeasured one
+//  should be 0
+born;
+
+//In a full BB84 Alice would randomly
+//  apply the gate or not apply the
+//  gate so Eve would have to guess
+//  and would inevitably end up
+//  turning the transferred bits
+//  into random noise whenever there
+//  is a wrong guess.
\ No newline at end of file