Appendix A.3: repeated-value implementation of the sparse-access entry oracle (94)
OpenQAlgorithms.Papers.Independent.Extend50.P44.repeatedValueEntryOracleLet an explicitly supplied reversible reverse map compute, from row and column indices , either an occurrence label or a fixed zero sentinel. Let each of the active table entries have a specified -bit code, with zero codes on all other physical data labels. Require a concrete clean-work arithmetic circuit implementing the reverse map; no efficient inversion is inferred from forward position formulas.
Compute the label, XOR its data code into a general output buffer, and uncompute the label. This unitary implements
It loads items. If the given reverse computation has Toffoli count at most , its compute/uncompute contribution is at most . Thus any uniform polylogarithmic arithmetic bound is preserved. Finite codes are the prescribed representations, rather than exact binary expressions for arbitrary reals.
import Definitions.Def_QAlgorithms_Papers_Independent_Extend50_P44
noncomputable section
namespace QAlgorithms.Papers.Independent.Extend50.P44
open scoped BigOperators ComplexConjugate Matrix
open QAlgorithms.Papers.Independent.Frontier18.P11 (complexMatrix)
open QAlgorithms.Papers.Independent.Information100.P34 (permutationMatrix)
open QAlgorithms.Papers.Independent.Next46.P21 (tCount)
variable {n s d m : ℕ}
local instance : DecidableEq QAlgorithms.Gate := Classical.decEq _
/-- PDF p.26, (93)-(94): repeated-value implementation of the sparse-access
entry oracle. A given cost-bearing reverse-map circuit is required explicitly.
Its compute/uncompute overhead doubles, so any uniform polylogarithmic bound
for that circuit remains such a bound with twice the same constant. Data is
an arbitrary specified b-bit representation, not an exact code of every real. -/
theorem repeatedValueEntryOracle (n d m b work : ℕ)
(r : (Fin (2 ^ n) × Fin (2 ^ n)) → Option (Fin (2 ^ d) × Fin (2 ^ m)))
(code : Fin (2 ^ d) → QAlgorithms.Qubits b)
(active : Finset (Fin (2 ^ d)))
(hcode : ∀ j, j ∉ active → code j = 0)
(hrange : ∀ ij l, r ij = some l → l.1 ∈ active)
(c : List (ArithmeticGate ((n + n + (1 + d + m)) + work)))
(hc : RealizesMap rowColumnLabelBits rowColumnLabelBits
(fun x : (Fin (2 ^ n) × Fin (2 ^ n)) × QAlgorithms.Qubits (1 + d + m) =>
(x.1, x.2 + reverseCode r x.1)) (n + n + (1 + d + m)) work c) :
entryCircuit r code ∈ Matrix.unitaryGroup _ ℂ ∧
(∀ (ij : Fin (2 ^ n) × Fin (2 ^ n)) (y : QAlgorithms.Qubits b),
QAlgorithms.act (entryCircuit r code) (QAlgorithms.ket ((y, ij), 0)) =
QAlgorithms.ket ((y + (match r ij with | none => 0 | some l => code l.1), ij), 0)) ∧
loadingCost (baseLoadingSchedule active.card) = active.card ∧
(∀ bound : ℝ, (toffoliCount c : ℝ) ≤ bound →
(entryArithmeticCost c : ℝ) ≤ 2 * bound) := by sorry
end QAlgorithms.Papers.Independent.Extend50.P44
end
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
Let be arbitrary natural numbers, including zero; let map each pair either to no label or to a label ; let assign a Boolean string of length to each first label component; and let . Assume that is the all-false string whenever , and that implies . Define to be the all-false string of length when has no label, and otherwise the concatenation of true, the -bit most-significant-first representation of , and the -bit representation of . Let be a finite list of arithmetic gates on wires, each flipping its target exactly when all its at most two control bits are true, with target excluded from controls. Assume that, for every and every Boolean string of length , executing on the concatenation of the two -bit representations in , then , then false bits produces the same encoding of and returns all work bits to false, where denotes bitwise exclusive-or. On basis labels , define by replacing with , and define by replacing with , where if the first bit of is false, and otherwise is the code indexed by the next bits; the remaining bits are ignored. Let , using matrices whose entries are exactly at the specified basis transitions and elsewhere. Then is unitary, and its action on every computational basis vector with zero label register is
The loading cost, defined as the sum of the singleton schedule , equals ; and for every real bound , if the number of gates in with exactly two controls is at most , then the number of such gates in followed by its reversal is at most . No distinctness of code values is assumed. If is empty, the hypotheses force every code value to be zero and to return no label everywhere.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.