A question on Gram matrix 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|$?
 A: I believe this is true for three vectors, but here's a counterexample with four vectors:
$$x_1=\begin{pmatrix}-1\\-2\\-3\end{pmatrix},\;\;x_2=\begin{pmatrix}-3\\3\\-5\end{pmatrix},\;\;x_3=\begin{pmatrix}-4\\-3\\0\end{pmatrix},\;\;x_4=\begin{pmatrix}-1\\-1\\1\end{pmatrix}$$
I found this by looking for three vectors such that their scalar products are positive and at least one scalar product of two vectors in the dual basis of $\mathbb R^3$ is also positive, so that the difference of these two dual basis vectors is shorter than their sum. 
A Hermitian matrix is positive semidefinite if and only if it is the Gram matrix of some set of vectors. Consider the Gram matrix $A$ of the three vectors and the sum of the two dual vectors and the Gram matrix $B$ of the three vectors and the difference of the two dual vectors. They are the same up to signs, except for the square of the sum or difference in the last entry. $A$ has only positive entries. For the component-wise absolute value of $B$ to be the Gram matrix of some set of vectors,  the first three vectors would have to be the three basis vectors (up to orthogonal transformations), and the projection of the fourth vector onto the hyperplane of these three would have to be the sum of the dual basis vectors, but its length would have to be the length of the difference, which is impossible, since the difference is shorter than the sum.
This construction doesn't work for three vectors, since in $\mathbb R^2$ the scalar product of the dual basis vectors of a basis with positive scalar product of the basis vectors is always negative.
A: 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. 
