# Having some issue with notation in a Hilbert space

What is the difference between these two?

$$\langle x|x\rangle$$ and $$|x\rangle\langle x|$$

Are they the same? If they're the same, why are they used in these two different forms?

• One's a number, the other an operator. If this refers to a state-vector, the first is "related" to normalization and the second to the density operator of such state. – Vendetta Jun 18 at 17:32

They are not the same. One is the outer product and one is the inner product.

In the finite-dimensional real-number case for example, if $$|x\rangle = \begin{bmatrix}1\\2\\3\end{bmatrix},$$ then $$|x\rangle\langle x| = \begin{bmatrix}1\\2\\3\end{bmatrix} \begin{bmatrix}1&2&3\end{bmatrix} = \begin{bmatrix}1&2&3\\2&4&6\\3&6&9\end{bmatrix},$$ while $$\langle x | x\rangle = \begin{bmatrix}1&2&3\end{bmatrix} \begin{bmatrix}1\\2\\3\end{bmatrix} = 1 + 4 + 9 = 14.$$

In Bra-Ket notation $$| x \rangle$$ is a vector and $$\langle x |$$ is a covector. Formally, a covector is a map that goes from $$V \rightarrow \mathbb{R}$$, i.e. it “eats a vector” and gives you a number. When we write $$\langle x | x \rangle$$ we are saying that the covector $$\langle x |$$ is acting on the vector $$|x\rangle$$, so $$\langle x | x\rangle$$ is a real number.

On the other hand, $$| x \rangle \langle x|$$ isn’t acting on anything. If we toss some vector at it $$|a\rangle$$, we would have $$|x\rangle \langle x | a \rangle$$ which is just a real number times $$|x \rangle$$. We have given the above a vector and we got a vector back out so it is a map between vectors. To summarize then, $$|x\rangle \langle x|$$ and $$\langle x | x \rangle$$ represent different types of objects: the first is a map from $$V \rightarrow V$$, wheras the second is an element $$b \in \mathbb{R}$$.

To be concrete, let $$|x\rangle = \begin{pmatrix} 1\\ 0 \end{pmatrix}$$ . Then we would write $$\langle x | = \begin{pmatrix} 1&0\end{pmatrix}$$ which is the Hermitian conjugate of $$|x\rangle$$, in this case just the transpose. So $$\langle x | x \rangle = \begin{pmatrix} 1&0 \end{pmatrix} \begin{pmatrix} 1\\ 0 \end{pmatrix} = 1$$ And $$| x \rangle \langle x | = \begin{pmatrix} 1\\ 0 \end{pmatrix} \begin{pmatrix}1&0\end{pmatrix} = \begin{pmatrix} 1&0\\ 0&0 \end{pmatrix}$$ A number and a map, as expected.

• Internalizing this is what made me realize how clever of a "hack" the bra-ket notation really is. Also, for the record, the names "bra" and "ket" are suitably horrible puns. – Arthur Jun 14 at 9:14

In general $$\langle A\vert B\rangle$$ is a scalar product whereas $$\vert A\rangle\langle B\vert$$ is an operator. To this this last suppose $$\vert \psi\rangle$$ is an arbitrary vector in your space. Then $$\vert A\rangle\langle B\vert \psi\rangle$$ is a vector proportional to $$\vert A\rangle$$ since $$\langle B\vert \psi\rangle \in \mathbb{C}$$ is a (complex) number, so that $$\vert A\rangle\langle B\vert$$ maps a vector to another vector.