0
$\begingroup$

The function PositiveSemidefiniteMatrixQ is used to decide whether the given matrix is positive semidefinite or not. A matrix $M$ is said to be positive semidefinite if $x^{\dagger}Mx\ge 0$ for all $x\in \mathbb{C} ^n$. Here $x^{\dagger}$ means conjugate transpose of the vector $x$. However, the function PositiveSemidefiniteMatrixQ in Mathematica documentation seems to only check whether the real part of $x^{\dagger}Mx$ is positive, namely, $$ \mathrm{Re}\left[ x^{\dagger}Mx \right] \ge 0. $$ I understand the reason to do this is that the function PositiveSemidefiniteMatrixQ works also for numerical value which might cause the imaginary part of $x^{\dagger}Mx$ nonzero. But a better method, in my opinion, is to decide whether the matrix $M$ is Hermitian or not first since a positive semidefinite matrix is also Hermitian and $x^{\dagger}Mx$ is always real for a Hermitian matrix $M$. After thi operation, the problem I just mentioned disappeared.

Furthermore, the current implementation of PositiveSemidefiniteMatrixQ will have a bug(I think it's a bug?) that the matrix $\left( \begin{matrix} 1& 1\\ 0& 1\\ \end{matrix} \right) $ will be recognized to be positive semidefinite.

m = ( {
    {1, 1},
    {0, 1}
   } );
PositiveDefiniteMatrixQ@m
(*True*)

Is my understanding correct, or have I overlooked something?

$\endgroup$
3
  • 3
    $\begingroup$ In the future, please, refrain from using the bugs tag prior to confirmation from other members. This is just a good housekeeping policy :-) $\endgroup$
    – bmf
    Commented Dec 27, 2023 at 12:54
  • 3
    $\begingroup$ The definition on wikipedia is subtly different. m is a real matrix so you don't check it's Hermitian. It is positive semidefinite. All it's eigenvalues are greater than or equal to zero. Eigenvalues[m] is {1,1}, or equivalently Solve[Det[m - λ IdentityMatrix[2]] == 0, λ] gives {{λ -> 1}, {λ -> 1}} . A matrix that is Positive Definite is also Positive Semidefinite. There are no solutions in: FindInstance[ConjugateTranspose[x] . m . x < 0, x ∈ Vectors[2]]. $\endgroup$
    – flinty
    Commented Dec 27, 2023 at 13:13
  • 2
    $\begingroup$ But this section on consistency between complex/real definitions says since every real matrix is a complex matrix, the two must agree. Since m is not Hermitian, it is only Positive definite in the Real sense. I think you'd have to do PositiveDefiniteMatrixQ[m] && HermitianMatrixQ[m] if you wanted it like that. This seems to be an implementation choice by Wolfram, as a lot of the time in optimization problems you are not dealing with complex matrices. $\endgroup$
    – flinty
    Commented Dec 27, 2023 at 13:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.