pickle the matrix if it has not already been initialized