hermann on Mon, 18 Dec 2023 16:05:46 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Question on "qfminim()" for quadratic form


This is a followup on Bill's solution to determine all "qfminim()" values by "concat(S,-S)" for a quadratic form:
https://pari.math.u-bordeaux.fr/archives/pari-users-2312/msg00050.html

You can run below script S2.gp, if you download tqf.gp into same directory:
https://gist.github.com/Hermann-SW/f13b8adf7d7e3094f0b6db0bce29a7b8

In Bill's previous to above posting ...
https://pari.math.u-bordeaux.fr/archives/pari-users-2312/msg00048.html

... he proposed to use "qfsolve()" in case I only need one solution.
That is no option since qfsolve does factorization and I want to apply to RSA numbers.


pi@raspberrypi5:~ $ n=101 gp -q < m2.gp
101=[1, 6, 8]
all asserts OK
528979 [711, -153, -7]~ [2, 9, 4]~
10232019 [3127, -673, -31]~ [2, 9, -4]~
...
97549123438 [305322, -65715, -3023]~ [10, 0, -1]~
101592175419 [311585, -67063, -3085]~ [10, -1, 0]~
#S2=168
12*h(-4*n)=168
pi@raspberrypi5:~ $


Because "S2=vecsort(concat(S,-S),norml2)", it has 12*h(-4*n) members for n!=3 (mod 4):
https://en.wikipedia.org/wiki/Sum_of_squares_function#k_=_3

S2.gp output is sorted wrt L2 norm of vectors. Is there a method to determine either minimal norm vector or maximal norm vector in S2 efficiently/"more efficient than to
compute all 12*h(-4*n) elements" ?


pi@raspberrypi5:~ $ cat S2.gp
readvec("tqf.gp");
n=eval(getenv("n"));
Q=get_tqf(n);
M=Q~*Q;
S=[x|x<-Vec(qfminim(M,n)[3]),qfeval(M,x)==n];
S2=vecsort(concat(S,-S),norml2);
foreach(vecsort(S,norml2),s,print(norml2(s)," ",s," ",Q*s));
print("#S2=",#S2);
print("12*h(-4*n)=",12*qfbclassno(-4*n));
pi@raspberrypi5:~ $


Regards,

Hermann.