ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 07 Feb 2020 21:03:21 +0100Find order of an Elliptic Curve over Gaussian Integerhttps://ask.sagemath.org/question/49838/find-order-of-an-elliptic-curve-over-gaussian-integer/I am new with Sagemath. I just find out that Sagemath has Elliptic Curve Library and I curious to find out how to find order of an elliptic curve over Gaussian Integer.
p = 107927
G = ZZ[I]
J = G.ideal(p)
Q = G.quotient(J,'x')
a = Q(I)
A = (95385+100114*a)
B = (18724+61222*a)
E = EllipticCurve(Q,[A, B])
E
it will show :
Elliptic Curve defined by y^2 = x^3 + (-7813*I-12542)*x + (-46705*I+18724) over Quotient of Gaussian Integers in Number Field in I with defining polynomial x^2 + 1 with I = 1*I by the ideal (107927)
E.cardinality()
AttributeError: 'EllipticCurve_field_with_category' object has no attribute 'cardinality'
why it shows an error ?
I found the group order is 11648283482 (using python and the program that I made from scratch)
`Fri, 07 Feb 2020 08:18:05 +0100https://ask.sagemath.org/question/49838/find-order-of-an-elliptic-curve-over-gaussian-integer/Answer by rburing for <p>I am new with Sagemath. I just find out that Sagemath has Elliptic Curve Library and I curious to find out how to find order of an elliptic curve over Gaussian Integer.</p>
<pre><code>p = 107927
G = ZZ[I]
J = G.ideal(p)
Q = G.quotient(J,'x')
a = Q(I)
A = (95385+100114*a)
B = (18724+61222*a)
E = EllipticCurve(Q,[A, B])
E
</code></pre>
<p>it will show :
Elliptic Curve defined by y^2 = x^3 + (-7813<em>I-12542)</em>x + (-46705<em>I+18724) over Quotient of Gaussian Integers in Number Field in I with defining polynomial x^2 + 1 with I = 1</em>I by the ideal (107927)</p>
<p>E.cardinality()
AttributeError: 'EllipticCurve_field_with_category' object has no attribute 'cardinality'</p>
<p>why it shows an error ?
I found the group order is 11648283482 (using python and the program that I made from scratch)</p>
<p>`</p>
https://ask.sagemath.org/question/49838/find-order-of-an-elliptic-curve-over-gaussian-integer/?answer=49839#post-id-49839While the quotient you constructed is a valid object, it seems to be not the optimal way to construct the respective mathematical object. Apparently, general `quotient`s of the Gaussian integers `ZZ[I]` currently have only barebones functionality; SageMath doesn't even know when they are finite. However, since `p` is prime (hence maximal) in `ZZ[I]` we can compute the `residue_field` instead (which is a much better implementation of the quotient):
p = 107927
G = ZZ[I]
J = G.ideal(p)
Q.<a> = G.residue_field(J)
A = (95385+100114*a)
B = (18724+61222*a)
E = EllipticCurve(Q,[A, B])
print(E)
print(E.cardinality())
It outputs:
Elliptic Curve defined by y^2 = x^3 + (100114*a+95385)*x + (61222*a+18724) over Residue field in a of Fractional ideal (107927)
11648283482
as you predicted.
---
Alternatively, making use of the third isomorphism theorem:
p = 107927
Q.<a> = GF(p^2, modulus=x^2+1)
This is possibly even faster.Fri, 07 Feb 2020 10:08:51 +0100https://ask.sagemath.org/question/49838/find-order-of-an-elliptic-curve-over-gaussian-integer/?answer=49839#post-id-49839Comment by ed for <p>While the quotient you constructed is a valid object, it seems to be not the optimal way to construct the respective mathematical object. Apparently, general <code>quotient</code>s of the Gaussian integers <code>ZZ[I]</code> currently have only barebones functionality; SageMath doesn't even know when they are finite. However, since <code>p</code> is prime (hence maximal) in <code>ZZ[I]</code> we can compute the <code>residue_field</code> instead (which is a much better implementation of the quotient):</p>
<pre><code>p = 107927
G = ZZ[I]
J = G.ideal(p)
Q.<a> = G.residue_field(J)
A = (95385+100114*a)
B = (18724+61222*a)
E = EllipticCurve(Q,[A, B])
print(E)
print(E.cardinality())
</code></pre>
<p>It outputs:</p>
<pre><code>Elliptic Curve defined by y^2 = x^3 + (100114*a+95385)*x + (61222*a+18724) over Residue field in a of Fractional ideal (107927)
11648283482
</code></pre>
<p>as you predicted.</p>
<hr>
<p>Alternatively, making use of the third isomorphism theorem:</p>
<pre><code>p = 107927
Q.<a> = GF(p^2, modulus=x^2+1)
</code></pre>
<p>This is possibly even faster.</p>
https://ask.sagemath.org/question/49838/find-order-of-an-elliptic-curve-over-gaussian-integer/?comment=49849#post-id-49849Wow, Thank you very much !Fri, 07 Feb 2020 21:03:21 +0100https://ask.sagemath.org/question/49838/find-order-of-an-elliptic-curve-over-gaussian-integer/?comment=49849#post-id-49849