Ask Your Question

ciao's profile - activity

2021-01-24 15:14:06 +0200 received badge  Popular Question (source)
2020-04-10 20:28:58 +0200 received badge  Notable Question (source)
2017-07-10 04:07:12 +0200 received badge  Popular Question (source)
2017-07-01 03:03:26 +0200 commented question quadratic form

def function(Q):

#(Sylvester theorem to obtain a diagonalizing base)

n=Q.dim()

D=Q.rational_diagonal_form(return_matrix=True)[0]

M=Q.rational_diagonal_form(return_matrix=True)[1]

base=[M.column(i) for i in range(0,n)]

BASEpos=[]

BASEneg=[]

BASEnull=[]

for i in range(0,n):

    if D[i,i]>0: BASEpos=BASEpos+[1/sqrt(D[i,i])*base[i]]

    if D[i,i]<0: BASEneg=BASEneg+[1/sqrt(-D[i,i])*base[i]]

    if D[i,i]==0: BASEnull=BASEnull+[base[i]]

Base1= BASEpos+BASEneg      #(base without radical's vector to generate W)       

Base2= BASEpos+BASEneg+BASEnull

W=span(SR,B1)

return W

When i give as input a quadratic form Q such as Q=QuadraticForm(SR,4,[0,0,0,1,0,-1,0,0,0,0]) W=function(Q) the program give me a lot of errors

2017-06-30 16:07:04 +0200 received badge  Editor (source)
2017-06-30 13:53:01 +0200 commented question quadratic form

i'm a sage beginner, i know what to do but i don't know how to implement it.. the idea is that i want to give in input a symmetrical nontrivial matrix A associated to the bilinear form B respect to the canonical base in R^n..then i want to obtain a subspace W⊆ R^n of maximal dimension such that the restriction B|wxw has max rank, in other words the matrix associated to this restriction has maximum rank and this condition occurs if kerW=[0].So i have to : 1. Give in input a matrix, 2. Declare the canonical basis of R^n and R 3. If B is the bilinear form and ei elements of the canonical base of R^n, i say that B(ei,ej)= A(i,j) with A(i,j) the i,j element of A 4. Obtain a subspace W ... (more)

2017-06-30 03:03:09 +0200 asked a question quadratic form

Write a function in Sage that accepts as input a symmetrical bilinear (not trivial) form B [caracterized by the associated matrix respect to the canonical base in R^n] and gives in output a vector subspace W ⊆ R^n such that: - Dim W is maximal - the restriction B|wxw has maximum rank

2017-06-30 03:03:09 +0200 asked a question Bilinear form

Write a function in Sage that accepts as input a symmetrical bilinear (not trivial) form B [caracterized by the associated matrix respect to the canonical base in R^n] and gives in output a vector subspace W ⊆ R^n such that: - Dim W=n - the restriction of B to WxW has maximum rank