Documentation

CslibFrontier.Computability.QueryComplexity.Quantum.ValueQuery

Quantum value-query algorithms #

This module extends the phase-oracle quantum query model (Cslib.Quantum.run) to the quantum value-query model (Cslib.Quantum.ValueState, Cslib.Quantum.valueOracle, Cslib.Quantum.runValue) over an arbitrary finite query index type ι, finite value/answer register V, and finite workspace W, where each oracle call applies an input-dependent unitary step (x i) to the V register controlled by the query index i. Diagonal phase kickback (Cslib.Quantum.phaseStep, recovering Cslib.Quantum.phaseOracle and Cslib.Quantum.run via Cslib.Quantum.valueOracle_phaseStep and Cslib.Quantum.runValue_phaseStep), permutation oracles (Cslib.Quantum.permStep), group-addition oracles (Cslib.Quantum.addStep), and XOR oracles (BitString as an additive group) are special cases. Multi-outcome computational-basis readouts (Cslib.Quantum.measureOut) are provided by CslibFrontier/Foundations/Quantum/Measurement/Readout.lean.

For lower bounds, restricting a value-query algorithm to inputs taking only two values a₀ and a₁ can be simulated in the Boolean phase-oracle model (Cslib.Quantum.run) on N = |ι| bits:

Main definitions #

Main results #

Fibered unitary helpers #

Value-query model #

@[reducible, inline]
abbrev Cslib.Quantum.ValueState (ι : Type u_1) (V : Type u_2) (W : Type u_3) :
Type (max (max u_3 u_2) u_1)

The quantum state space of a value-query algorithm with query index register ι, value register V, and workspace W.

noncomputable def Cslib.Quantum.valueOracle {ι : Type u_1} {V : Type u_2} {W : Type u_3} {α : Type u_4} [Fintype ι] [Fintype V] [Fintype W] (step : α → EuclideanSpace ℂ V ≃ₗᵢ[ℂ] EuclideanSpace ℂ V) (x : ι → α) :

Value oracle: given per-symbol unitaries step : α → (ℂ^V ≃ₗᵢ[ℂ] ℂ^V) and an input x : ι → α, applies step (x i) to the value register controlled by the query index i.

@[simp]
theorem Cslib.Quantum.valueOracle_apply {ι : Type u_1} {V : Type u_2} {W : Type u_3} {α : Type u_4} [Fintype ι] [Fintype V] [Fintype W] (step : α → EuclideanSpace ℂ V ≃ₗᵢ[ℂ] EuclideanSpace ℂ V) (x : ι → α) (ψ : ValueState ι V W) (i : ι) (v : V) (w : W) :
((valueOracle step x) ψ).ofLp (i, v, w) = ((step (x i)) (WithLp.toLp 2 fun (v' : V) => ψ.ofLp (i, v', w))).ofLp v

Coordinate evaluation of valueOracle step x ψ at (i, v, w).

noncomputable def Cslib.Quantum.permStep {V : Type u_2} {α : Type u_4} [Fintype V] (π : α → Equiv.Perm V) (a : α) :

Unitary step arising from a family of permutations π : α → Equiv.Perm V, acting as |v⟩ ↦ |π a v⟩.

@[simp]
theorem Cslib.Quantum.permStep_apply {V : Type u_2} {α : Type u_4} [Fintype V] (π : α → Equiv.Perm V) (a : α) (φ : EuclideanSpace ℂ V) (v : V) :
((permStep π a) φ).ofLp v = φ.ofLp ((Equiv.symm (π a)) v)

Coordinate evaluation of permStep π a φ.

Unitary step for an additive group value register V: |v⟩ ↦ |v + a⟩. This covers modular addition on ZMod M as well as bitwise XOR on BitString m.

@[simp]
theorem Cslib.Quantum.addStep_apply {V : Type u_2} [Fintype V] [AddGroup V] (a : V) (φ : EuclideanSpace ℂ V) (v : V) :
((addStep a) φ).ofLp v = φ.ofLp (v - a)

Coordinate evaluation of addStep a φ.

@[simp]
theorem Cslib.Quantum.addStep_symm_apply {V : Type u_2} [Fintype V] [AddGroup V] (a : V) (φ : EuclideanSpace ℂ V) (v : V) :
((addStep a).symm φ).ofLp v = φ.ofLp (v + a)

Coordinate evaluation of (addStep a).symm φ.

theorem Cslib.Quantum.addStep_ket {V : Type u_2} [Fintype V] [DecidableEq V] [AddGroup V] (a v : V) :
(addStep a) (ket v) = ket (v + a)

Action of addStep a on computational-basis state ket v.

theorem Cslib.Quantum.addStep_rel_involutive {V : Type u_2} [Fintype V] [AddCommGroup V] (h2 : ∀ (v : V), v + v = 0) (a₀ a₁ : V) (φ : EuclideanSpace ℂ V) :
((addStep a₀).symm.trans (addStep a₁)) (((addStep a₀).symm.trans (addStep a₁)) φ) = φ

When every element of V has order dividing 2 (such as BitString m), the relative step (addStep a₀).symm.trans (addStep a₁) is an involution.

Diagonal phase unitary on a Bool response qubit: |b⟩ ↦ (-1)^{b && bit} |b⟩. Specializing valueOracle and runValue to phaseStep on State N W = ValueState (Fin N) Bool W recovers Cslib.Quantum.phaseOracle and Cslib.Quantum.run.

@[simp]
theorem Cslib.Quantum.phaseStep_apply (bit : Bool) (φ : EuclideanSpace ℂ Bool) (b : Bool) :
((phaseStep bit) φ).ofLp b = (if (b && bit) = true then -1 else 1) * φ.ofLp b

Coordinate evaluation of phaseStep bit φ.

noncomputable def Cslib.Quantum.runValue {ι : Type u_1} {V : Type u_2} {W : Type u_3} {α : Type u_4} [Fintype ι] [Fintype V] [Fintype W] (step : α → EuclideanSpace ℂ V ≃ₗᵢ[ℂ] EuclideanSpace ℂ V) (U : ℕ → ValueState ι V W →ₗᵢ[ℂ] ValueState ι V W) (ψ₀ : ValueState ι V W) (x : ι → α) :
ℕ → ValueState ι V W

The state after t queries of a value-query algorithm U starting from ψ₀ on input x : ι → α.

theorem Cslib.Quantum.norm_runValue {ι : Type u_1} {V : Type u_2} {W : Type u_3} {α : Type u_4} [Fintype ι] [Fintype V] [Fintype W] (step : α → EuclideanSpace ℂ V ≃ₗᵢ[ℂ] EuclideanSpace ℂ V) (U : ℕ → ValueState ι V W →ₗᵢ[ℂ] ValueState ι V W) (ψ₀ : ValueState ι V W) (x : ι → α) (t : ℕ) :
‖runValue step U ψ₀ x t‖ = ‖ψ₀‖

Value-query algorithms preserve norms.

@[simp]
theorem Cslib.Quantum.valueOracle_phaseStep {W : Type u_3} [Fintype W] {N : ℕ} (x : Fin N → Bool) (ψ : State N W) :

On State N W = ValueState (Fin N) Bool W, valueOracle phaseStep agrees with the controlled phase oracle phaseOracle.

@[simp]
theorem Cslib.Quantum.runValue_phaseStep {W : Type u_3} [Fintype W] {N : ℕ} (U : ℕ → State N W →ₗᵢ[ℂ] State N W) (ψ₀ : State N W) (x : Fin N → Bool) (t : ℕ) :
runValue phaseStep U ψ₀ x t = run U ψ₀ x t

On State N W = ValueState (Fin N) Bool W, runValue phaseStep agrees with the phase-query execution run.

Simulating two-valued restrictions in the Boolean phase-oracle model #

def Cslib.Quantum.embedOutcome {ι : Type u_1} {V : Type u_2} {W : Type u_3} {N : ℕ} (e : ι ≃ Fin N) :
ι × V × W ↪ Fin N × Bool × V × W

The injective embedding of value-query computational basis outcomes ι × V × W into the ctrl = false sector of Fin N × Bool × V × W along e : ι ≃ Fin N.

@[simp]
theorem Cslib.Quantum.embedOutcome_apply {ι : Type u_1} {V : Type u_2} {W : Type u_3} {N : ℕ} (e : ι ≃ Fin N) (i : ι) (v : V) (w : W) :
(embedOutcome e) (i, v, w) = (e i, false, v, w)

Application formula for embedOutcome.

1-query simulation for involutive relative step #

theorem Cslib.Quantum.exists_sim_involution {ι : Type u_1} {V : Type u_2} {W : Type u_3} [Fintype ι] [Fintype V] [Fintype W] {N : ℕ} {α : Type u_4} (e : ι ≃ Fin N) (step : α → EuclideanSpace ℂ V ≃ₗᵢ[ℂ] EuclideanSpace ℂ V) (a₀ a₁ : α) (hR : ∀ (φ : EuclideanSpace ℂ V), ((step a₀).symm.trans (step a₁)) (((step a₀).symm.trans (step a₁)) φ) = φ) (U : ℕ → ValueState ι V W →ₗᵢ[ℂ] ValueState ι V W) (ψ₀ : ValueState ι V W) (T : ℕ) :
∃ (Vsim : ℕ → State N (V × W) →ₗᵢ[ℂ] State N (V × W)) (φ₀ : State N (V × W)), ‖φ₀‖ = ‖ψ₀‖ ∧ ∀ (b : Fin N → Bool) (S : Finset (ι × V × W)), measureProb (run Vsim φ₀ b T) (Finset.map (embedOutcome e) S) = measureProb (runValue step U ψ₀ (fun (i : ι) => if b (e i) = true then a₁ else a₀) T) S

1-query simulation of an involutive two-valued oracle restriction: if (step a₀).symm.trans (step a₁) is an involution, any T-query value-query algorithm restricted to {a₀, a₁} along e : ι ≃ Fin N can be simulated by T binary phase-oracle queries.

2-query simulation for arbitrary unitary relative step #

theorem Cslib.Quantum.exists_sim_value {ι : Type u_1} {V : Type u_2} {W : Type u_3} [Fintype ι] [Fintype V] [Fintype W] {N : ℕ} {α : Type u_4} (e : ι ≃ Fin N) (step : α → EuclideanSpace ℂ V ≃ₗᵢ[ℂ] EuclideanSpace ℂ V) (a₀ a₁ : α) (U : ℕ → ValueState ι V W →ₗᵢ[ℂ] ValueState ι V W) (ψ₀ : ValueState ι V W) (T : ℕ) :
∃ (Vsim : ℕ → State N (V × W) →ₗᵢ[ℂ] State N (V × W)) (φ₀ : State N (V × W)), ‖φ₀‖ = ‖ψ₀‖ ∧ ∀ (b : Fin N → Bool) (S : Finset (ι × V × W)), measureProb (run Vsim φ₀ b (2 * T)) (Finset.map (embedOutcome e) S) = measureProb (runValue step U ψ₀ (fun (i : ι) => if b (e i) = true then a₁ else a₀) T) S

2-query simulation of an arbitrary two-valued oracle restriction: any T-query value-query algorithm restricted to {a₀, a₁} along e : ι ≃ Fin N can be simulated by 2 * T binary phase-oracle queries.

theorem Cslib.Quantum.exists_sim_index_to_value {ι : Type u_1} {V : Type u_2} {W : Type u_3} {α : Type u_4} [Fintype ι] [Fintype V] [Fintype W] [Nonempty ι] (step : α → EuclideanSpace ℂ V ≃ₗᵢ[ℂ] EuclideanSpace ℂ V) (v₀ : V) (read : V → α) (U : ℕ → ValueState ι V W →ₗᵢ[ℂ] ValueState ι V W) (ψ₀ : ValueState ι V W) (T : ℕ) (idx : ι × V × W → ι) :
∃ (U' : ℕ → ValueState ι V (Bool × V × W × ι) →ₗᵢ[ℂ] ValueState ι V (Bool × V × W × ι)) (ψ₀' : ValueState ι V (Bool × V × W × ι)) (out' : ι × V × Bool × V × W × ι → α), ‖ψ₀'‖ = ‖ψ₀‖ ∧ ∀ (X : ι → α), (∀ (i : ι), measureProb ((step (X i)) (ket v₀)) {v : V | read v = X i} = 1) → ∀ (Pred : α → Prop) [inst : DecidablePred Pred], measureProb (runValue step U' ψ₀' X (T + 1)) {q : ι × V × Bool × V × W × ι | Pred (out' q)} = measureProb (runValue step U ψ₀ X T) {p : ι × V × W | Pred (X (idx p))}

Index-to-value (T + 1)-query simulation: given a T-query value-query algorithm (U, ψ₀) returning a query index idx : ι × V × W → ι, a basis state ket v₀ and readout read : V → α such that querying step (X i) prepares read v = X i with probability 1 turn it into a (T + 1)-query value-returning algorithm with the exact same outcome distribution.

theorem Cslib.Quantum.exists_sim_index_to_value_perm {ι : Type u_1} {V : Type u_2} {W : Type u_3} {α : Type u_4} [Fintype ι] [Fintype V] [Fintype W] [Nonempty ι] (π : α → Equiv.Perm V) (v₀ : V) (a₀ a₁ : α) (hne : (π a₀) v₀ ≠ (π a₁) v₀) (U : ℕ → ValueState ι V W →ₗᵢ[ℂ] ValueState ι V W) (ψ₀ : ValueState ι V W) (T : ℕ) (idx : ι × V × W → ι) :
∃ (U' : ℕ → ValueState ι V (Bool × V × W × ι) →ₗᵢ[ℂ] ValueState ι V (Bool × V × W × ι)) (ψ₀' : ValueState ι V (Bool × V × W × ι)) (out' : ι × V × Bool × V × W × ι → α), ‖ψ₀'‖ = ‖ψ₀‖ ∧ ∀ (X : ι → α), (∀ (i : ι), X i = a₀ ∨ X i = a₁) → ∀ (Pred : α → Prop) [inst : DecidablePred Pred], measureProb (runValue (permStep π) U' ψ₀' X (T + 1)) {q : ι × V × Bool × V × W × ι | Pred (out' q)} = measureProb (runValue (permStep π) U ψ₀ X T) {p : ι × V × W | Pred (X (idx p))}

Index-to-value (T + 1)-query simulation specialized to a permutation oracle permStep π on two values a₀, a₁ distinguished at v₀ : V.