A layer of Hadamard gates #
The gate codes hadamardCodes o p put one Hadamard gate on each of the qubits o, …, o + p - 1.
On a basis state whose qubits o, …, o + p - 1 are zero, the layer prepares the uniform
superposition of the 2^p strings on those qubits, each with amplitude 2^{-p/2}
(Cslib.Quantum.eval_hadamardCodes_ket). This is how a quantum circuit simulates p fair coins:
Hadamard gates on fresh qubits, followed by a classical circuit reading them
Watrous, Section IV.3.
Main definitions #
Cslib.Quantum.hadamardCodes: Hadamard gates on a block of qubits.
Main results #
Cslib.Quantum.eval_hadamardCodes_ket: the layer on zero qubits prepares the uniform superposition.Cslib.Quantum.wellFormed_hadamardCodes: every emitted gate is valid when the target block fits.Cslib.Quantum.computableInPolyTime_hadamardCodes: the codes are computable in polynomial time from the block in unary.
References #
Hadamard gate codes on the qubits o, …, o + p - 1.
A layer of Hadamard gates on zero qubits prepares the uniform superposition: on a basis
state |X⟩ whose qubits o, …, o + p - 1 are zero, it gives 2^{-p/2} ∑_r |X with r on them⟩.
A Hadamard layer whose target block fits in the register consists of well-formed gates.
The Hadamard codes on a block are computable in polynomial time from the block in unary.