The real encoding of quantum circuits #
A complex amplitude a + ib can be stored in two real amplitudes on one extra qubit. The real
encoding of an m-qubit state ψ is the (m + 1)-qubit state whose amplitude on |x 0⟩ is
Re ψ_x and on |x 1⟩ is Im ψ_x (Cslib.Quantum.realEncode); the last qubit says which part is
stored. A matrix entry a acts on such pairs as the real block [[Re a, -Im a], [Im a, Re a]]
(Cslib.Quantum.realEntry), so a matrix whose entries are these blocks acts on encoded states as
the original matrix does on states (Cslib.Quantum.mulVec_realEncode). Aharonov attributes the
encoding to Bernstein and Vazirani Bernstein, Vazirani; the blocks are
the real version Ũ of a gate U in Definition 1 of Aharonov, with the encoding
qubit last.
A circuit C' on m + 1 qubits simulates a circuit C on m qubits through the encoding when
it maps the encoding of every state to the encoding of its image under C
(Cslib.Quantum.Circuit.RealSimulates). Simulation is preserved by running circuits in sequence,
and a circuit started in |x 0⟩ then ends in the encoding of the final state of the simulated
circuit started in |x⟩ (Cslib.Quantum.Circuit.RealSimulates.run_snoc_false). The encoding
preserves the probability of every measurement of the first m qubits, since
(Re a)² + (Im a)² = |a|² (Cslib.Quantum.measureProb_realEncode).
A gate with real entries simulates itself: placed on the same qubits of the larger register, away
from the encoding qubit (Cslib.Quantum.PlacedGate.mapWires along Fin.castSuccEmb), it acts on
the real and the imaginary parts separately
(Cslib.Quantum.PlacedGate.realSimulates_mapWires_castSuccEmb). The Hadamard, NOT, CNOT and
Toffoli gates are real, and CslibFrontier/Computability/Circuit/Quantum/PhaseCode.lean simulates
the
controlled phase gates by four of them.
Main definitions #
Cslib.Quantum.realEncode: the real encoding of a state, on one more qubit.Cslib.Quantum.realEntry: the real block of a complex matrix entry.Cslib.Quantum.Circuit.RealSimulates: simulation of a circuit through the real encoding.
Main results #
Cslib.Quantum.realEncode_ket: the encoding of|x⟩is|x 0⟩.Cslib.Quantum.measureProb_realEncode: the encoding preserves the measurement probabilities of the firstmqubits.Cslib.Quantum.mulVec_realEncode: a matrix of real blocks acts on encoded states as the original matrix does on states.Cslib.Quantum.Circuit.realSimulates_of_matrix: a circuit whose unitary consists of the real blocks of another's simulates it.Cslib.Quantum.Circuit.RealSimulates.append,Cslib.Quantum.Circuit.RealSimulates.run_snoc_false: simulation of sequences, and of runs from basis states.Cslib.Quantum.PlacedGate.realSimulates_mapWires_castSuccEmb: a gate with real entries simulates itself.
References #
- D. Aharonov, A simple proof that Toffoli and Hadamard are quantum universal, arXiv:quant-ph/0301040v1, Definition 1
- E. Bernstein, U. Vazirani, Quantum complexity theory
The real encoding of states #
The real encoding of matrices #
A matrix of real blocks acts on encoded states as the original matrix acts on states.
Simulation of circuits #
A circuit whose unitary consists of the real blocks of another's simulates it.
Simulation of sequences: running two simulating circuits in sequence simulates running the simulated circuits in sequence.
Simulation of runs: a simulating circuit started in |x 0⟩ ends in the encoding of the
final state of the simulated circuit started in |x⟩.
Gates with real entries #
The entries of a gate placed on the first m of m + 1 qubits: it leaves the last qubit
alone.
A gate with real entries simulates itself through the real encoding, placed on the same qubits away from the encoding qubit.