added python script to output algorithms in matrix form (also computes rank of matrices)