This should be `return Q.nonzero(x)`.  That will also work if `x` is deduced to be 0, but doesn't exactly equal it (like https://code.google.com/p/sympy/issues/detail?id=3006#c7).