Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit 049ad52

Browse files
authored
Fixes #580. (#581)
1 parent b798477 commit 049ad52

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Standard/src/AmplitudeAmplification/AmplitudeAmplification.qs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation. All rights reserved.
1+
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

44
namespace Microsoft.Quantum.AmplitudeAmplification {
@@ -129,16 +129,16 @@ namespace Microsoft.Quantum.AmplitudeAmplification {
129129
/// It is assumed that the target state is marked by $\ket{1}\_f$.
130130
/// It is assumed that
131131
/// \begin{align}
132-
/// O\ket{\text{start}}\_{fa}\ket{\psi}\_s= \lambda\ket{1}\_f\ket{\text{anything}}\_a\ket{\text{target}}\_s U \ket{\psi}\_s + \sqrt{1-|\lambda|^2}\ket{0}\_f\cdots,
132+
/// O\ket{\text{start}}\_{fa}\ket{\psi}\_s= \lambda\ket{1}\_f\ket{\text{anything}}\_a\ket{\text{target}}\_s + \sqrt{1-|\lambda|^2}\ket{0}\_f\cdots,
133133
/// \end{align}
134-
/// for some unitary $U$.
134+
/// where $\ket{\text{target}}\_s = U \ket{\psi}\_s$ for some unitary $U$.
135135
function ObliviousAmplitudeAmplificationFromStatePreparation(
136136
phases : ReflectionPhases,
137137
startStateOracle : DeterministicStateOracle,
138138
signalOracle : ObliviousOracle,
139139
idxFlagQubit : Int
140140
)
141-
: ((Qubit[], Qubit[]) => Unit is Adj + Ctl) {
141+
: (Qubit[], Qubit[]) => Unit is Adj + Ctl {
142142
let startStateReflection = ReflectionStart();
143143
let targetStateReflection = TargetStateReflectionOracle(idxFlagQubit);
144144
let obliviousSignalOracle = ObliviousOracleFromDeterministicStateOracle(
@@ -205,7 +205,7 @@ namespace Microsoft.Quantum.AmplitudeAmplification {
205205
startStateReflection : ReflectionOracle,
206206
targetStateReflection : ReflectionOracle
207207
)
208-
: (Qubit[] => Unit is Adj + Ctl) {
208+
: Qubit[] => Unit is Adj + Ctl {
209209
// Pass empty qubit array using fact that NoOp does nothing.
210210
let qubitEmpty = [];
211211
let signalOracle = ObliviousOracle(NoOp);
@@ -247,7 +247,7 @@ namespace Microsoft.Quantum.AmplitudeAmplification {
247247
stateOracle : StateOracle,
248248
idxFlagQubit : Int
249249
)
250-
: (Qubit[] => Unit is Adj + Ctl) {
250+
: Qubit[] => Unit is Adj + Ctl {
251251
let systemRegister = [];
252252
let signalOracle = ObliviousOracle(NoOp);
253253
let startStateOracle = DeterministicStateOracleFromStateOracle(idxFlagQubit, stateOracle);
@@ -290,7 +290,7 @@ namespace Microsoft.Quantum.AmplitudeAmplification {
290290
stateOracle : StateOracle,
291291
idxFlagQubit : Int
292292
)
293-
: (Qubit[] => Unit is Adj + Ctl) {
293+
: Qubit[] => Unit is Adj + Ctl {
294294
let phases = StandardReflectionPhases(nIterations);
295295
return AmplitudeAmplificationFromStatePreparation(phases, stateOracle, idxFlagQubit);
296296
}
@@ -317,15 +317,15 @@ namespace Microsoft.Quantum.AmplitudeAmplification {
317317
mutable exponentMax = 0;
318318
mutable exponentCurrent = 0;
319319

320-
//Complexity: Let \theta = \mathcal{O}(\sqrt{lambda})
320+
// Complexity: Let \theta = \mathcal{O}(\sqrt{lambda})
321321
// Number of Measurements = O( Log^2(1/\theta) )
322322
// Number of Queries = O(1/\theta)
323323
use flagQubit = Qubit();
324324
let qubits = [flagQubit] + startQubits;
325325
let idxFlagQubit = 0;
326326

327327
repeat {
328-
if 2 ^ exponentMax > queriesMax {
328+
if 2^exponentMax > queriesMax {
329329
fail $"Target state not found. Maximum number of queries exceeded.";
330330
}
331331

0 commit comments

Comments
 (0)