TITLE: A question on Gram matrix
QUESTION [9 upvotes]: The entries of Gram matrix is defined by $ \langle x_i,x_j\rangle$ in the $(i,j)^{\text{th}}$ position. It is known that Gram matrix is positive semidefinite. 
Is it still positive semidefinite if $ \langle x_i,x_j\rangle$  is replaced by  $ |\langle x_i,x_j\rangle|$?

REPLY [3 votes]: The positive semi-definiteness of the Gram matrix can be seen from the following: 
$G_{ij} = \langle x_i, x_j \rangle$ is equivalent to write
$$
G = \begin{pmatrix} - &x_1^* &-\\
- &x_2^* &-\\
- &\vdots &-\\
- &x_n^* &-\\ \end{pmatrix}
\begin{pmatrix} | &| &| &|\\
x_1 &x_2 &\ldots&x_n\\
| &| &| &|\\ \end{pmatrix} = X^*X \succeq 0
$$
Modifiying this structure might or might not preserve the positive semidefinite structure as Joriki showed with a counterexample.