# A sufficient condition (or not) for positive semidefiniteness of a matrix?

Let $A\in M_{n}(\mathbb{C})$ be a Hermitian matrix. If for all $z_1,...,z_n\in\mathbb{C}$, $$\sum_{i,j=1}^{n}A_{ij}z_{i}\overline{z_{j}}\ge 0$$ then A is positive semidefinite.

I do not think the counterexample to the original question below will answer the following version of the question motivated by the free nonabelian group algebra analogue of of Helton's Theorem originally due to Schmüdgen. I ask the question here in the hope of conclusively recording the state of this question in its most extreme form:

Question: If for all $m\in \mathbb{N}$ and $U_1,...,U_{n}\in M_{m}(\mathbb{C})$ unitary matrices, $$\sum_{i,j=1}^{n}A_{ij}U_{i}U_{j}^{*}$$ is positive semidefinite, then is A positive semidefinite plus a trace zero diagonal matrix?

An affirmative answer to the above question is equivalent to the claim that for every positive semidefinite $n\times n$ matrix $C$ with constant diagonal, there exists $m\in \mathbb{N}$ and $U_{1},...,U_{n}$ unitaries in $M_{m}(\mathbb{C})$ and a matrix $B\in M_{m}(\mathbb{C})$ such that for all $i,j\in\{1,...,n\}$, $$C_{ij}=\frac{1}{m}Tr((U_iB)^{*}(U_{j}B)).$$

This equivalence comes from a result we recently proved (in a paper to appear in Operators and Matrices) that if $\sum_{ij}A_{ij}C_{ij}$ is positive semidefinite for all correlation matrices $C$, then $A$ is positive semidefinite plus trace zero diagonal.

This claim is true for matrices with real entries by our result above together with a nice result of Dykema and Juschenko asserting that every real correlation matrix $C$ can be written in the above way with $B$ the identity matrix. So a counterexample will require $A$ to have complex entries.

The original question asked here, which is trivially false by the counterexample below provided by Noam Elkies, was

Question: If for all $z_1,...,z_{n}\in S^{1}$, $$\sum_{i,j=1}^{n}A_{ij}z_{i}\overline{z_{j}}\ge 0$$ then is A positive semidefinite?

The same counterexample, combined with simultaneous diagonalization answers the following question negatively:

Question: If for all $m\in \mathbb{N}$ and $U_1,...,U_{n}\in M_{m}(\mathbb{C})$ pairwise commuting unitary matrices, $$\sum_{i,j=1}^{n}A_{ij}U_{i}U_{j}^{*}$$ is positive semidefinite, then is A positive semidefinite?

• Possible counterexample to the new conjecture: $m=1$, $n=5$, $A_{ii}=3$, $A_{ij}=2$ if $i-j\equiv\pm1\bmod 5$, $A_{ij}=0$ if $i-j\equiv\pm2\bmod 5$: $$A = \left(\begin{array}{ccccc} 3 & 2 & 0 & 0 & 2 \cr 2 & 3 & 2 & 0 & 0 \cr 0 & 2 & 3 & 2 & 0 \cr 0 & 0 & 2 & 3 & 2 \cr 2 & 0 & 0 & 2 & 3 \end{array}\right)$$ – Noam D. Elkies May 16 '16 at 15:05
• Hm, I'm afraid that this attempt (and similar ones with $3/2$ replaced by something closer to the golden ratio) will fail on a regular pentagon. Let me think about this some more . . . – Noam D. Elkies May 16 '16 at 15:13
• Sorry for what looks like a shameless plug for our paper in the body of the question. I needed it to help steer people away from looking for real counterexamples... – Jon Bannon May 18 '16 at 11:51

No (except of course for $n=1$). A counterexample for $n=2$ is $A = {\rm diag}(2,-1)$. The corresponding form $2|z_1|^2 - |z_2|^2$ is clearly indefinite, but takes the positive value $1$ whenever $|z_1|=|z_2|=1$. This readily generalizes to all $n \geq 2$.