Obtaining a permutation associated to a matrix
Let A be an invertible n×n matrix and denote by ri(A,j) the vector with entries as in row i of A with columns from 1,...,j. We can obtain ri(A,j) in Sage as follows:
def givesubmatrix(A,i,j):
B=A[[i-1],[0..j-1]]
return(B)
I want to find the permutation p(A) of the set {1,...,n} (it seems set brackets dont work in this forum using latex? So I use [ and ] instead for the set brackets) defined by the condition:
p(A,i):=min{j∣ri(A,j) is not in the span of {r1(A,j),...,ri−1(A,j)}}.
Is there an easy way to obtain this permutation?
I have already problems to define the subspace generated by {ri(A,j),...,ri−1(A,j)} using Sage.
Latex works fine here, but you need to double each backslash - e.g. use
\\{
for opening brace {.Thank you, I did not know this. I do not have to do this when I use texmaker or overleaf.
Btw, you don't need to create lists like
[0..j-1]
unless they are truly needed, it's more efficient to use generators like(0..j-1)
.