Documentation

CslibFrontier.Computability.Circuit.Quantum.Oracle.Uniform

Native uniform quantum oracle circuits with explicit inputs #

encOracleGateCode uses the existing option encoding: a query is the empty word, and an elementary instruction is true followed by its phase-gate encoding. The latter retains the phase flag, Hadamard/inverse flag, unary target and list of unary controls. Lists of instructions use the usual framed list encoding, so even a query contributes to the encoded program length.

A native polynomial-time generator receives the unary security parameter and classical input length separately. It returns every register size and instruction. Its exact encoded output length is the generated-description cost and also bounds active qubits and instruction count; restricting auxiliary lengths by any polynomial bound yields a computable polynomial resource schedule. No resource bound is assumed as a field of the family.

Execution places a supplied quantum state after the encoded classical input, initializes the other wires to zero, and uses one fixed coherent oracle throughout. Terminal measurement returns the declared output prefix. Supplied states need not be efficiently preparable. Oracle.Density extends this execution to mixed states and inaccessible entangled references. Interactive classical oracles, consistent random-oracle sampling across widths, and a gate-approximation theorem are separate obligations. The definitions and results are original infrastructure, not a QROM security claim.

Main definitions #

Main results #

A query is encoded as the empty word; a gate is true followed by its phase-gate code, including unary target/control indices. Instruction lists use encList encOracleGateCode.

Construct an elementary oracle instruction from a natively computed phase-gate code.

Inputs to the uniform circuit generator. The security parameter and classical input length are separate: distinct pairs with the same sum may generate different circuits.

  • securityParameter : ℕ

    The security parameter, supplied in unary to the generator.

  • classicalInputLength : ℕ

    Length of the classical auxiliary input, also supplied in unary.

theorem Cslib.Quantum.encOracleInputSize_mk_deg :
Turing.MultiTapeTM.ComputableInDegree (fun (p : ℕ × ℕ) => { securityParameter := p.1, classicalInputLength := p.2 }) encOracleInputSizeFields encOracleInputSize 1 1

Generator input encoding: the framed unary security parameter followed by the unary classical input length.

@[reducible, inline]

The tuple of the fields of encOracleInputSize.

theorem Cslib.Quantum.encOracleInputSize_securityParameter_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → OracleInputSize} :
theorem Cslib.Quantum.encOracleInputSize_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget x0 x1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encUnary budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encUnary budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { securityParameter := x0 x, classicalInputLength := x1 x }) encIn encOracleInputSize budget
theorem Cslib.Quantum.encOracleInputSize_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 x1 T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encUnary T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encUnary T1 S1) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { securityParameter := x0 x, classicalInputLength := x1 x }) encIn encOracleInputSize (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x

A finite oracle-circuit description, including the input, output and query register sizes. The quantum input follows the encoded classical input; output and query registers are prefixes.

  • width : ℕ

    Total number of active qubits.

  • queryWidth : ℕ

    Number of qubits in the oracle argument.

  • responseWidth : ℕ

    Number of qubits in the XOR response accumulator.

  • quantumInputWidth : ℕ

    Number of supplied quantum input qubits.

  • outputWidth : ℕ

    Number of prefix qubits returned by terminal measurement.

  • instructions : OracleCircuit

    Elementary gates and oracle calls, in execution order.

Description encoding: width, query width, response width, quantum-input width and output width, each in framed unary, followed by the framed list encoding of the instructions.

theorem Cslib.Quantum.encOracleCircuitDescription_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget x0 x1 x2 x3 x4 : γ → ℕ} {x5 : γ → List OracleGateCode} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encUnary budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encUnary budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Turing.MultiTapeTM.encUnary budget) (h3 : Turing.MultiTapeTM.ComputableInSpace x3 encIn Turing.MultiTapeTM.encUnary budget) (h4 : Turing.MultiTapeTM.ComputableInSpace x4 encIn Turing.MultiTapeTM.encUnary budget) (h5 : Turing.MultiTapeTM.ComputableInSpace x5 encIn (Turing.MultiTapeTM.encList encOracleGateCode) budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { width := x0 x, queryWidth := x1 x, responseWidth := x2 x, quantumInputWidth := x3 x, outputWidth := x4 x, instructions := x5 x }) encIn encOracleCircuitDescription budget
theorem Cslib.Quantum.encOracleCircuitDescription_mk_deg :
Turing.MultiTapeTM.ComputableInDegree (fun (p : ℕ × ℕ × ℕ × ℕ × ℕ × List OracleGateCode) => { width := p.1, queryWidth := p.2.1, responseWidth := p.2.2.1, quantumInputWidth := p.2.2.2.1, outputWidth := p.2.2.2.2.1, instructions := p.2.2.2.2.2 }) encOracleCircuitDescriptionFields encOracleCircuitDescription 1 1
theorem Cslib.Quantum.encOracleCircuitDescription_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 x1 T1 S1 x2 T2 S2 x3 T3 S3 x4 T4 S4 : γ → ℕ} {x5 : γ → List OracleGateCode} {T5 S5 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encUnary T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encUnary T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encUnary T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn Turing.MultiTapeTM.encUnary T3 S3) (h4 : Turing.MultiTapeTM.ComputableInO x4 encIn Turing.MultiTapeTM.encUnary T4 S4) (h5 : Turing.MultiTapeTM.ComputableInO x5 encIn (Turing.MultiTapeTM.encList encOracleGateCode) T5 S5) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { width := x0 x, queryWidth := x1 x, responseWidth := x2 x, quantumInputWidth := x3 x, outputWidth := x4 x, instructions := x5 x }) encIn encOracleCircuitDescription (fun (x : γ) => T0 x + (T1 x + (T2 x + (T3 x + (T4 x + T5 x))))) fun (x : γ) => S0 x + (S1 x + (S2 x + (S3 x + (S4 x + S5 x))))

The encoded description pays for all active qubits and every instruction, including a query whose own code is empty.

All declared registers fit and every instruction is valid. The classical input is encPair encUnary encBits (n, x), of length 2 * n + 1 + x.length.

A native polynomial-time generator of valid oracle circuits. Its polynomial bound is in the unary security parameter and classical input length. Quantum inputs are supplied states; this structure does not certify their preparation, gate universality or interactive QROM access.

Native generation bounds the exact encoded description length by one polynomial in the two input sizes. Register width and separate elementary/query counts are bounded by that length.

A polynomial bound on classical auxiliary lengths gives a native-computable polynomial schedule for the exact encoded description length of every shorter word. The length bound itself need not be computable.

Place a supplied quantum state after the encoded classical input (n, x), with zero ancillas elsewhere. This is an isometric embedding, not an efficient preparation of that state.

Initialization embeds an arbitrary supplied state after the encoded classical input.

Execute the generated circuit with the same fixed oracle throughout. The resulting map retains every active qubit; terminal measurement is specified separately by output.

Running the family uses the existing finite-circuit interpretation on its initialized state.

Running a generated family on a basis quantum input starts from the basis word formed by the encoded classical input followed by that quantum input.

Terminal computational-basis measurement of the generated output prefix, returned as a bit word. The supplied quantum input must be normalized.

theorem Cslib.Quantum.UniformOracleCircuitFamily.output_eq (F : UniformOracleCircuitFamily) (n : ℕ) (x : List Bool) (H : (Fin (F.description n x.length).queryWidth → Bool) → Fin (F.description n x.length).responseWidth → Bool) (ψ : Qubits (F.description n x.length).quantumInputWidth) (hψ : ‖ψ‖ = 1) :
F.output n x H ψ hψ = measureOut ((F.run n x H) ψ) ⋯ fun (y : Fin (F.description n x.length).width → Bool) => List.ofFn fun (i : Fin (F.description n x.length).outputWidth) => y ((Fin.castLEEmb ⋯) i)

The output law is exactly the existing computational-basis measurement and prefix readout.

On a basis quantum input, terminal output is the declared prefix measurement of the circuit started from the encoded classical word followed by that basis input.

Every supported output word has the declared output length.