Length of encoded quantum circuits #
Gate codes use unary wire indices and framed lists. These are lengths in that encoding, not implementation bytes or the size of a circuit generator's program.
Main results #
Cslib.Quantum.length_encGateCode: the contribution of the target and controls.Cslib.Quantum.GateCode.WellFormed.length_encoding_le: a well-formed gate onmwires occupies at most6 * mbits.Cslib.Quantum.length_encGateCodes_le: a list ofGwell-formed gates occupies at mostG * (12 * m + 1)bits, including list framing.
These bounds are original consequences of the existing encoding definitions.
theorem Cslib.Quantum.length_encGateCode (hadamard : Bool) (target : ℕ) (controls : List ℕ) :
(encGateCode (hadamard, target, controls)).length = 4 + 2 * target + ((Turing.MultiTapeTM.encList Turing.MultiTapeTM.encUnary) controls).length
The exact encoded length: a framed flag, a framed unary target, and framed unary controls.
theorem Cslib.Quantum.GateCode.WellFormed.length_encoding_le {m : ℕ} {g : GateCode} (hg : WellFormed m g) :
A valid gate has at most two controls, and every wire index is below the register width.
theorem Cslib.Quantum.length_encGateCodes_le {m : ℕ} {gs : List GateCode} (hgs : ∀ g ∈ gs, GateCode.WellFormed m g) :
Encoded length of a valid circuit, counting the framing around every instruction.