Circuit translations between signatures #
A translation implements every source operation by a target circuit of the same arity. Compiling a source circuit substitutes these implementation circuits gate by gate. Evaluation and arbitrary weighted gate costs are preserved exactly.
Pull a target interpretation back through a circuit translation.
Equations
Instances For
Charge a source operation exactly the target cost of its implementation.
Instances For
Pulling interpretations through a translation also pulls ordinary homomorphisms between them.
Equations
- translation.pullHomomorphism homomorphism = { map := homomorphism.map, homomorphic := ⋯ }
Instances For
The compiled target program and the image of every source wire.
- gateCount : ℕ
Number of target gates in the compiled program.
Compiled target program.
- wires : Wire.Renaming n g self.gateCount
Image of every source gate wire in the compiled program.
Instances For
Compile a program by replacing each source gate by its implementation circuit.
Equations
- One or more equations did not get rendered due to their size.
- translation.compileProgram Cslib.Circuits.Program.empty = { gateCount := 0, program := Cslib.Circuits.Program.empty, wires := Cslib.Circuits.Wire.Renaming.id }
Instances For
Number of target gates produced when compiling a source circuit.
Equations
- translation.compiledGateCount circuit = (translation.compileProgram circuit.program).gateCount
Instances For
Compile a circuit through a signature translation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A compiled circuit has the compiled gate count.
Program compilation preserves the value of every source wire.
Compiling a circuit preserves evaluation exactly.
Program compilation preserves pulled-back weighted cost exactly.
Circuit compilation preserves pulled-back weighted cost exactly.
If every source operation implementation costs at most K, compilation
costs at most K times the source gate count.
The compiled gate count is exactly source cost when each source operation is charged by the size of its implementation.
If every implementation uses at most K gates, compilation increases
size by at most a factor of K.
The identity translation implements each operation with one gate.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Compilation through the identity translation preserves semantics.
Compose translations by compiling every operation implementation of the first translation through the second.
Instances For
Interpretations pull back contravariantly through composition.
Weighted costs pull back contravariantly through composition.
Compiling through a composite or in two stages has the same semantics.
Compiling through a composite or in two stages has the same weighted cost.
A translation whose operation circuits realize a specified source interpretation in a specified target interpretation.
Pulling back the target interpretation gives the source interpretation.
Instances For
The identity translation realizes every interpretation in itself.
Equations
- Algebraic.Realization.id interpretation = { toTranslation := Algebraic.Translation.id σ, realizes := ⋯ }
Instances For
Compose realizations over a common carrier.
Instances For
Every selected operation circuit has the promised source semantics.
Compile a circuit through a realization.
Instances For
Pull a weighted target cost back through a realization.
Instances For
Compilation through a realization preserves the specified semantics.
Compilation through a realization preserves pulled-back cost exactly.
Transport an arbitrary target-basis cost lower bound back through a realization.