Beispiel #1
0
        static void Main(string[] args)
        {
            using (var sim = new QuantumSimulator())
            {
                var message = sim.RunManyTimesN(BuildBellPair.Run, 10);
                System.Console.WriteLine($"The result of building a bell state was {message}");

                var ghz_count = 4;
                message = sim.RunManyTimesN(s => PutInGHZState.Run(s, ghz_count), 100);
                System.Console.WriteLine($"The result of putting {ghz_count} qubits in the GHZ state was {message}");
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            using (var sim = new QuantumSimulator())
            {
                var message = AllocateAndMeasureSingleQubit.Run(sim).Result;
                System.Console.WriteLine($"The result of allocating and measuring a qubit was {message}");

                message = PutInOneState.Run(sim).Result;
                System.Console.WriteLine($"The result of putting a qubit in |1> was {message}");

                message = sim.RunManyTimes(PutInPlusState.Run, 100);
                System.Console.WriteLine($"The result of putting a qubit in |+> was {message}");

                var qubitCount = 4;
                message = sim.RunManyTimesN(s => SuperPositionOverAllBasisVectors.Run(s, qubitCount), 10000);
                System.Console.WriteLine($"The result of putting {qubitCount} qubits in the GHZ state was {message}");
            }
        }