ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 16 Jul 2020 00:20:50 +0200Checking what the span is for a vectorhttps://ask.sagemath.org/question/52485/checking-what-the-span-is-for-a-vector/Let's assume I have a vector called v1 and I have a matrix called Matrix.
Let us assume that the vector is in the span of the rows of Matrix. How would I know what the linear combination is? Here is what I do know. Let's assume this is a m by n matrix. I do know there is the span function. So
I can do something like make a list of vectors out of the Matrix. Say something like make an empty list ListofVectors=[].
i=0
while i< m:
ListofVectors.append(M[i])
i+=1
Now doing
v1 in span(ListofVectors)
will give me true assuming v1 is in the span. However, is there a function that tells me what the coefficients are for each term. For example, the vector v1=[3,2,1] for the ListofVectors being [1,1,1], [1,0,0], and [0,1,0] should give me coefficients 1,2,1 respectively as 1*[1,1,1] + 2*[1,0,0] + 1*[0,1,0] gives [3,2,1].
whatupmattThu, 16 Jul 2020 00:20:50 +0200https://ask.sagemath.org/question/52485/span of matrices over finite fieldshttps://ask.sagemath.org/question/43263/span-of-matrices-over-finite-fields/ Hello,
I'd to build the span of some matrices defined over GF(4). However, the function span doesn't fit since it seems to interpret matrices as lists of vectors. I tried the following :
F=GF(4);
n=11;
A=random_matrix(F,n);
B=random_matrix(F,n);
print(span(A,F));
print(span([A,B],F));
None of which gives satisfying results (the second one gives an error). So, I wanted to know if there was a way to properly get a span of matrices in sagemath.
Thanks in advance.
ParkerMon, 06 Aug 2018 11:53:07 +0200https://ask.sagemath.org/question/43263/