Documentation

CslibFrontier.Computability.Circuit.Quantum.Oracle.RandomOracle

Finite random oracles for native quantum executions #

Quantum.RandomOracle.sample draws one complete finite Boolean table outside an experiment. Quantum.RandomOracle.runWith specializes this operation to an existing native quantum controller: the coherent device handler and the classical service factory receive the same table for the complete adaptive run.

The coherent operation is the existing XOR oracle unitary |x, y⟩ ↦ |x, y + H(x)⟩. These definitions only package finite eager-table semantics around that operation. Drawing the table is not asserted to be efficient and is not charged to the native controller. The controller's elementary-gate, coherent-query, measurement and classical-service costs remain the separate existing resources.

This module does not establish a lazy/coherent equivalence, an unbounded or variable-length random oracle, reprogramming, extraction, one-way-to-hiding, query depth, gate approximation, equivalence with arbitrary QPPT adversaries or a protocol security theorem.

Main definitions #

Main results #

References #

noncomputable def Cslib.Quantum.RandomOracle.sample {a b : ℕ} {α : Type} (experiment : ((Fin a → Bool) → Fin b → Bool) → PMF α) :
PMF α

Draw one complete table before running the supplied finite experiment. Every use made by experiment therefore sees the same table. This is ideal semantics, not an efficient sampler.

theorem Cslib.Quantum.RandomOracle.sample_eq {a b : ℕ} {α : Type} (experiment : ((Fin a → Bool) → Fin b → Bool) → PMF α) :
sample experiment = (Probability.PMF.uniformOfFintype ((Fin a → Bool) → Fin b → Bool)).bind experiment

The finite sampler is exactly one outer uniform-table bind.

@[simp]
theorem Cslib.Quantum.RandomOracle.sample_const {a b : ℕ} {α : Type} (p : PMF α) :
(sample fun (x : (Fin a → Bool) → Fin b → Bool) => p) = p

Sampling is observationally irrelevant when an experiment never inspects the table.

noncomputable def Cslib.Quantum.RandomOracle.runWith {a b m r : ℕ} {κ State Operation α : Type} [Fintype κ] [DecidableEq κ] (service : ((Fin a → Bool) → Fin b → Bool) → Operation × List Bool → StateT State PMF (Fin r → Bool)) (program : ProbOracleComp (fun (x : (DeviceOperation ⊕ Operation) × List Bool) => List Bool) α) (initial : DeviceState m κ State) :
PMF (α × DeviceState m κ State)

Sample one finite oracle, then execute the existing native controller. The service factory receives the same H as deviceWordHandler, so coherent and classical calls cannot redraw it inside this wrapper.

theorem Cslib.Quantum.RandomOracle.runWith_eq {a b m r : ℕ} {κ State Operation α : Type} [Fintype κ] [DecidableEq κ] (service : ((Fin a → Bool) → Fin b → Bool) → Operation × List Bool → StateT State PMF (Fin r → Bool)) (program : ProbOracleComp (fun (x : (DeviceOperation ⊕ Operation) × List Bool) => List Bool) α) (initial : DeviceState m κ State) :
runWith service program initial = (Probability.PMF.uniformOfFintype ((Fin a → Bool) → Fin b → Bool)).bind fun (H : (Fin a → Bool) → Fin b → Bool) => ProbOracleComp.runWith (deviceWordHandler H (service H)) program initial

The sampled controller is exactly an outer uniform table draw followed by the existing fixed-table execution. In particular, the service closure and every coherent query share H.