Use sparse matrix

Switch linalg package to use sparse matrices.  

Improve efficiency in to_scipy_sparse_matrix.