return sparse matrix instead of hash for query