Documentation

CslibFrontier.Computability.Circuit.Quantum.Oracle.ValueQuery

Placed XOR queries and the quantum value-query model #

A placed coherent XOR query agrees with the existing valueOracle addStep after reindexing its query, response and unused registers. This bridge includes arbitrary superpositions and workspace states. The circuit code layer does not depend on the abstract value-query simulation machinery.

Main results #

theorem Cslib.Quantum.xorQuery_eq_valueOracle {a b m : ℕ} (H : (Fin a → Bool) → Fin b → Bool) (A : Fin (a + b) ↪ Fin m) (ψ : Qubits m) :
have reindex := LinearIsometryEquiv.piLpCongrLeft 2 ℂ ℂ (queryRegisters A); reindex ((xorQuery H A).eval ψ) = (valueOracle addStep H) (reindex ψ)

Reindexing the placed gate into its three registers gives the existing value oracle. This equality covers arbitrary superpositions and arbitrary states of the unused wires.

Embed a native register alongside two zero work registers for the lookup address and value.

noncomputable def Cslib.Quantum.lookupXorSteps {a b m n d : ℕ} (wires : Fin (a + b) ↪ Fin m) (select : BitString a → BitString n) (reply : BitString a → BitString d → BitString b) :

The three table-independent operations surrounding a pair of XOR queries: compute the lookup address, apply the placed XOR response, and uncompute the address.

theorem Cslib.Quantum.runValue_lookupXorSteps {a b m n d : ℕ} (wires : Fin (a + b) ↪ Fin m) (select : BitString a → BitString n) (reply : BitString a → BitString d → BitString b) (D : BitString n → BitString d) (ψ : Qubits m) :
runValue addStep (lookupXorSteps wires select reply) (cleanLookupState ψ) D 2 = cleanLookupState ((xorQuery (fun (x : Fin a → Bool) => reply x (D (select x))) wires).eval ψ)

The compiled query implements the native placed XOR gate and restores both scratch registers, with the same encoding for all choices of wires.