Hilbert's 17th problem and the quantumness of states
  A state of a quantum systems can be regarded as {\it classical} ({\it quantum}) with respect to measurements of a set of canonical observables iff there exists (does not exist) a well defined, positive phase space distribution, the so called Galuber-Sudarshan $P$-representation. We derive a family of classicality criteria that require that averages of positive functions calculated using $P$-representation must be positive. For polynomial functions, these criteria are related to 17-th Hilbert's problem, and have physical meaning of generalized squeezing conditions; alternatively, they may be interpreted as {\it non-classicality witnesses}. We show that every generic non-classical state can be detected by a polynomial that is a sum of squares of other polynomials (sos). We introduce a very natural hierarchy of states regarding their degree of quantumness, which we relate to the minimal degree of a sos polynomial that detects them is introduced. Polynomial non-classicality witnesses can be directly measured. 
J. Korbicz, J.I. Cirac, J. Wehr and M. Lewenstein