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