static void Main(string[] args)
 {
     using (var sim = new QuantumSimulator())
     {
         var received = RunQsharp.Run(sim).Result;
     }
 }
Ejemplo n.º 2
0
 static void Main(string[] args)
 {
     //new QuantumSimulator(randomNumberGeneratorSeed:41)
     using (var sim = new QuantumSimulator())
     {
         var received = RunQsharp.Run(sim).Result;
         Console.WriteLine($"|0>の測定結果: |0>={received.Item1.Item1} |+>={500 - received.Item1.Item1 - received.Item1.Item2} 不定={received.Item1.Item2}");
         Console.WriteLine($"|+>の測定結果: |+>={received.Item2.Item1} |0>={500 - received.Item2.Item1 - received.Item2.Item2} 不定={received.Item2.Item2}");
         Console.ReadLine();
     }
 }
 static void Main(string[] args)
 {
     //確率的なふるまいを乱数でシミュレートするため結果は毎回異なる
     //シードを与えてあげると結果は同じになる
     //new QuantumSimulator(randomNumberGeneratorSeed:41)
     using (var sim = new QuantumSimulator())
     {
         var received = RunQsharp.Run(sim).Result;
         Console.WriteLine($"|0>の測定結果: |0>={received.Item1.Item1} |+>={1000 - received.Item1.Item1 - received.Item1.Item2} 不定={received.Item1.Item2}");
         Console.WriteLine($"|+>の測定結果: |+>={received.Item2.Item1} |0>={1000 - received.Item2.Item1 - received.Item2.Item2} 不定={received.Item2.Item2}");
         Console.ReadLine();
     }
 }