diff --git a/samples/algorithms/QRNGNISQ.qs b/samples/algorithms/QRNGNISQ.qs deleted file mode 100644 index 3b2c2cf386..0000000000 --- a/samples/algorithms/QRNGNISQ.qs +++ /dev/null @@ -1,34 +0,0 @@ -/// # Sample -/// Quantum Random Number Generator -/// -/// # Description -/// This program implements a quantum random number generator by setting qubits -/// in superposition and then using the measurement results as random bits. -import Std.Measurement.*; -import Std.Intrinsic.*; - -operation Main() : Result[] { - // Generate 5-bit random number. - let nBits = 5; - return GenerateNRandomBits(nBits); -} - -/// # Summary -/// Generates N random bits. -operation GenerateNRandomBits(nBits : Int) : Result[] { - // Allocate N qubits. - use register = Qubit[nBits]; - - // Set the qubits into superposition of 0 and 1 using the Hadamard - // operation `H`. - for qubit in register { - H(qubit); - } - - // At this point each has 50% chance of being measured in the |0〉 state - // and 50% chance of being measured in the |1〉 state. - // Measure each qubit and reset them all so they can be safely - // deallocated. - let results = MResetEachZ(register); - return results; -} diff --git a/samples/samples.mjs b/samples/samples.mjs index 45845d43fb..5e0c84d6c2 100644 --- a/samples/samples.mjs +++ b/samples/samples.mjs @@ -19,8 +19,7 @@ export default [ { title: "Teleportation (Simple)", file: "./getting_started/SimpleTeleportation.qs", shots: 100 }, { title: "JointMeasurement", file: "./getting_started/JointMeasurement.qs", shots: 100 }, { title: "Teleportation", file: "./algorithms/Teleportation.qs", shots: 1 }, - { title: "Random Number Generator", file: "./algorithms/QRNGNISQ.qs", shots: 1000 }, - { title: "Random Number Generator (Advanced)", file: "./algorithms/QRNG.qs", shots: 1000 }, + { title: "Random Number Generator", file: "./algorithms/QRNG.qs", shots: 1000 }, { title: "Deutsch-Jozsa", file: "./algorithms/DeutschJozsaNISQ.qs", shots: 1 }, { title: "Deutsch-Jozsa (Advanced)", file: "./algorithms/DeutschJozsa.qs", shots: 1 }, { title: "Bernstein-Vazirani", file: "./algorithms/BernsteinVaziraniNISQ.qs", shots: 1 }, diff --git a/samples_test/src/tests/algorithms.rs b/samples_test/src/tests/algorithms.rs index 88cb464d2f..25988d2632 100644 --- a/samples_test/src/tests/algorithms.rs +++ b/samples_test/src/tests/algorithms.rs @@ -134,8 +134,6 @@ pub const QRNG_EXPECT: Expect = expect![[r#" pub const QRNG_EXPECT_DEBUG: Expect = expect![[r#" Sampling a random number between 0 and 100: 46"#]]; -pub const QRNGNISQ_EXPECT: Expect = expect!["[Zero, Zero, One, One, One]"]; -pub const QRNGNISQ_EXPECT_DEBUG: Expect = expect!["[Zero, Zero, One, One, One]"]; pub const SHOR_EXPECT: Expect = expect![[r#" *** Factorizing 187, attempt 1. Estimating period of 182.