4

For example:

$$\rm{X=\sigma_x=NOT=|0\rangle\langle 1|+|1\rangle\langle 0|=\begin{bmatrix}0 & 1 \\ 1 & 0\end{bmatrix}}$$

$$\rm{Z=\sigma_Z=signflip=|0\rangle\langle 0|-|1\rangle\langle 1|=\begin{bmatrix}1 & 0 \\ 0 & -1\end{bmatrix}}$$

I do no understand how the matrix can be expressed in bra-ket and the way around. I could not find any good teachings on this.

peterh
  • 897
  • 2
  • 14
  • 23
John T
  • 183
  • 2
  • 7

1 Answers1

5

Recall that kets $|\cdot\rangle$ represent column vectors; a bra $\langle\cdot|$ is a ket's row vector counterpart. For any ket $|\psi\rangle$, the corresponding bra is its adjoint (conjugate transpose): $\langle\psi| = |\psi\rangle^\dagger$. (For a refresher on this, see this question).

Kets and bras give us a neat way to express inner and outer products. The outer product of two vectors of the same size produces a square matrix. We can use a linear combination of several outer products of simple vectors (such as basis vectors) to express any square matrix. For example, the $X$ gate can be expressed as follows:

$$X = |0\rangle\langle1| + |1\rangle\langle0| = \begin{bmatrix} 1 \\ 0 \end{bmatrix}\begin{bmatrix} 0 & 1 \end{bmatrix} + \begin{bmatrix} 0 \\ 1 \end{bmatrix}\begin{bmatrix} 1 & 0 \end{bmatrix} = \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix} + \begin{bmatrix} 0 & 0 \\ 1 & 0 \end{bmatrix} = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}$$

Mariia Mykhailova
  • 9,010
  • 1
  • 12
  • 39
  • And how do I go from matrix to notation, the way around? – John T Oct 08 '20 at 19:54
  • 1
    Same way but in other direction - express the matrix as a sum of matrices with just one non-zero elements, and each of these matrices will be a ket-bra product of two basis vectors – Mariia Mykhailova Oct 08 '20 at 19:57