Documentation

CslibFrontier.Foundations.Quantum.PauliTwirl

Pauli strings and the Pauli twirl #

On n qubits, with computational basis the bit strings ι → Bool, the bit flip X^a |z⟩ = |z + a⟩ (Cslib.Quantum.pauliXPow) and the phase flip Z^b |z⟩ = (-1)^{b · z} |z⟩ (Cslib.Quantum.pauliZPow) are the tensor products of the single-qubit Pauli matrices X and Z on the qubits where a, respectively b, is one. Their product X^a Z^b (Cslib.Quantum.pauliString) runs over the 4ⁿ Pauli strings up to phases.

The Pauli twirl, averaging P ρ Pᴴ over the 4ⁿ strings P = X^a Z^b, is the completely depolarizing map: ∑_{a, b} X^a Z^b ρ (X^a Z^b)ᴴ = 2ⁿ tr ρ • 1 (Cslib.Quantum.sum_pauliTwirl). Summing over b first kills the off-diagonal entries, by orthogonality of the characters b ↦ (-1)^{b · z} (Cslib.BitString.sum_signVal_dotProduct_mul_signVal_dotProduct), and summing over a then averages the diagonal. With a reference system the twirl gives 2ⁿ 1 ⊗ Tr_A ρ (Cslib.Quantum.sum_pauliTwirl_kronecker_one), so it also erases every correlation with the reference. For one qubit this is de Wolf, Chapter 18, Exercise 5(a); it is the heart of the quantum one-time pad (CslibFrontier.Crypto.Protocols.Quantum.OneTimePad).

Main definitions #

Main results #

References #

Pauli strings #

def Cslib.Quantum.pauliXPow {ι : Type u_1} [Fintype ι] (a : ι → Bool) :
Matrix (ι → Bool) (ι → Bool) ℂ

The bit flip X^a |z⟩ = |z + a⟩, the tensor product of X on the qubits where a is one.

noncomputable def Cslib.Quantum.pauliZPow {ι : Type u_1} [Fintype ι] (b : ι → Bool) :
Matrix (ι → Bool) (ι → Bool) ℂ

The phase flip Z^b |z⟩ = (-1)^{b · z} |z⟩, the tensor product of Z on the qubits where b is one.

noncomputable def Cslib.Quantum.pauliString {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a b : ι → Bool) :
Matrix (ι → Bool) (ι → Bool) ℂ

The Pauli string X^a Z^b.

theorem Cslib.Quantum.pauliXPow_apply {ι : Type u_1} [Fintype ι] (a y z : ι → Bool) :
pauliXPow a y z = if z = y + a then 1 else 0
theorem Cslib.Quantum.pauliZPow_apply {ι : Type u_1} [Fintype ι] (b y z : ι → Bool) :
pauliZPow b y z = if y = z then ↑(BitString.signVal (b ⬝ᵥ z)) else 0
theorem Cslib.Quantum.pauliString_apply {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a b y z : ι → Bool) :
pauliString a b y z = if z = y + a then ↑(BitString.signVal (b ⬝ᵥ z)) else 0
theorem Cslib.Quantum.conjTranspose_pauliString_apply {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a b y z : ι → Bool) :
theorem Cslib.Quantum.pauliXPow_mul {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a a' : ι → Bool) :
theorem Cslib.Quantum.pauliZPow_mul {ι : Type u_1} [Fintype ι] [DecidableEq ι] (b b' : ι → Bool) :
theorem Cslib.Quantum.pauliXPow_mul_self {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a : ι → Bool) :
theorem Cslib.Quantum.pauliZPow_mul_self {ι : Type u_1} [Fintype ι] [DecidableEq ι] (b : ι → Bool) :

Pauli strings are unitary.

The Pauli twirl #

theorem Cslib.Quantum.pauliString_mul_mul_conjTranspose_apply {ι : Type u_1} [Fintype ι] [DecidableEq ι] (a b : ι → Bool) (ρ : Matrix (ι → Bool) (ι → Bool) ℂ) (y y' : ι → Bool) :
(pauliString a b * ρ * (pauliString a b).conjTranspose) y y' = ↑(BitString.signVal (b ⬝ᵥ (y + a))) * ρ (y + a) (y' + a) * ↑(BitString.signVal (b ⬝ᵥ (y' + a)))

The entries of X^a Z^b ρ (X^a Z^b)ᴴ.

theorem Cslib.Quantum.sum_pauliTwirl {ι : Type u_1} [Fintype ι] [DecidableEq ι] (ρ : Matrix (ι → Bool) (ι → Bool) ℂ) :
∑ a : ι → Bool, ∑ b : ι → Bool, pauliString a b * ρ * (pauliString a b).conjTranspose = (2 ^ Fintype.card ι * ρ.trace) • 1

The Pauli twirl is completely depolarizing: ∑_{a, b} X^a Z^b ρ (X^a Z^b)ᴴ = 2ⁿ tr ρ • 1 on n = |ι| qubits.

theorem Cslib.Quantum.sum_pauliTwirl_kronecker_one {ι : Type u_1} {κ : Type u_2} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] (ρ : Matrix ((ι → Bool) × κ) ((ι → Bool) × κ) ℂ) :
∑ a : ι → Bool, ∑ b : ι → Bool, Matrix.kroneckerMap (fun (x1 x2 : ℂ) => x1 * x2) (pauliString a b) 1 * ρ * (Matrix.kroneckerMap (fun (x1 x2 : ℂ) => x1 * x2) (pauliString a b) 1).conjTranspose = 2 ^ Fintype.card ι • Matrix.kroneckerMap (fun (x1 x2 : ℂ) => x1 * x2) 1 (partialTraceLeft ρ)

The Pauli twirl with a reference system: twirling the first system of ρ on ℂ^{(ι → Bool) × κ} gives 2ⁿ 1 ⊗ Tr_A ρ, a product state, so every correlation with the reference system is erased.