> iload "ex3-3.m"; Interactive-loading "ex3-3.m" > p :=67; > // define a quaternion algebra > B := QuaternionAlgebra< RationalField() | -1,- p >; > O := MaximalOrder(B); O; Order of Quaternion Algebra with base ring Rational Field, defined by i^2 = -1, j^2 = -67 with coefficient ring Integer Ring > // enumerate the left-ideal classes > ideals := LeftIdealClasses(O); > print "There are ", #ideals, "many ideal classes"; There are 6 many ideal classes > print "For every ideal, we print out the basis, norm and the (basis of) the right order"; For every ideal, we print out the basis, norm and the (basis of) the right order > for I in ideals do for> print Basis(I), Norm(I), Basis(RightOrder(I)); for> end for; [ 1, -i, -1/2*i - 1/2*k, 1/2 - 1/2*j ] 1 [ 1, i, 1/2*i + 1/2*k, 1/2 + 1/2*j ] [ 2, -2*i, 1 - 3/2*i - 1/2*k, 1/2 - i - 1/2*j ] 2 [ 1/2 + 1/2*j + k, 1/4*i + 1/2*j + 7/4*k, j, 2*k ] [ 3, -3*i, 2 - 1/2*i - 1/2*k, 5/2 - 2*i - 1/2*j ] 3 [ 1/2 + 1/2*j + k, 1/6*i + 1/3*j + 5/6*k, j + 2*k, 3*k ] [ 201, -201*i, 134 - 67/2*i - 1/2*k, 335/2 - 134*i - 1/2*j ] 201 [ 1/2 + 1/2*j + k, 1/6*i + 1/3*j + 5/6*k, j + 2*k, 3*k ] [ 5, -5*i, 1 - 3/2*i - 1/2*k, 7/2 - i - 1/2*j ] 5 [ 1/2 + 1/2*j + 3*k, 1/10*i + 2/5*j + 41/10*k, j + k, 5*k ] [ 335, -335*i, 201 - 603/2*i - 1/2*k, 67/2 - 201*i - 1/2*j ] 335 [ 1/2 + 1/2*j + 3*k, 1/10*i + 2/5*j + 41/10*k, j + k, 5*k ] > MaxOrders := [RightOrder(I) : I in ideals]; > #MaxOrders; 6 > for u,v in [1..#MaxOrders] do for> if u lt v and IsIsomorphic(MaxOrders[u], MaxOrders[v]) then for|if> print "The following orders are isomorphic", Basis(MaxOrders[u]), Basis(MaxOrders[v]); for|if> end if; for> end for; The following orders are isomorphic [ 1/2 + 1/2*j + k, 1/6*i + 1/3*j + 5/6*k, j + 2*k, 3*k ] [ 1/2 + 1/2*j + k, 1/6*i + 1/3*j + 5/6*k, j + 2*k, 3*k ] The following orders are isomorphic [ 1/2 + 1/2*j + 3*k, 1/10*i + 2/5*j + 41/10*k, j + k, 5*k ] [ 1/2 + 1/2*j + 3*k, 1/10*i + 2/5*j + 41/10*k, j + k, 5*k ] > print "We will use the Gram matrix for , which is the matrix of the scalar product"; We will use the Gram matrix for , which is the matrix of the scalar product > print "The relation is Norm(x) = 1/2 "; The relation is Norm(x) = 1/2 > print "So to find whether Norm(x) represents p,"; So to find whether Norm(x) represents p, > print "Enough to find x such that = 2p"; Enough to find x such that = 2p > for O1 in MaxOrders do for> M := GramMatrix(O1); for> // Print out the gram matrix and the quadratic form for> print M, QuadraticForm(M); for> // check that they all have determinant p^2 for> print Determinant(M), Factorization(Determinant(M)); for> end for; [ 2 0 0 1] [ 0 2 1 0] [ 0 1 34 0] [ 1 0 0 34] 2*x1^2 + 2*x1*x4 + 2*x2^2 + 2*x2*x3 + 34*x3^2 + 34*x4^2 4489 [ <67, 2> ] [168 268 67 268] [268 444 67 469] [ 67 67 134 0] [268 469 0 536] 168*x1^2 + 536*x1*x2 + 134*x1*x3 + 536*x1*x4 + 444*x2^2 + 134*x2*x3 + 938*x2*x4 + 134*x3^2 + 536*x4^2 4489 [ <67, 2> ] [ 168 134 335 402] [ 134 108 268 335] [ 335 268 670 804] [ 402 335 804 1206] 168*x1^2 + 268*x1*x2 + 670*x1*x3 + 804*x1*x4 + 108*x2^2 + 536*x2*x3 + 670*x2*x4 + 670*x3^2 + 1608*x3*x4 + 1206*x4^2 4489 [ <67, 2> ] [ 168 134 335 402] [ 134 108 268 335] [ 335 268 670 804] [ 402 335 804 1206] 168*x1^2 + 268*x1*x2 + 670*x1*x3 + 804*x1*x4 + 108*x2^2 + 536*x2*x3 + 670*x2*x4 + 670*x3^2 + 1608*x3*x4 + 1206*x4^2 4489 [ <67, 2> ] [1240 1675 469 2010] [1675 2274 603 2747] [ 469 603 268 670] [2010 2747 670 3350] 1240*x1^2 + 3350*x1*x2 + 938*x1*x3 + 4020*x1*x4 + 2274*x2^2 + 1206*x2*x3 + 5494*x2*x4 + 268*x3^2 + 1340*x3*x4 + 3350*x4^2 4489 [ <67, 2> ] [1240 1675 469 2010] [1675 2274 603 2747] [ 469 603 268 670] [2010 2747 670 3350] 1240*x1^2 + 3350*x1*x2 + 938*x1*x3 + 4020*x1*x4 + 2274*x2^2 + 1206*x2*x3 + 5494*x2*x4 + 268*x3^2 + 1340*x3*x4 + 3350*x4^2 4489 [ <67, 2> ] > QuadForms := []; > R := PolynomialRing(IntegerRing(), 4); > print "Printing all the quadaratic forms"; Printing all the quadaratic forms > for O1 in MaxOrders do for> f := QuadraticForm(GramMatrix(O1)); for> f := Evaluate(f, [a, b,c,d]); for> print f; for> QuadForms cat:= [f]; for> end for; 2*a^2 + 2*a*d + 2*b^2 + 2*b*c + 34*c^2 + 34*d^2 168*a^2 + 536*a*b + 134*a*c + 536*a*d + 444*b^2 + 134*b*c + 938*b*d + 134*c^2 + 536*d^2 168*a^2 + 268*a*b + 670*a*c + 804*a*d + 108*b^2 + 536*b*c + 670*b*d + 670*c^2 + 1608*c*d + 1206*d^2 168*a^2 + 268*a*b + 670*a*c + 804*a*d + 108*b^2 + 536*b*c + 670*b*d + 670*c^2 + 1608*c*d + 1206*d^2 1240*a^2 + 3350*a*b + 938*a*c + 4020*a*d + 2274*b^2 + 1206*b*c + 5494*b*d + 268*c^2 + 1340*c*d + 3350*d^2 1240*a^2 + 3350*a*b + 938*a*c + 4020*a*d + 2274*b^2 + 1206*b*c + 5494*b*d + 268*c^2 + 1340*c*d + 3350*d^2 > QuadForms; [ 2*a^2 + 2*a*d + 2*b^2 + 2*b*c + 34*c^2 + 34*d^2, 168*a^2 + 536*a*b + 134*a*c + 536*a*d + 444*b^2 + 134*b*c + 938*b*d + 134*c^2 + 536*d^2, 168*a^2 + 268*a*b + 670*a*c + 804*a*d + 108*b^2 + 536*b*c + 670*b*d + 670*c^2 + 1608*c*d + 1206*d^2, 168*a^2 + 268*a*b + 670*a*c + 804*a*d + 108*b^2 + 536*b*c + 670*b*d + 670*c^2 + 1608*c*d + 1206*d^2, 1240*a^2 + 3350*a*b + 938*a*c + 4020*a*d + 2274*b^2 + 1206*b*c + 5494*b*d + 268*c^2 + 1340*c*d + 3350*d^2, 1240*a^2 + 3350*a*b + 938*a*c + 4020*a*d + 2274*b^2 + 1206*b*c + 5494*b*d + 268*c^2 + 1340*c*d + 3350*d^2 ] > print "The first form represents 2p by setting b=1 , d= 2"; The first form represents 2p by setting b=1 , d= 2 > print "Printing Evaluate(QuadForms[1], [0,1,0,2]);"; Printing Evaluate(QuadForms[1], [0,1,0,2]); > Evaluate(QuadForms[1], [0,1,0,2]); 138 > print "Now reduce the forms mod p"; Now reduce the forms mod p > S :=ChangeRing(R, FiniteField(p)); > for i in [2..6] do for> form :=QuadForms[i]; for> print S!form; for> end for; 34*a^2 + 42*b^2 34*a^2 + 41*b^2 34*a^2 + 41*b^2 34*a^2 + 63*b^2 34*a^2 + 63*b^2 > // We see that for all but the first one, > // all require a = b = 0 mod p. > print "Mod p, this requires a= b = 0"; Mod p, this requires a= b = 0 > print "You can check this by computing Kronecker symbols"; You can check this by computing Kronecker symbols > print "Printing print> KroneckerSymbol(-34*42, p), KroneckerSymbol(-34*41, p), KroneckerSymbol(-34*63, p);"; Printing KroneckerSymbol(-34*42, p), KroneckerSymbol(-34*41, p), KroneckerSymbol(-34*63, p); > KroneckerSymbol(-34*42, p), KroneckerSymbol(-34*41, p), KroneckerSymbol(-34*63, p); -1 -1 -1 > // print all the forms, except for the first one > print "printing the factorization all the forms for 2-6 with a=p*a, b=p*b, check whether they represent 2p"; printing the factorization all the forms for 2-6 with a=p*a, b=p*b, check whether they represent 2p > for i in [2..6] do for> f :=QuadForms[i]; for> g := Evaluate(f, [p*a,p*b,c,d]); for> print Factorization(g); for> end for; [ <2, 1>, <67, 1>, <5628*a^2 + 17956*a*b + 67*a*c + 268*a*d + 14874*b^2 + 67*b*c + 469*b*d + c^2 + 4*d^2, 1> ] [ <2, 1>, <67, 1>, <5628*a^2 + 8978*a*b + 335*a*c + 402*a*d + 3618*b^2 + 268*b*c + 335*b*d + 5*c^2 + 12*c*d + 9*d^2, 1> ] [ <2, 1>, <67, 1>, <5628*a^2 + 8978*a*b + 335*a*c + 402*a*d + 3618*b^2 + 268*b*c + 335*b*d + 5*c^2 + 12*c*d + 9*d^2, 1> ] [ <2, 1>, <67, 1>, <41540*a^2 + 112225*a*b + 469*a*c + 2010*a*d + 76179*b^2 + 603*b*c + 2747*b*d + 2*c^2 + 10*c*d + 25*d^2, 1> ] [ <2, 1>, <67, 1>, <41540*a^2 + 112225*a*b + 469*a*c + 2010*a*d + 76179*b^2 + 603*b*c + 2747*b*d + 2*c^2 + 10*c*d + 25*d^2, 1> ] > print "now need to figure out which of factored forms represent 1"; now need to figure out which of factored forms represent 1 > print "From computing the supersingular isogeny graph, we know that there are total 2 curves/ Fp"; From computing the supersingular isogeny graph, we know that there are total 2 curves/ Fp > > > >