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?
 A: In general $\langle A\vert B\rangle$ is a scalar product whereas $\vert A\rangle\langle B\vert$ is an operator.  To understand this last statement, 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.
A: 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.$$
A: 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.
