as long as the power of two dividing the discriminant is not too large, you will get the genus correctly split into spinor genera with my Magma program. I guess I will put samples first. Note that it correctly says the genus of $x^2 + 24 y^2 + 576 z^2$ has four classes, but it prints out four spinor genera with repeat of the one spinor genus, which is nonsense. The trouble first came to my attention about 1996 when Manjul Bhargava was corresponding with Irving Kaplansky, Manjul asked Magma to find all forms alone in a genus, and it gave the wrong answer for $x^2 + 8 y^2 + 64 z^2 \; . \;$ I put good deal of relevant material at [TERNARY][1] [![enter image description here][2]][2] [![enter image description here][3]][3] [![enter image description here][4]][4] [![enter image description here][5]][5] ============================================================================== // http://magma.maths.usyd.edu.au/calc Q:=RationalField(); Z:=Integers(); M3:=MatrixRing(IntegerRing(),3); tolettuce:=function(sixlist) temp := LatticeWithGram(M3![2 * sixlist[1],sixlist[6],sixlist[5], sixlist[6], 2 * sixlist[2],sixlist[4], sixlist[5],sixlist[4],2 * sixlist[3]]); return temp ; end function; tohex := function(lettuce) tripe := Basis(lettuce); return [ Norm( tripe[1] ) div 2 , Norm( tripe[2] ) div 2 , Norm( tripe[3] ) div 2 , InnerProduct( tripe[2],tripe[3] ) , InnerProduct( tripe[3],tripe[1] ) , InnerProduct( tripe[1],tripe[2] ) ] ; end function; temp2 := tolettuce([1, 24, 576, 0, 0, 0]); // CHANGE !!!!!!!!!! tempgenus := GenusRepresentatives(temp2); tempSG := SpinorGenera(Genus(temp2)); print "=====Discriminant " , " ==Genus Size== ", #tempgenus , "\n"; // print "This genus has " , #tempSG , " spinor genera ------\n"; reps := [ Representatives(S) : S in tempSG]; for i in [1..#reps] do tempspin := reps[i]; // print "-------------**---------------------- ", " s. g. size--- ", #tempspin , "\n"; for j in [1..#tempspin] do tohex(tempspin[j]); end for; print "\n---**----- end of spinor genus ", i, " --------\n"; // print "--------------------------------------------------"; end for; ===================================================================================== [1]: http://zakuski.math.utsa.edu/~kap/ [2]: https://i.sstatic.net/xZGIa.png [3]: https://i.sstatic.net/a8IsI.png [4]: https://i.sstatic.net/ZjN35.png [5]: https://i.sstatic.net/gW1Gu.png