ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 19 Nov 2014 11:26:43 +0100Possible coefficients for a given discriminanthttps://ask.sagemath.org/question/24891/possible-coefficients-for-a-given-discriminant/ I'm a new user of Sage, and want to know what commands should I use to determine the possible positive definite binary quadratic forms for a given discriminant? i.e the coefficients
For example if I have -47 as a discriminant for a quadratic form, and set [a,b,c]=ax^2+bxy+cy^2, then I will have :
Ro=[1,1,12] , R1=[2,1,6], R2=[3,1,4] , R4=[3,-1,4] , R4=[2,-1,6]Mon, 17 Nov 2014 05:10:59 +0100https://ask.sagemath.org/question/24891/possible-coefficients-for-a-given-discriminant/Answer by Francis Clarke for <p>I'm a new user of Sage, and want to know what commands should I use to determine the possible positive definite binary quadratic forms for a given discriminant? i.e the coefficients </p>
<p>For example if I have -47 as a discriminant for a quadratic form, and set [a,b,c]=ax^2+bxy+cy^2, then I will have :</p>
<p>Ro=[1,1,12] , R1=[2,1,6], R2=[3,1,4] , R4=[3,-1,4] , R4=[2,-1,6]</p>
https://ask.sagemath.org/question/24891/possible-coefficients-for-a-given-discriminant/?answer=24916#post-id-24916You can do:
sage: BinaryQF_reduced_representatives(-47)
[x^2 + x*y + 12*y^2,
2*x^2 - x*y + 6*y^2,
2*x^2 + x*y + 6*y^2,
3*x^2 - x*y + 4*y^2,
3*x^2 + x*y + 4*y^2]
and to get the coefficients:
sage: [qf.polynomial().coefficients() for qf in BinaryQF_reduced_representatives(-47)]
[[1, 1, 12], [2, -1, 6], [2, 1, 6], [3, -1, 4], [3, 1, 4]]
Wed, 19 Nov 2014 11:26:43 +0100https://ask.sagemath.org/question/24891/possible-coefficients-for-a-given-discriminant/?answer=24916#post-id-24916