scipy.sparse
scipy.sparse.spmatrix.count_nonzero
scipy.sparse.spmatrix.dot
spmatrix.
diagonal
Returns the main diagonal of the matrix