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)