intrinsic qJ(q::RngSerElt) -> RngSerLaurElt
{The q-expansion of the J function.}
   E4 := Eisenstein(4,q);
   D := Delta(q);
   return E4^3 / D;
end intrinsic;

intrinsic QuadraticFormula(a::. , b::., c::.) -> ., .
{Compute the roots of a*X^2 + b*X + c.}
   
   K<q> := Parent(a*b*c);

   disc := b^2 - 4*a*c;


   v := -Valuation(disc);
   if not IsEven(v) then
      error "Valuation of discriminant must be even.";
   end if;

   leading_coefficient := Coefficient(q^v*disc,0);

   sqrtdisc := Sqrt(q^v*disc / leading_coefficient) 
                    * q^(-v div 2) * Sqrt(leading_coefficient);


   return (-b + sqrtdisc)/(2*a), (-b - sqrtdisc)/(2*a);

end intrinsic;


