Lean, informalized

Nielsen & Chuang · Chapter 10, Quantum error-correction · p. 450

Exercise 10.25 - A sum of signs over a binary linear code equals its size on the dual code and vanishes off it

Summing signs over a code detects its dual.

Hover over a blue or green term in the text, or a node in the graph, to find it in the other. Select it to read its declaration both in Lean and in words.

The Exercise

A linear code CC of length nn over a field KK is a subspace of KnK^n, the space of words of nn letters from KK; its elements are the codewords, and |C||C| is their number. The exercise concerns binary codes, K=ℤ2K = \mathbb{Z}_2, whose words are strings of nn bits added position by position modulo 2.

Fix a word xx and give each codeword yy of a binary code the sign (−1)x⋅y(-1)^{x \cdot y}, where x⋅y=∑i=1nxiyix \cdot y = \sum_{i=1}^{n} x_i y_i(1) is the dot product, computed here modulo 2. The exercise asks for the sum of these signs over the whole code. Up to normalisation, that sum is the amplitude of |x⟩|x\rangle when nn Hadamard gates, H⊗nH^{\otimes n}, act on the equal superposition ∑y∈C|y⟩\sum_{y \in C} |y\rangle of the codewords.

The Dual Code

The dual code C⟂C^\perp of a linear code CC of length nn over KK is the linear code of all words orthogonal to every codeword of CC, with the dot product (1) computed in KK: C⟂={x∈Kn:x⋅y=0for ally∈C}.C^\perp = \{\, x \in K^n : x \cdot y = 0 \ \text{for all}\ y \in C \,\}.(2)✦

The Claim

Theorem 1. Let CC be a binary linear code of length nn and xx a word of nn bits. Then ∑y∈C(−1)x⋅y={|C|,x∈C⟂,0,x∉C⟂.\sum_{y \in C} (-1)^{x \cdot y} = \begin{cases} |C|, & x \in C^\perp, \\ 0, & x \notin C^\perp. \end{cases}(3)✦

What Is Checked