forked from microsoft/Quantum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPermutationOracle.qs
42 lines (40 loc) · 1.23 KB
/
PermutationOracle.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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
namespace Microsoft.Quantum.Extensions.Oracles
{
/// # Summary
/// Apply a classical permutation oracle to two registers.
///
/// # Description
/// The effect of the oracle is a permutation of basis states according to
/// the provided classical function:
/// $$
/// \begin{align}
/// \ket{x}\ket{y}\ket{w} \rightarrow \ket{x}\ket{f(x, y)}\ket{w},
/// \end{align}
/// $$
/// with registers x, y, w and the oracle function f.
///
/// # Input
/// ## oracle
/// A function that defines the action of the oracle on the computational
/// basis states of the two registers x, y. The mapping
/// $$
/// \begin{align}
/// $(x, y) \rightarrow (x, z=f(x, y))$
/// \end{align}
/// $$
/// must be a bijective mapping on the basis states.
/// ## xbits
/// Input register x.
/// ## ybits
/// Output register y.
operation PermutationOracle(oracle : ((Int, Int) -> Int), xbits : Qubit[], ybits : Qubit[]) : Unit
{
body (...)
{
fail "not implemented for general target machines yet";
}
adjoint auto;
}
}