-
Notifications
You must be signed in to change notification settings - Fork 0
/
Driver.cs
34 lines (29 loc) 路 1.03 KB
/
Driver.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
32
33
34
锘縰sing System;
using Microsoft.Quantum.Simulation.Core;
using Microsoft.Quantum.Simulation.Simulators;
namespace Bell
{
class Driver
{
static void Main(string[] args)
{
using (var qsim = new QuantumSimulator())
{
// Try initial values
Result[] initials = new Result[] { Result.Zero, Result.One };
foreach (Result initial in initials)
{
var res = BellTest.Run(qsim, 1000, initial).Result;
var (numZeros, numOnes, agree) = res;
System.Console.WriteLine(
$"Init:{initial,-4} 0s={numZeros,-4} 1s={numOnes,-4} agree={agree,-4}");
}
}
var estimator = new ResourcesEstimator();
BellTest.Run(estimator, 1000, Result.Zero).Wait();
System.Console.WriteLine(estimator.ToTSV());
System.Console.WriteLine("Press any key to continue...");
Console.ReadKey();
}
}
}