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