forked from microsoft/QuantumKatas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReferenceImplementation.qs
36 lines (30 loc) · 1.04 KB
/
ReferenceImplementation.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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
//////////////////////////////////////////////////////////////////////
// This file contains reference solutions to all tasks.
// You should not modify anything in this file.
// We recommend that you try to solve the tasks yourself first,
// but feel free to look up the solution if you get stuck.
//////////////////////////////////////////////////////////////////////
namespace Quantum.Kata.MultiQubitSystems {
open Microsoft.Quantum.Intrinsic;
operation PrepareState1_Reference (qs : Qubit[]) : Unit is Adj+Ctl {
X(qs[0]);
X(qs[1]);
}
operation PrepareState2_Reference (qs : Qubit[]) : Unit is Adj+Ctl {
X(qs[1]);
H(qs[1]);
}
operation PrepareState3_Reference (qs : Qubit[]) : Unit is Adj+Ctl {
H(qs[0]);
X(qs[1]);
H(qs[1]);
}
operation PrepareState4_Reference (qs : Qubit[]) : Unit is Adj+Ctl {
H(qs[0]);
H(qs[1]);
S(qs[0]);
T(qs[1]);
}
}