Is the entrywise nonnegative part of a real positive semidefinite matrix still positive semidefinite? Let M be a real positive semidefinte matrix and consider the entrywise nonnegative matrix M' obtained from from M by zeroing out all the negative entries of M.  Is it true that M' is always positive semidefinite?
Addendum 1: More generally, consider the entrywise nonnegative matrix M'' obtained from M by zeroing out an arbitrary set of off-diagonal entries (symmetrically, of course).  Is it true that M'' is always positive semidefinite?
Addendum 2: Thanks to @orangeskid and @user1551 for prompt answers.  The question of Addendum 1 has a counterexample even in 3 dimensions.
 A: HINT: The answer is No. 
I will tell you why I thought the answer is no, then I will tell you how to find a counterexample.


*

*There is a related question about positive semidefinite matrices, whether taking the absolute value entrywise keeps us in the positive-semidefinite domain. The answer is: only if the dimension is not larger than $3$. Now, if this one were true, the answer to your question would also be Yes. So we suspect the answer to be no.

*How to look for counterexamples. I found one of size $5\times 5$. The trick is to produce a large enough supply of positive semidefinite matrices. This you do by first producing random symmetric matrices ( $ b = a + a^{t}$), then taking the exponential. Eventually you will hit a counterexample.

*An explicit counterexample
\begin{eqnarray}
\left(
\begin{array}{ccccc}
 189.79 & 5.37843 & -122.669 & -214.584 & 122.596 \\
 5.37843 & 17.4416 & 3.21858 & -20.9122 & 13.1482 \\
 -122.669 & 3.21858 & 83.255 & 133.105 & -75.7694 \\
 -214.584 & -20.9122 & 133.105 & 255.536 & -146.986 \\
 122.596 & 13.1482 & -75.7694 & -146.986 & 84.6935 \\
\end{array}
\right)
\end{eqnarray}
A: The answer to your first question is no. Here is a random counterexample:
$$
A = \pmatrix{ 6&2&-1&1\\ 2&1&0&1\\ -1&0&7&2\\ 1&1&2&2},
\ B=\pmatrix{6&2&0&1\\ 2&1&0&1\\ 0&0&7&2\\ 1&1&2&2}.
$$
One can verify by Sylvester's criterion that $A$ is positive definite, but $\det B=-1$.
For $2\times2$ matrices, the answer to your question is clearly yes. When the size is $3\times3$, however, I am unable to find any counterexample by computer simulation.
