Documentation

CslibFrontier.Computability.Circuit.Quantum.Oracle.Controller.Request

Requests to a finite quantum device #

An existing word-oracle program controls a fixed quantum register through three channels: elementary gates, coherent oracle queries and single-wire measurements. Classical service channels are disjoint. DeviceRequest.codec uses the existing phase-code encoding and unary wire indices. It accepts exactly their canonical encodings. Malformed words receive the existing OracleCodec rejection answer [], with no state change. Encoded gates with invalid placements are separately rejected by the device's existing gate decoder.

This is an interface for the existing native oracle machine, not a new program language or efficiency predicate. The partial inverse specifies decoding mathematically; no efficiency of a quantum-state simulation or of this partial inverse is asserted.

Main definitions #

Quantum channels of a native controller. Classical service channels use the other summand.

Instances For
    inductive Cslib.Quantum.DeviceRequest (m : ℕ) (Operation : Type) :

    Typed requests on a fixed m-qubit device, alongside classical service requests.

    • gate {m : ℕ} {Operation : Type} (code : PhaseGateCode) : DeviceRequest m Operation

      The existing elementary gate code, checked by its usual decoder.

    • query {m : ℕ} {Operation : Type} : DeviceRequest m Operation

      The coherent XOR query on the device's fixed argument and response registers.

    • measure {m : ℕ} {Operation : Type} (wire : Fin m) : DeviceRequest m Operation

      Read one existing active wire.

    • service {m : ℕ} {Operation : Type} (operation : Operation) (word : List Bool) : DeviceRequest m Operation

      Send a classical word to the service.

    def Cslib.Quantum.instDecidableEqDeviceRequest.decEq {m✝ : ℕ} {Operation✝ : Type} [DecidableEq Operation✝] (x✝ x✝¹ : DeviceRequest m✝ Operation✝) :
    Decidable (x✝ = x✝¹)
    @[instance_reducible]
    instance Cslib.Quantum.instDecidableEqDeviceRequest {m✝ : ℕ} {Operation✝ : Type} [DecidableEq Operation✝] :
    DecidableEq (DeviceRequest m✝ Operation✝)
    def Cslib.Quantum.DeviceRequest.encode {m : ℕ} {Operation : Type} :
    DeviceRequest m Operation → (DeviceOperation ⊕ Operation) × List Bool

    Gate payloads use encPhaseGateCode; query payloads are empty; measurement wires are unary. Service payloads retain their original word and channel.

    The request encoding is injective, including its operation tag.

    noncomputable def Cslib.Quantum.DeviceRequest.codec (m : ℕ) (Operation : Type) :
    OracleCodec (DeviceOperation ⊕ Operation) (DeviceRequest m Operation) fun (x : DeviceRequest m Operation) => List Bool

    The canonical typed view of the native word channels. Replies are words already: gates and queries return [], measurements return one bit, and the service supplies a fixed-width word.

    @[simp]
    theorem Cslib.Quantum.DeviceRequest.codec_encodeQuery {m : ℕ} {Operation : Type} (q : DeviceRequest m Operation) :
    (codec m Operation).encodeQuery q = q.encode

    The codec sends exactly the documented gate, query, unary-wire and service payloads.

    theorem Cslib.Quantum.DeviceRequest.codec_wordOracle_encode {m : ℕ} {Operation : Type} {M : Type → Type} [Monad M] (oracle : DeviceRequest m Operation → M (List Bool)) (q : DeviceRequest m Operation) :
    (codec m Operation).wordOracle oracle q.encode = id <$> oracle q

    Typed requests cross the word interface without changing their replies.

    One selected quantum operation costs one; all other operations cost zero.

    Classical service calls have their own cost, independent of the quantum operations.

    The four independent costs partition all requests, including rejected attempts.

    theorem Cslib.Quantum.DeviceRequest.operationCost_le_one {Operation : Type} (operation : DeviceOperation) (request : (DeviceOperation ⊕ Operation) × List Bool) :
    operationCost operation request ≤ 1

    Each selected operation count is bounded by the total number of requests.

    theorem Cslib.Quantum.DeviceRequest.serviceCost_le_one {Operation : Type} (request : (DeviceOperation ⊕ Operation) × List Bool) :
    serviceCost request ≤ 1

    Service calls are bounded by the total number of requests.