**A.5.4 Trace of a matrix**

Another important matrix function is the *trace* of a matrix, tr(*A*), defined as the sum of the diagonal elements of *A* (which need not be a diagonal matrix),

The trace is easily seen to be cyclic, that is, tr(*AB*) = tr(*BA*), and linear, *i.e.,* tr(*A + B*) = tr(*A*) + tr(*B*), tr(*zA*) = *z* tr(*A*), where *A* and *B* are arbitrary matrices, and *z* is a complex number. It also follows from the cyclic property that the trace of a matrix is invariant under the unitary *similarity transformation*, *A→UA†* , since

We define the trace of an operator *A* to be the trace of *any* matrix representation of *A*. The invariance of the trace under unitary similarity transformations ensures that the trace of an operator is well defined. It also means that if we choose a unitary transformation that diagonalizes *A*, then tr(*?*) = *Σ _{? }λ_{i},i.e.,* the trace of

*A*is also the sum of its eigenvalues,

*λ*.

_{i}An extremely important formula (presented here without proof) for evaluating tr(*A**|Ψ〉〈Ψ|)* , where *|Ψ〉* is a unit vector and *A* is an arbitrary operator, is

This result is extremely useful in evaluating the trace of an operator. It also plays a crucial role in deciding the probability with which a quantum system will collapse to a particular state when that system is measured. If *A* is the identity operator, then *tr(|Ψ〉〈Ψ| = 〈Ψ|Ψ〉)*.

**A.5.5 Commutator and anti-commutator**

The commutator between two operators *A* and *B* is defined as

*[A, B] ≡ AB – BA.*

If *[A, B]* = 0, that is, *AB = BA*, then we say *A* commutes with *B*. Similarly, the anti-commutator of two operators is defined by

*{A, B} ≡ AB + BA*.

*A* is said to anti-commute with *B* if* {A, B} * = 0. It so happens that many important properties of pairs of operators can be deduced from their commutator and anti-commutator. One such is the *simultaneous diagonalization theorem*, which states that *if A and B are Hermitian operators, then [A, B] = 0 if and only if there exists an orthonormal basis such that both A and B are diagonal with respect to that basis.* Thus, *A* and *B* are simultaneously diagonalizable in this case. It turns out that non-zero commutators play an essential role in the famous Heisenberg’s uncertainty principle in quantum mechanics. Indeed, non-commuting operators lie at the heart of quantum mechanics.

**A.5.6 Tensor product**

The tensor product of *|v〉* and *|w〉*, represented by *|v〉⊗ |w〉* (alternatively, by *|v〉 |w〉 or |v , w〉* or * |vw〉*), produces a matrix. The tensor product puts vector spaces together to form larger vector spaces. This simple method is crucial for constructing the Hilbert space for multi-qubit systems. Let *A* be a *m×n* matrix, and *B* a *p×q* matrix. Then the way vector spaces are put together is as follows:

Here each element *A _{ij}B* represents a

*p×q*submatrix whose entries are the entries of

*B*multiplied by

*A*. The fully expanded matrix form of

_{ij}*A⊗B*is a larger

*mp×nq*matrix.

**Example 1.**

Finally, we have the useful notation* |v ^{⊗k}〉* , which stands for

*|v〉*tensored with itself

*k*times. For example,

By definition,

We shall shortly see that an analogous notation is used for operators (as they also have a matrix representation) on tensor product spaces.

By definition, the tensor product satisfies the following basic properties:

One may also show that

where the superscripts *, *T*, and †, respectively, denote complex conjugate, transpose, and Hermitian conjugate^{42} (or adjoint) operations on the entity they operate on.

Finally, we come to the nature of linear operators that act on the space *|V〉⊗|W〉.* By convention (and this is important), a matrix representation of a linear operator will imply that the representation is with respect to orthonormal input and output bases. Further, if the input and output spaces for a linear operator are the same, then the input and output bases are assumed to be the same, unless noted otherwise.

Suppose *|v〉* and *|w〉* are vectors in *V* and *W*, and *A* and *B* are linear operators on *V* and* W*, respectively. Then we define a linear operator* A⊗B * on *V⊗W* by the equation

The definition of *A⊗B* is then extended to all elements of *V⊗W* in the natural way to ensure linearity of *A⊗B,* that is,

One can show that*A⊗B* so defined is a well-defined linear operator on *V⊗W*. This notion of the tensor product of two operators extends in the obvious way to the case where* A: V→V’* and *B: W→W’* map between different vector spaces. Indeed, an arbitrary linear operator *C* mapping *V⊗W* to* V’⊗W’* can be represented as a linear combination of tensor products of operators mapping* V to V’* and *W to W’*,

where by definition

The inner products on the spaces *V* and *W* can be used to define a natural inner product on *V⊗W*.

Define

*42 A† ≡ (AT)* ≡ (A*)T* is the Hermitian conjugate or adjoint of matrix A. An operator A whose adjoint is also A is known as a Hermitian or self-adjoint operator.