Ask Your Question
1

quadraticform rational_diagonal_form?

asked 2016-12-12 16:34:50 +0100

rrogers gravatar image

updated 2016-12-12 17:55:19 +0100

kcrisman gravatar image

I don't understand the factor of "2" ; which also appears in my real problem. Here is the sample code from doc.sagemath.org/html/en/reference/quadratic_forms/sage/quadratic_forms/quadratic_form.html#sage.quadratic_forms.quadratic_form.QuadraticForm.rational_diagonal_form

Q = QuadraticForm(ZZ, 4, range(10))  
D, T = Q.rational_diagonal_form(return_matrix=True)  
D  
[ -1/16 0 0 0 ]  
[ * 4 0 0 ]  
[ * * 13 0 ]  
[ * * * 563/52 ]

but

T.transpose() * Q.matrix() * T  
[  -1/8      0      0      0]  
[     0      8      0      0]  
[     0      0     26      0]  
[     0      0      0 563/26]

Off by a factor of 2?

The description says.

OUTPUT: either D (if return_matrix is false) or (D,T) (if return_matrix is true) where  
D – the diagonalized form of this quadratic form.  
T – transformation matrix. This is such that T.transpose() * self.matrix() * T gives D.matrix().**

Ray

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2016-12-12 17:01:39 +0100

rrogers gravatar image

Q.matrix() ( i.e. the .matrix() operation) returns
matrix() Returns the Hessian matrix A for which Q(X) = (1/2)∗Xt∗A∗X(1/2)∗Xt∗A∗X.
I can understand where the two comes from if your doing differentiation.
What I don't understand is why .matrix() gives this form. Ray

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-12-12 16:34:50 +0100

Seen: 341 times

Last updated: Dec 12 '16