Function: ellminimaltwist
Section: elliptic_curves
C-Name: ellminimaltwist0
Prototype: GD0,L,
Help: ellminimaltwist(E,{flag=0}): Let E  be an elliptic curve defined over Q,
 return a fundamental discriminant D such that the twist of E by D is minimal
 among all possible quadratic twists. If flag = 0, minimal means having the
 smallest minimal discriminant, if flag = 1, minimal means having the smallest
 conductor.

Doc: Let $E$ be an elliptic curve defined over $Q$, return a fundamental
 discriminant $D$ such that the twist of $E$ by $D$ is minimal among all
 possible quadratic twists. If $\fl = 0$, minimal means having the smallest
 minimal discriminant (see \kbd{ellminimaldisc}), if $\fl = 1$, minimal means
 having the smallest conductor (see \kbd{ellglobalred}).

 In the example below, we find a curve with $j$-invariant $3$ and minimal
 conductor.
 \bprog
 ? E = ellminimalmodel(ellinit(ellfromj(3)));
 ? ellglobalred(E)[1]
 %2 = 357075
 ? D = ellminimaltwist(E,1)
 %3 = -15
 ? E2 = ellminimalmodel(elltwist(E,D));
 ? ellglobalred(E2)[1]
 %5 = 14283
 @eprog
 In the example below, $\fl=0$ and $\fl=1$ give different results.
 \bprog
 ? E = ellinit([4,0]);
 ? D0 = ellminimaltwist(E,0)
 %7 = -8
 ? D1 = ellminimaltwist(E,1)
 %8 = -4
 ? E0 = ellminimalmodel(elltwist(E,D0));
 ? [E0.disc, ellglobalred(E0)[1]]
 %10 = [-64, 64]
 ? E1 = ellminimalmodel(elltwist(E,D1));
 ? [E1.disc, ellglobalred(E1)[1]]
 %12 = [-4096, 32]
 @eprog

Variant: Also available are
 \fun{GEN}{ellminimaltwist}{E} for $\fl=0$, and
 \fun{GEN}{ellminimaltwistcond}{E} for $\fl=1$.
