[Math] Is a positive semidefinite matrix always non-negative

convex optimizationlinear algebra

I'm trying to get some intuition behind the meaning of a positive semidefinite matrix, which I learned a long time ago in undergrad but clearly didn't internalize properly.

As I understand, a symmetric matrix $M \in \textbf{R}^{n~\times~n}$ is positive semidefinite iff $z^TMz \ge 0$, $\forall z \in \textbf{R}^n$.
Note that I'd like to use this particular definition, not a more general one that involves complex numbers. As such, $z^TMz \in \textbf{R}$.

This definition makes sense to me, and this question clarified it further, but then I was reading Boyd's textbook and became confused by an unrelated definition explained in $\S$3.1.4, which implies that the Hessian matrix $\textbf{H}$ of function $f$ is positive semidefinite if $\textbf{H} \succcurlyeq 0$, where the $"\succcurlyeq"$ symbol refers to a componentwise inequality between matrices.

Thus, can a positive semidefinite matrix contain negative entries?

EDIT: This question turned out to be silly, but if you have this question and am as rusty with linear algebra as I am, this post might be useful.

Best Answer

Can a positive semidefinite matrix contain negative elements? If by elements, you mean entries, then yes, $$\pmatrix{2&-1\\-1&2}$$ is positive definite.

Related Question