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?