| hermann on Sun, 08 Oct 2023 12:01:23 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: efficient foursquare() and/or threesquare1m4() functions |
On 2023-10-08 10:19, Bill Allombert wrote:
On Sun, Oct 08, 2023 at 01:25:07AM +0200, hermann@stamm-wilbrandt.de wrote:Because I already implemented generation of ternary quadratic form Q for n- that represents n - and has determinant 1.Now I need to figure out how to determine matrix M, such that M~*Q*M is diagonal matrix. The diagonal entries of M~*Q*M are three square representation of n.See qfgaussred Cheers, Bill.
Thanks, but that matrix is not the matrix M I search for.
For ternary quadratic form representing n=62 with determinant 1 ...
? Q=[41,50,1;50,61,0;1,0,62];
? qfeval(Q,[0,0,1])
62
? matdet(Q)
1
?
... the result for M~*Q*M is not a diagonal matrix:
? M=qfgaussred(Q)
[41 50/41 1/41]
[ 0 1/41 -50]
[ 0 0 1]
? M~*Q*M
[ 68921 2100 -102418]
[ 2100 107561/1681 -5245900/1681]
[-102418 -5245900/1681 6250045/41]
?
Since 62 = 6^2 + 5^2 + 1^2, the matrix M I need would
result in M~*Q*M being a diagonal matrix with entries {1,5,6}.
So what is this matrix named in linear algebra?
How can it be computed?
Regards,
Hermann.
P.S:
Characteristic polynomial of Q is not product of distinct linear terms.
? factor(charpoly(Q))
[x^3 - 164*x^2 + 6324*x - 1 1]
?
So diagonalizability by H^(-1)*Q*H should not be possible [H^(-1)
instead M~ above].
But all non-diagonal entries are very close to 0?!?!? ? [L,H]=mateigen(Q,1); ? H^(-1)*Q*H[0.00015812841567833090336360740761774181802 8.557414429477184768 E-41 5.977755398451150209 E-38]
[3.761581922631320025 E-37 61.999596775635851601749685190428479366 -7.523163845262640051 E-37]
[1.6502838659591020717 E-37 -9.183549615799121156 E-41 102.00024509594847006734695120216390289]
? But that does not help to get matdiagonal([1,5,6]) as result for Q.