Lean, informalized

Nielsen & Chuang · Chapter 2, Introduction to quantum mechanics · p. 64

Exercise 2.2 - The operator exchanging |0⟩|0\rangle and |1⟩|1\rangle has different matrices in two bases

The matrix of an operator depends on the basis.

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

Take a complex vector space of dimension two with basis vectors |0⟩|0\rangle and |1⟩|1\rangle, and let AA be the linear operator on it that exchanges the two basis vectors.✦ The exercise asks for the matrix of AA with respect to the basis |0⟩,|1⟩|0\rangle, |1\rangle, used for input and output alike, and then for a basis in which AA has a different matrix.

The Space and Two Bases

The library works on ℂ2\mathbb{C}^2. The computational basis 𝒞\mathcal{C} of ℂ2\mathbb{C}^2 is its standard basis, the two unit column vectors |0⟩=(10),|1⟩=(01).|0\rangle = \begin{pmatrix} 1 \\ 0 \end{pmatrix}, \qquad |1\rangle = \begin{pmatrix} 0 \\ 1 \end{pmatrix}.(1)✦

The basis ℬ±\mathcal{B}_\pm of ℂ2\mathbb{C}^2 consists of the sum and the difference of the computational basis vectors, in this order: ℬ±=(|0⟩+|1⟩,|0⟩−|1⟩).\mathcal{B}_\pm = \bigl( |0\rangle + |1\rangle,\; |0\rangle - |1\rangle \bigr).(2)✦ Its vectors are not normalized.

The Operator and Its Matrix

The operator AA of the exercise is the linear operator on ℂ2\mathbb{C}^2 defined on the computational basis by A|0⟩=|1⟩,A|1⟩=|0⟩.A|0\rangle = |1\rangle, \qquad A|1\rangle = |0\rangle.(3)✦

The matrix [T]ℬ[T]_{\mathcal{B}} of a linear operator TT on ℂ2\mathbb{C}^2 with respect to a basis ℬ=(|b0⟩,|b1⟩)\mathcal{B} = (|b_0\rangle, |b_1\rangle), taken for both input and output, is the 2×22 \times 2 matrix whose entries satisfy T|bj⟩=∑i=01([T]ℬ)ij|bi⟩.T|b_j\rangle = \sum_{i=0}^{1} \bigl([T]_{\mathcal{B}}\bigr)_{ij} \, |b_i\rangle .(4)

The Claim

Theorem 1. Let AA be the linear operator on ℂ2\mathbb{C}^2 that exchanges |0⟩|0\rangle and |1⟩|1\rangle.✦ In the computational basis its matrix is [A]𝒞=(0110),[A]_{\mathcal{C}} = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix},(5)✦ in the basis ℬ±\mathcal{B}_\pm it is [A]ℬ±=(100−1),[A]_{\mathcal{B}_\pm} = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix},(6)✦ and the two matrices are different: [A]𝒞≠[A]ℬ±.[A]_{\mathcal{C}} \neq [A]_{\mathcal{B}_\pm}.(7)✦

What Is Checked

The claim is stated over the operator AA of (3) and over two bases of ℂ2\mathbb{C}^2, the computational basis (1) and the basis ℬ±\mathcal{B}_\pm of (2).

About these constructions the library proves that |0⟩+|1⟩|0\rangle + |1\rangle and |0⟩−|1⟩|0\rangle - |1\rangle are linearly independent.✦