TITLE: For complex matrices, if $\langle Ax,x\rangle=\langle Bx,x\rangle$ for all $x$, then $\langle Ax,y\rangle=\langle Bx,y\rangle$ for all $x$ and $y$?
QUESTION [13 upvotes]: Given $A$ and $B$, $n\times n$ complex matrices. If $\langle x,y\rangle =y^{*}x$ for all $x,y\in \mathbb C^{n}$, then the following are equivalent:
(1) $\langle Ax,y\rangle=\langle Bx,y\rangle$, for all  $x,y\in \mathbb C^{n}$.
(2) $\langle Ax,x\rangle=\langle Bx,x\rangle$, for all  $x,y\in \mathbb C^{n}$.
(1) implies (2) is easy, how to prove (2) implies (1)?

REPLY [4 votes]: A very similar but slightly easier approach is to move everyone over to one side of the equations, use linearity to combine the operators, and consider the difference $C := A - B$. Then your first equation implies that $\forall x, y \in \mathbb{C}^n, \langle C x,  y \rangle = 0$, which is clearly equivalent to the operator equation $C = 0$. The statement to be shown then becomes
$$\forall x \in \mathbb{C}^n, \langle C x, x \rangle = 0 \iff  C = 0.$$ You can then do the same trick that Jonas Meyer suggested and expand out $\langle C(x + y), x + y \rangle$ and $\langle C(x + i y), x + i y \rangle$, and the algebra is slightly simpler.
This simple trick also helps explain the qualitatively different behavior between the real and complex cases: it's just that the complex numbers are algebraically closed and the real numbers are not. Any nonzero matrix $C$'s characteristic polynomial is $n$-th order and nontrivial (by which I mean it isn't just $\lambda^n$, but has subleading terms as well). Any nontrivial polynomial has at least one nonzero complex root, so any nonzero complex matrix $C$ will have at least one nonzero eigenvalue $\lambda$. Since the numerical range of any matrix contains its eigenvalues, the numerical range of any nonzero complex matrix is nontrivial, i.e. is not simply $\{ 0 \}$. (Another way to see this is that the numerical radius of any complex matrix is at least one-half its operator norm, which is positive for a nonzero matrix.)
On the other hand, a nonzero real matrix has a nontrivial real characteristic polynomial that may not have any real roots, like the example
$$\left[ \begin{array}{cc} 0 & -1 \\ 1 & 0 \end{array} \right]$$ given in the comments to Jonas Mayer's answer, so it may not have any eigenvectors. That's why its numerical radius can be $0$.