forked from microsoft/Quantum
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDriver.cs
More file actions
26 lines (22 loc) · 917 Bytes
/
Driver.cs
File metadata and controls
26 lines (22 loc) · 917 Bytes
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
// Author: Mathias Soeken, EPFL (Mail: mathias.soeken@epfl.ch)
// Licensed under the MIT License.
using Microsoft.Quantum.Simulation.Core;
using Microsoft.Quantum.Simulation.Simulators;
namespace Microsoft.Quantum.Samples.ReversibleLogicSynthesis
{
class Driver
{
static void Main(string[] args)
{
var sim = new QuantumSimulator();
var perm = new long[] { 0, 2, 3, 5, 7, 1, 4, 6 };
var res = PermutationSimulation.Run(sim, new QArray<long>(perm)).Result;
System.Console.WriteLine($"Does circuit realize permutation: {res}");
for (var shift = 0; shift < perm.Length; ++shift)
{
var measured_shift = HiddenShiftProblem.Run(sim, new QArray<long>(perm), shift).Result;
System.Console.WriteLine($"Applied shift = {shift} Measured shift: {measured_shift}");
}
}
}
}