Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I can find the submatrix for a particular element in the following way.

N = random_matrix(ZZ, 10,10) M=N.delete_rows([2,7]) P=M.delete_columns([2,7]) show(N) show(P)

My problem is that I'm unable to generate all such submatrix at a time. What I want is to replace each element of the given matrix by the determinant of such submatrix of that particular element. What I tried is the following one. But it shows some error.

L = random_matrix(ZZ, 10,10) R=matrix(QQ, 10) for i in range(10): for j in range(10): if i!=j: B(i,j)=L.delete_rows([i,j]) B(i,j)=B(i,j).delete_columns([i,j]) R[i,j]=B(i,j).det() show(R)