Minimum-cost circuit realizations #
A realization chooses one implementation circuit for each source operation. This module minimizes those choices independently, turning pulled-back cost into the intrinsic implementation cost of each operation rather than the cost of an arbitrary selected gadget.
The scalar target associated with one interpreted operation.
Equations
- interpretation.operationTarget op input x✝ = interpretation op input
Instances For
Every operation circuit in a realization computes its source operation.
Functional completeness supplies a realization of every interpreted signature on the same carrier. The choice is classical, not executable.
Equations
- Algebraic.Realization.ofFunctionalCompleteness source target complete = { operation := fun (op : σ.Op) => Classical.choose ⋯, realizes := ⋯ }
Instances For
A realization whose selected implementation of every source operation is minimum for the target cost model.
- optimal (op : σ.Op) : Circuit.CostMinimal operationCost (self.operation op) target (source.operationTarget op)
Each selected operation circuit has minimum target cost.
Instances For
Replace every selected operation gadget by a minimum-cost implementation.
Ties are broken by internal gate count through Circuit.minimum.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The intrinsic implementation cost obtained by minimizing the realization's gadgets. Its value is independent of the initial realization.
Equations
- realization.minimumCost operationCost = (realization.minimize operationCost).pullCost operationCost
Instances For
An optimal realization charges no more for an operation than any other realization of the same interpreted signatures.
Any two optimal realizations induce exactly the same source cost model.
Intrinsic operation cost is bounded by the cost pulled back through any chosen realization.
Intrinsic minimum cost does not depend on the initial realization used to establish implementability.
Minimizing an already optimal realization recovers the same intrinsic cost model.