forked from microsoft/Quantum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
31 lines (25 loc) · 993 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Microsoft.Quantum.Simulation.Simulators;
using System.Linq;
namespace Microsoft.Quantum.Examples.Teleportation {
class Program
{
static void Main(string[] args)
{
using (var sim = new QuantumSimulator())
{
var rand = new System.Random();
foreach (var idxRun in Enumerable.Range(0, 8))
{
var sent = rand.Next(2) == 0;
var received = TeleportClassicalMessage.Run(sim, sent).Result;
System.Console.WriteLine($"Round {idxRun}:\tSent {sent},\tgot {received}.");
System.Console.WriteLine(sent == received ? "Teleportation successful!!\n" : "\n");
}
}
System.Console.WriteLine("\n\nPress Enter to continue...\n\n");
System.Console.ReadLine();
}
}
}