4
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ please try to use mathjax rather than images whenever possible $\endgroup$
    – glS
    Oct 9 '20 at 6:55
  • $\begingroup$ @glS no, my question is answered below as you can see checked it as an answer. $\endgroup$
    – John T
    Oct 9 '20 at 9:07
5
$\begingroup$

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}$$

$\endgroup$
2
  • $\begingroup$ And how do I go from matrix to notation, the way around? $\endgroup$
    – John T
    Oct 8 '20 at 19:54
  • 1
    $\begingroup$ 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 $\endgroup$ Oct 8 '20 at 19:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.