
> 
> Key Problem : Is there any theorem about eigenvalues or positive semi-definiteness of small size matrices with small integer elements?
>    
> 
> 
> 
> 


I have to check positive semi-definiteness of many symmetric matrices with integer elements. First I used eigenvalues, but floating point round error happens : eig(in numpy) sometimes gives small negative eigenvalues when a matrix is actually positive semi-definite.   
  

I know [Sylvester's criterion](https://en.wikipedia.org/wiki/Sylvester%27s_criterion "Sylvester's criterion") for positive semi-definiteness can avoid this problem. But I really don't want to use it since it requires computation of determinant of all principal minors, and I have to deal with really many matrices($ > 10^{20}$). I have to do anything to reduce number of calculations.
  
  



All the elements are integer and have small absolute values($\ <3 $), sizes of matrices are also small($\ < 10 \times 10 $). It seems pretty good condition, so I believe someone already researched this kind of matrices. Does anyone know useful theorems for this situation?


P.S: I'm pretty newbie in English Internet community and not native English speaker. So if you find something awkward, pardon me and let me know.



Checking positive semi-definiteness of integer matrix
For small symmetric matrices, you could look at the characteristic polynomial.
The real symmetric matrix $A$ is positive semidefinite iff the coefficients of the characteristic polynomial are alternating in sign. For $n \times n$ matrices this gives you $n$ integer expressions to check.


