Are unitary operators determined by their diagonal matrix coefficients? Let $H$ be a complex, infinite dimensional Hilbert space and let $A,B : H \rightarrow H$ be unitary operators such that $\langle A x , x \rangle = \langle B x ,x \rangle$ for all $x \in H$. Does it follow that $A = B$?
If $A$ is the identity operator, this is true since in that case,
$$
||x - Bx||^2 = ||x||^2 - 2 \Re{\langle Bx , x \rangle} + ||Bx||^2 = ||x||^2 - 2 \langle x,x \rangle + ||x||^2 = 0 
$$
However, I don't think that one can reduce to this case by considering $AB^{-1}$ or $B A^{-1}$. 
My notes say that one should use the polarization identity
$$\langle x , y \rangle = \frac{1}{4}(||x + y||^2 + ||x-y||^2 + i ||x + i y||^2 - i ||x-i y||^2)$$
 but I don't see how. 
 A: By assumption we have that
$$
  \langle (A - B)x ,x \rangle = 0
  \quad
  \text{for every $x \in H$}.
$$
It therefore sufficies to show that for any linear map $A \colon H \to H$ with
$$
  \langle A x, x \rangle = 0
  \quad
  \text{for all $x \in H$}
$$
we already have that $A = 0$.

Note that the linear map $A \colon H \to H$ results in a sesquilinear form $s \colon H \times H \to \mathbb{C}$ given by 
$$
  s(x,y) := \langle Ax, y \rangle
  \quad
  \text{for all $x, y \in H$}.
$$
This sesquilinear form is uniquely determined by its diagonal values, i.e. by the map
$$
  Q \colon H \to \mathbb{C},
  \quad
  x \mapsto s(x,x) = \langle Ax, x \rangle.
$$
This follows directly from the following polarization identity:
$$
    s(x,y)
  = \frac{Q(x+y) - Q(x-y) + iQ(x + iy) - iQ(x - iy)}{4}
$$
(Here we use that we are working over the complex numbers, where the polarization identity works for all sesquilinear forms.
This is different from the real case, where polarization only works for symmetric bilinear forms.)
If we have that $\langle Ax, x \rangle = 0$ for every $x \in H$, then $Q = 0$ and therefore $s = 0$.
Thus we have that
$$
  \langle Ax, y \rangle = 0
  \quad
  \text{for all $x, y \in H$}.
$$
By setting $y = Ax$ we find that $\|Ax\|^2 = 0$ for every $x \in H$, and therefore that $A = 0$.

Note that we do not need $A$, $B$ to be unitary.
We only require them to be linear.
