Function: elltwist
Section: elliptic_curves
C-Name: elltwist
Prototype: GDG
Help: elltwist(E,{P}): returns the coefficients [a1,a2,a3,a4,a6] of
 the twist of the elliptic curve E by the quadratic extension defined by
 P (when P is a polynomial of degree 2) or quadpoly(P) (when P is an integer).
 If E is defined over a finite field, then P can be omitted.
Doc: returns the coefficients $[a_1,a_2,a_3,a_4,a_6]$ of the twist of the
 elliptic curve $E$ by the quadratic extension of the coefficient ring
 defined by $P$ (when $P$ is a polynomial) or \kbd{quadpoly(P)} when $P$ is an
 integer.  If $E$ is defined over a finite field, then $P$ can be omitted,
 in which case a random model of the unique non-trivial twist is returned.
 If $E$ is defined over a number field, the model should be replaced by a
 minimal model (if one exists).

 Example: Twist by discriminant $-3$:
 \bprog
 ? elltwist(ellinit([0,a2,0,a4,a6]),-3)
 %1 = [0,-3*a2,0,9*a4,-27*a6]
 @eprog
 Twist by the Artin-Shreier extension given by $x^2+x+T$ in
 characteristic $2$:
 \bprog
 ? lift(elltwist(ellinit([a1,a2,a3,a4,a6]*Mod(1,2)),x^2+x+T))
 %1 = [a1,a2+a1^2*T,a3,a4,a6+a3^2*T]
 @eprog
 Twist of an elliptic curve defined over a finite field:
 \bprog
 ? E=ellinit([1,7]*Mod(1,19));lift(elltwist(E))
 %1 = [0,0,0,11,12]
 @eprog
