Circuits on parts of a larger register #
A circuit on m qubits runs on the qubits e : Fin m ↪ Fin N of a larger register
(Cslib.Quantum.Circuit.mapWires). Its entries are those of the small circuit on the qubits e,
provided the basis strings agree off e (Cslib.Quantum.Circuit.matrix_mapWires). Copies of one
circuit on pairwise disjoint sets of qubits act independently: an entry of the whole is the product
of the entries of the copies (Cslib.Quantum.Circuit.matrix_flatMap_mapWires). This is the tensor
product structure behind running independent copies of a quantum computation in parallel.
For gate codes, shifting every qubit number by o (Cslib.Quantum.GateCode.shift) places the
circuit on the block of qubits o, …, o + m - 1 (Cslib.Quantum.Circuit.ofCodes_map_shift).
Main definitions #
Cslib.Quantum.AgreeOff: two basis strings agree off the range of an embedding.Cslib.Quantum.glue: a basis string with part of it replaced.Cslib.Quantum.PlacedGate.mapWires,Cslib.Quantum.Circuit.mapWires: running on a part of a larger register.Cslib.Quantum.GateCode.shift,Cslib.Quantum.blockEmb: shifted gate codes and blocks of qubits.
Main results #
Cslib.Quantum.sum_agreeOff: summing over the basis strings that agree withxoffe.Cslib.Quantum.Circuit.matrix_mapWires: the entries of a circuit on part of a register.Cslib.Quantum.Circuit.matrix_flatMap_mapWires: copies on disjoint parts act independently.Cslib.Quantum.Circuit.ofCodes_map_shift: shifted gate codes denote a circuit on a block.Cslib.Quantum.GateCode.WellFormed.shift: shifted gate codes are well formed on a larger register.
Agreeing off part of a register #
Summing over the basis strings that agree with x off e is summing over their bits on
e.
Summing a function of the bits on e over the basis strings that agree with x off e.
Circuits on part of a register #
The placed gate g on the qubits e of a larger register.
The entries of a gate on part of a register are those of the gate on the qubits e, when
the basis strings agree off e.
Copies of a circuit on disjoint parts of a register act independently: an entry of the whole is the product of the entries of the copies, when the basis strings agree off all parts.
Shifted gate codes #
The gate code g with every qubit number increased by o.
A shifted well-formed gate code denotes the gate on the shifted block.
A well-formed gate code, shifted by o, is well formed on a register of at least o + m
qubits.
Shifted gate codes denote the circuit on a block: shifting a well-formed circuit's qubit
numbers by o runs it on the qubits o, …, o + m - 1.