Documentation

CslibFrontier.Computability.Circuit.Quantum.EncodingSize

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 #

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.

A valid gate has at most two controls, and every wire index is below the register width.

Encoded length of a valid circuit, counting the framing around every instruction.