forked from microsoft/Quantum
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuantum.qs
More file actions
28 lines (21 loc) · 725 Bytes
/
Quantum.qs
File metadata and controls
28 lines (21 loc) · 725 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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
namespace Microsoft.Quantum.Samples.Python {
open Microsoft.Quantum.Intrinsic;
open Microsoft.Quantum.Canon;
function HelloWorld (pauli : Pauli) : Unit {
Message($"Hello, world! {pauli}");
}
operation NoisyHadamardChannelImpl (depol : Double, target : Qubit) : Unit {
let idxAction = Random([1.0 - depol, depol]);
if (idxAction == 0) {
H(target);
}
else {
PrepareSingleQubitIdentity(target);
}
}
function NoisyHadamardChannel (depol : Double) : (Qubit => Unit) {
return NoisyHadamardChannelImpl(depol, _);
}
}