computig all possible determinants of submatrices of a given matrix

24 views
Skip to first unread message

GUSTAVO TERRA BASTOS

unread,
Mar 20, 2023, 5:36:15 PMMar 20
to sage-support
Hi all.

Is there any specific comand to compute the determinants of all square submatrices of a given 4x4 - matrix over finite fields?

best regards

Gustavo



William Stein

unread,
Mar 20, 2023, 6:09:07 PMMar 20
to sage-s...@googlegroups.com
This is

https://ask.sagemath.org/question/41136/how-to-find-all-the-sub-square-matrices-of-an-4x4-matrix-and-all-their-determinants/

 -- William

PS: For fun, I also asked a robot from the future and it said to use the following code, but unfortunately "submatrix_iterator" doesn't exist yet:

F = FiniteField(17)
A = matrix(F, 4, [1,2,3,4, 5,6,7,8, 9,10,11,12, 13,14,15,16]) # replace the elements of the matrix with your desired matrix

dets = []
for i in range(1,5):
    for submatrix in A.submatrix_iterator(i):
        if submatrix.is_square():
            dets.append(submatrix.det())
           
print(dets)


--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/97ff54ff-8569-497a-9100-05ff2ae2cf9an%40googlegroups.com.


--

John H Palmieri

unread,
Mar 21, 2023, 1:55:27 PMMar 21
to sage-support
From the ask.sagemath.org answers:

[m.minors(k) for k in range(5)]

is pretty close to what you want: you just have to flatten the list.
Reply all
Reply to author
Forward
0 new messages