  An algorithm to classify a general Hermitian matrix according to its
signature (positive semi-definite, negative or indefinite) is presented. It
builds on the Quantum Phase Estimation algorithm, which stores the sign of the
eigenvalues of a Hermitian matrix in one ancillary qubit. The signature of the
matrix is extracted from the mean value of a spin operator in this single
ancillary qubit. The algorithm is probabilistic, but it shows good performance,
achieving 97% of correct classifications with few qubits. The computational
cost scales comparably to the classical one in the case of a generic matrix,
but improves significantly for restricted classes of matrices like $k$-local or
sparse hamiltonians.
