Semantic circuit normalization #
Merging gates that compute the same function preserves wire values and does not increase circuit size. A gate duplicating an earlier wire, or read by neither a gate nor the output, can be removed to obtain a strictly smaller single-output circuit.
Distinct gates compute distinct scalar functions. Gates may still duplicate input functions or be unused by the outputs.
Equations
- p.Irredundant i = Function.Injective (p.gateFunction i)
Instances For
A circuit is irredundant when its internal gates compute pairwise distinct functions.
Equations
- c.Irredundant i = c.program.Irredundant i
Instances For
A program can be rebuilt with distinct gate functions, preserving every wire's value.
Every circuit has an equivalent circuit with distinct gate functions and no more gates.
A gate duplicating an earlier wire can be removed without changing the output.
A gate read by no gate or designated output can be omitted. The given input supplies a zero-cost placeholder during reconstruction.