This repository has been archived by the owner on Aug 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathTasks.qs
66 lines (48 loc) · 1.84 KB
/
Tasks.qs
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
//////////////////////////////////////////////////////////////////
// This file is a back end for the tasks in Deutsch-Jozsa algorithm tutorial.
// We strongly recommend to use the Notebook version of the tutorial
// to enjoy the full experience.
//////////////////////////////////////////////////////////////////
namespace Quantum.Kata.DeutschJozsaAlgorithm {
open Microsoft.Quantum.Diagnostics;
open Microsoft.Quantum.Intrinsic;
open Microsoft.Quantum.Canon;
//////////////////////////////////////////////////////////////////
// Part I. Classical algorithm
//////////////////////////////////////////////////////////////////
// Exercise 1.
function Function_MostSignificantBit (x : Int, N : Int) : Int {
// ...
return -1;
}
// Exercise 2.
function IsFunctionConstant_Classical (N : Int, f : (Int -> Int)) : Bool {
// ...
return false;
}
//////////////////////////////////////////////////////////////////
// Part II. Single-bit problem
//////////////////////////////////////////////////////////////////
// Exercise 3.
operation PhaseOracle_OneMinusX (x : Qubit) : Unit is Adj + Ctl {
// ...
}
// Exercise 4.
operation DeutschAlgorithm (oracle : (Qubit => Unit)) : Bool {
return false;
}
//////////////////////////////////////////////////////////////////
// Part III. Multi-bit problem
//////////////////////////////////////////////////////////////////
// Exercise 5.
operation PhaseOracle_MostSignificantBit (x : Qubit[]) : Unit {
// ...
}
// Exercise 6.
operation DeutschJozsaAlgorithm (N : Int, oracle : (Qubit[] => Unit)) : Bool {
// ...
return false;
}
}