//////////////////////////////////////////////////////////////////
// This code determines the rational points on X618
//////////////////////////////////////////////////////////////////

   A3<x,y,w> := AffineSpace(Rationals(),3);
   // Singular model of X618 is 

      X618 := Curve(A3, [w^2 + 4*x^2 - 2*x*y - 8*x + 4*y + 4, x^3 + x^2 - 3*x + 1 - y^2]);
      Xcan := Image(CanonicalMap(X618));
       P2<x,y,z> := AmbientSpace(Xcan);
       Xcan := Curve(P2,MinimizeReducePlaneQuartic(DefiningEquation(Xcan)));
   // Smooth quartic model of X618 is thus the one below
       
   K<a> := QuadraticField(2);
   R<x,y,z> := PolynomialRing(K,3);          
   f := x^4 + x^2*y^2 + 2*x^2*z^2 - y^3*z + 2*y*z^3;
   C := Curve(ProjectiveSpace(K,2),f);
   aut1 := iso<C->C|[x,(1/2)*a*y-z,(-1/2)*y-(1/2)*a*z],[x,(1/2)*a*y-z,(-1/2)*y-(1/2)*a*z]>;
   A := AutomorphismGroup(C,[aut1]);
   X, mp := CurveQuotient(A);
   pt := C![0,1,0];
   P := mp(pt);
   E, psi := EllipticCurve(X,P);
   E2, psi2 := MinimalModel(E);
   MordellWeilShaInformation(E2);
   PHI := mp*psi*psi2;
   PP1 := (E2![0,1,0])@@PHI;
   PP2 := (E2![a+1,0,1])@@PHI;
   RationalPoints(PP1);
   RationalPoints(PP2);
   // The only rational points on X618 over Q(a), where a = sqrt(2) are
   // (0 : -a : 1), (0 : a : 1), (0 : 1 : 0), (0 : 0 : 1)
