$\DeclareMathOperator\Sha{Sha}$I calculated the Tate–Shafarevich group $\Sha(E/K)[2]$ of the elliptic curve $E:y^2=x^3+17x$ over $K=\Bbb{Q}(\sqrt{-37})$.


I calculated that by hand and I reached the conclusion that $\Sha(E/K)[2]$ has order $1$ or $4$.


Magma code



```
K<b>:=QuadraticField(-37);
A:=EllipticCurve([K!0,0,0,17,0]); 
Sel2:=TwoSelmerGroup(A); Sel2;
K<b>:=QuadraticField(-37); 
A:=EllipticCurve([K!0,0,0,17,0]); 
Tor:=TorsionSubgroup(A); Tor;
 
E := EllipticCurve([0,0,0,17,0]);  // Define your elliptic curve E
Q := QuadraticTwist(E, -37);  // Compute the quadratic twist of E by -37
rank := Rank(Q);  // Calculate the rank of the quadratic twist rank;

```

outputs



```
Abelian Group isomorphic to Z/2 + Z/2 + Z/2 Defined on 3 generators in
supergroup:
    Sel2.1 = $.1 + $.5
    Sel2.2 = $.7
 Sel2.3 = $.8 Relations:
    2*Sel2.1 = 0
    2*Sel2.2 = 0
    2*Sel2.3 = 0 Abelian Group isomorphic to Z/2 Defined on 1 generator Relations:
    2*Tor.1 = 0 \
    2

```

Thus Magma reads $\Sha(E/K)[2]\cong ((\Bbb{Z}/2\Bbb{Z})^3/((\Bbb{Z} /2\Bbb{Z})\times (\Bbb{Z}/2\Bbb{Z})^2 )\cong 0$
($E\_{tor}$ is isomorphic to $\Bbb{Z}/2\Bbb{Z}$ and last '2' means rank of twist $E\_{-37}$ over $\Bbb{Q}$ is $2$. $rank(E/\Bbb{Q})=0$, thus $rank(E/\Bbb{Q}(\sqrt{-37})=rank(E/\Bbb{Q})+rank(E\_{-37}/\Bbb{Q})=0+2=2$.


On the other hand, Sage Math's code thanks to Chris Wuthrich's [comment](https://mathoverflow.net/questions/450213/does-17x4y2-1-have-solution-in-bbbq-2-sqrt-5#comment1163693_450213) on [Does $17x^4+y^2=-1$ have solution in $\Bbb{Q}\_2(\sqrt{-5})$?](https://mathoverflow.net/questions/450213/does-17x4y2-1-have-solution-in-bbbq-2-sqrt-5):



```
sage: E = EllipticCurve([17,0]) 
sage: K.<t> = QuadraticField(-37) 
sage: EK = E.base_extend(K) 
sage: EK.simon_two_descent(verbose=4)

```

outputs $\Sha(E/K)[2]$ is nontrivial.


Why does this discrepancy occur and which is the correct Tate–Shafarevich group?



Discrepancy in Magma's calculation and Sage's of elliptic curve?
Well spotted. This is a problem. After quite a bit of fiddling I found that the error is in Denis Simon's script used by Sage.
In fact, when executed with higher values of the parameters so that the script finds the rational points, it also prints the correct information.


The command



```
K.<t> = QuadraticField(-37)
E = EllipticCurve([K(17),K(0)])
E.simon_two_descent(lim1=10,lim3=50,limtriv=10, verbose=3)

```

prints correctly



```
[E(K):phi'(E'(K))] >= 2
#S^(phi')(E'/K)     = 8
#III(E'/K)[phi']   <= 4

[E'(K):phi(E(K))]   = 8
#S^(phi)(E/K)       = 8
#III(E/K)[phi]      = 1

#III(E/K)[2]       <= 4
#E(K)[2]            = 2
#E(K)/2E(K)        >= 8

2 <= rank          <= 4

```

When executed with lower parameter it produces the incorrect information



```
2 <= #III(E/K)[2]       <= 8

```

I believe the script actually performs the correct calculations, but the part that draws these conclusions about the Tate-Shafarevich group has a bug in it. With the (correct) information that has been calculated before that line, the correct conclusion would be that $Ш(E/K)[2]$ has between $1$ and $2^3$ elements.


Magma is consistent. The following



```
K<b> := QuadraticField(-37);
A:=EllipticCurve([K!0,0,0,17,0]); 
"Torsion::", TorsionSubgroup(A); 
"Selmer Group::", TwoSelmerGroup(A); 
"Rank::", Rank(A);
"Generators::", Generators(A);
T := A![0,0];
phi := TwoIsogeny(T);
"Phi-Selmer group ::", SelmerGroup(phi);
phihat := DualIsogeny(phi);
"Phi hat =Selmer group ::", SelmerGroup(phihat);

```

returns the information about the descent by isogenies and for the full $2$-Selmer group, rather than only the ones by isogenies.
Let $\varphi \colon E\to E'$ is the isogeny with kernel $\{O,(0,0)\}$. The $\phi$-Selmer group $\operatorname{Sel}^{\phi}(E/K)$ has dimension $3$ and so does the $\hat\phi$-Selmer group $\operatorname{Sel}^{\hat{\phi}}(E'/K)$. The $2$-Selmer group $\operatorname{Sel}^{2}(E/K)$ is also of dimension $3$, which means that the image of $\operatorname{Sel}^{\hat{\phi}}(E'/K) \to Ш(E'/K)/\phi(Ш(E/K))$ has dimension $2$. One finds that $Ш(E'/K)[\hat\varphi]$ is of order $2$, but the Tate-Shafarevich group of $E/K$ has a trivial $2$-part.


This is constistant with the Birch and Swinnerton-Dyer conjecture, I believe.


