Finite descriptions of quantum oracle circuits #
An OracleGateCode is an existing elementary PhaseGateCode or a coherent XOR query to a fixed
function on the first a + b wires. OracleCircuit.toCircuit interprets a list of these
instructions through the existing Circuit semantics. It skips malformed instructions, just
as Circuit.ofPhaseCodes does; OracleGateCode.WellFormed characterizes exactly the instructions
that are retained. A well-formed description therefore has exactly its stated number of gates.
Elementary gates and queries are counted separately. These counts describe the finite circuit; they do not certify polynomial-time uniform generation or bound the implementation cost of the oracle. The elementary basis includes Hadamard, NOT, CNOT, Toffoli, phase and controlled phase gates, with the phase inverses. The constructions and elementary identities below are original formalization infrastructure.
Main definitions #
Cslib.Quantum.OracleGateCode: elementary gates and coherent oracle-query instructions.Cslib.Quantum.OracleCircuit: finite instruction lists in execution order.Cslib.Quantum.OracleGateCode.WellFormed: validity at fixed register and query widths.Cslib.Quantum.OracleCircuit.toCircuit: interpretation as an existing quantum circuit.Cslib.Quantum.OracleCircuit.queryCount,Cslib.Quantum.OracleCircuit.gateCount: independent oracle and elementary-gate counts.
Main results #
Cslib.Quantum.OracleCircuit.toCircuit_append: interpretation respects sequencing.Cslib.Quantum.OracleCircuit.toCircuit_map_gate,.toCircuit_map_gateCode: oracle-free programs recoverCircuit.ofPhaseCodesandCircuit.ofCodes.Cslib.Quantum.OracleCircuit.length_toCircuit: well-formed instructions are all executed.Cslib.Quantum.OracleCircuit.gateCount_add_queryCount: the two costs partition the instructions.
A finite instruction: an elementary gate code, or a coherent query to the supplied oracle.
- gate (code : PhaseGateCode) : OracleGateCode
An existing elementary code, including phase gates and their inverses.
- query : OracleGateCode
XOR the oracle answer into the fixed response register.
A query is well formed when its argument and response registers fit in the full register. An elementary gate uses the existing gate-code validity condition.
Instances For
Interpret an instruction, returning none for malformed elementary gates or a query whose
two registers do not fit. The oracle is a single fixed function shared by all query instructions.
Exactly the well-formed instructions denote placed gates.
Whether this instruction is an oracle call, independent of its interpretation.
A finite quantum oracle-circuit description, in execution order.
Interpret finite codes as a circuit. Malformed instructions are skipped; impose
∀ g ∈ codes, g.WellFormed a b m to rule them out.
Number of oracle calls in the description.
Number of elementary gates in the description; oracle calls have a separate cost.
An oracle-free description has exactly the original coded-circuit interpretation.
Mapping ordinary gate codes to phase-free oracle instructions recovers their ordinary finite-circuit interpretation directly.
Every well-formed instruction is executed, so semantic gate count equals description length.
Oracle and elementary-gate costs exhaust the instruction list.
Oracle costs add under sequential composition.
Elementary-gate costs add under sequential composition.