Documentation

CslibFrontier.Computability.Circuit.Quantum.Approximation

Approximating the gates of a quantum circuit #

Replacing every gate of a circuit by a nearby gate moves the circuit's unitary by at most the sum of the distances, in the operator norm (Cslib.Quantum.Circuit.norm_matrix_sub_matrix_le): ‖U_m ⋯ U_1 - V_m ⋯ V_1‖ ≤ ∑ ‖U_i - V_i‖. The same holds when whole subcircuits are replaced (Cslib.Quantum.Circuit.norm_matrix_flatten_sub_matrix_flatten_le), which is how a circuit over one gate set is compiled into another. The final states move by at most the distance of the unitaries times the norm of the initial state (Cslib.Quantum.Circuit.norm_eval_sub_eval_le), and the probability of every set of measurement outcomes by at most the distance of the unitaries (Cslib.Quantum.Circuit.abs_measureProb_eval_sub_le), through Cslib.Quantum.abs_measureProb_sub_le_norm_sub. Gates ε-close to the original ones therefore change every measurement probability by at most m ε (Cslib.Quantum.Circuit.abs_measureProb_run_sub_le).

The norm on matrices is the operator norm on ℓ², the scoped instance Matrix.Norms.L2Operator of Mathlib; it makes matrices a C⋆-ring, in which unitaries have norm one. Statements mentioning ‖(U : Matrix _ _ ℂ)‖ refer to it and need open scoped Matrix.Norms.L2Operator.

Main results #

These are the standard error estimates of circuit approximation (the hybrid argument); no source locator is claimed. They are the bookkeeping step of the comparison of BQP with Arora and Barak's definition by arbitrary elementary gates (Arora, Barak).

References #

theorem Cslib.Quantum.norm_mul_sub_mul_le_of_mem_unitary {E : Type u_1} [NormedRing E] [StarRing E] [CStarRing E] {a b u v : E} (ha : a ∈ unitary E) (hv : v ∈ unitary E) :
‖a * u - b * v‖ ≤ ‖u - v‖ + ‖a - b‖

One step of the hybrid argument: in a C⋆-ring, ‖a u - b v‖ ≤ ‖u - v‖ + ‖a - b‖ when a and v are unitary, since a u - b v = a (u - v) + (a - b) v.

theorem Cslib.Quantum.Circuit.norm_matrix_append_sub_le {n : ℕ} (C C' D D' : Circuit n) :
‖↑(C ++ C').matrix - ↑(D ++ D').matrix‖ ≤ ‖↑C.matrix - ↑D.matrix‖ + ‖↑C'.matrix - ↑D'.matrix‖

Running C ++ C' instead of D ++ D' moves the unitary by at most the two distances.

Approximating a circuit gate by gate: for circuits of the same length, ‖U_m ⋯ U_1 - V_m ⋯ V_1‖ ≤ ∑ ‖U_i - V_i‖.

theorem Cslib.Quantum.Circuit.norm_matrix_flatten_sub_matrix_flatten_le {n : ℕ} (Cs Ds : List (Circuit n)) (h : Cs.length = Ds.length) :
‖↑(matrix Cs.flatten) - ↑(matrix Ds.flatten)‖ ≤ (List.zipWith (fun (C D : Circuit n) => ‖↑C.matrix - ↑D.matrix‖) Cs Ds).sum

Approximating a circuit block by block: replacing the subcircuits C_1, …, C_m by D_1, …, D_m moves the unitary by at most ∑ ‖U(C_i) - U(D_i)‖.

theorem Cslib.Quantum.Circuit.norm_matrix_sub_matrix_le_mul {n : ℕ} {C D : Circuit n} {ε : ℝ} (h : List.Forall₂ (fun (g g' : PlacedGate n) => ‖↑g.matrix - ↑g'.matrix‖ ≤ ε) C D) :
‖↑C.matrix - ↑D.matrix‖ ≤ ↑(List.length C) * ε

Uniformly close gates: if corresponding gates of two circuits of length m are ε-close, their unitaries are m ε-close.

Nearby unitaries give nearby final states: ‖C ψ - D ψ‖ ≤ ‖U(C) - U(D)‖ ‖ψ‖.

theorem Cslib.Quantum.Circuit.abs_measureProb_eval_sub_le {n : ℕ} (C D : Circuit n) {ψ : Qubits n} (hψ : ‖ψ‖ = 1) (S : Finset (Fin n → Bool)) :

Nearby unitaries give nearby measurement probabilities: started in a unit state, two circuits give every set of outcomes probabilities differing by at most ‖U(C) - U(D)‖.

theorem Cslib.Quantum.Circuit.abs_measureProb_run_sub_le {n : ℕ} {C D : Circuit n} {ε : ℝ} (h : List.Forall₂ (fun (g g' : PlacedGate n) => ‖↑g.matrix - ↑g'.matrix‖ ≤ ε) C D) (x : Fin n → Bool) (S : Finset (Fin n → Bool)) :
|measureProb (C.run x) S - measureProb (D.run x) S| ≤ ↑(List.length C) * ε

Measuring circuits with ε-close gates: if corresponding gates of two circuits of length m are ε-close, then from every basis state they give every set of outcomes probabilities differing by at most m ε.