]> foleosoft.com Git - QAnsel.git/commitdiff
Mon Feb 12 02:01:37 PM EST 2024
authormiha-q <>
Mon, 12 Feb 2024 19:01:37 +0000 (14:01 -0500)
committermiha-q <>
Mon, 12 Feb 2024 19:01:37 +0000 (14:01 -0500)
examples/bombtester.txt

index fb71f5c5ff46fcd0331f0f402de94ff29a0ee1b6..c0b6bb0f643b18780b0ffa38518b677053ce9f2e 100644 (file)
@@ -1,12 +1,12 @@
 qreg q[2];
-creg c[3];
+creg c[4];
 
 //Get random bomb
 h q[0];
-measure q[0] -> c[0];
-if(c==1) x q[0];
+measure q[0] -> c[3];
+reset q[0];
 
-//10
+//10: photon entering on the upper path
 x q[1];
 
 //beam splitter
@@ -16,8 +16,8 @@ cx q[1], q[0];
 ry(-pi/4) q[0];
 cx q[0], q[1];
 
-//If bomb, measure and store
-if(c==1) measure q[0] -> c[2];
+//Measuring bomb on the upper path
+if(c[3]==1) measure q[1] -> c[2];
 
 //beam splitter
 cx q[0], q[1];
@@ -30,4 +30,16 @@ cx q[0], q[1];
 measure q[0] -> c[0];
 measure q[1] -> c[1];
 
-print c;
\ No newline at end of file
+//ABCD
+//A = the chosen bomb is a dud or live
+//B = the photon took the path of the bomb (measured by the bomb, exploded!)
+//C = the photon took the upper path
+//D = the photon took the lower path
+//
+//There should be some probability of 1001
+//This means the bomb is live (which we place on the upper path),
+//  the photon did not take the path of the bomb (nothing detected, no explosion)
+//  and the CD=01 measurement outcome cannot occur for a dud bomb (only 10)
+//Hence, we know the bomb is live without interacting with it.
+
+sample;
\ No newline at end of file