# Re: [sage-support] how do I do this exercise that asks me given a bilinear form and a subspace determine the root base of the bilinear form restricted to the subspace

16 views
Message has been deleted

### David Joyner

Jul 8, 2021, 5:59:26 AMJul 8
to SAGE support
def es(b,W):
....:     m=dimension(span(A))
....:     n=W.dimension()
....:     B=W.basis()
....:     if transpose(A)!=A:
....:         print("La matrice deve essere simmetrica")
....:         return
....:     else:
....:         componenti=[var('x'+str(i)) for i in range(1,m+1)]
....:         w=(SR^m).linear_combination_of_basis(componenti)
....:         d=[b(B[i],w) for i in range(0,n)]
....:     return d

is the same thing but a few typos were fixed.

On Thu, Jul 8, 2021 at 5:55 AM Cosimo Romito <pontefi...@gmail.com> wrote:
sage:
def es(b,W):
m=dimension(span(A))
n=W.dimension()
B=W.basis()
if transpose(A)<>A:
print("La matrice deve essere simmetrica")
return
else:
componenti=[var('x'+str(i)) for i in range(1,m+1)]
w=(SR^m).linear_combination_of_basis(componenti)
d=[b(B[i],w) for i in range(0,n)]

return d

--
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.