Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: ELLIPTIC CURVE #18680

Closed

Conversation

abhinav-anand-addepar
Copy link
Member

revives #2449

  • ntheory
    • implemented elliptic curve

@sympy-bot
Copy link

🟠

Hi, I am the SymPy bot (v151). I've noticed that some of your commits add or delete files. Since this is sometimes done unintentionally, I wanted to alert you about it.

This is an experimental feature of SymPy Bot. If you have any feedback on it, please comment at sympy/sympy-bot#75.

The following commits add new files:

  • 5dac6fa:
    • sympy/ntheory/ec.py
    • sympy/ntheory/test_elliptic.py

If these files were added/deleted on purpose, you can ignore this message.

@sympy-bot
Copy link

Hi, I am the SymPy bot (v151). I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

Your release notes are in good order.

Here is what the release notes will look like:

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.6.

Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it.

Click here to see the pull request description that was parsed.

revives #2449 

<!-- BEGIN RELEASE NOTES -->
* ntheory
  * implemented  elliptic curve 
<!-- END RELEASE NOTES -->

@jksuom
Copy link
Member

jksuom commented Feb 18, 2020

You should preserve the original commits in #2449. After fetching the PR, you should only add new commits to the same branch.

@abhinav-anand-addepar
Copy link
Member Author

could you tell me how to fetch that pr.

from .residue_ntheory import sqrt_mod


class EllipticCurve():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, () can be removed.

The default domain is ``QQ``. If no coefficient ``a1``, ``a2``, ``a3``,
it create curve as following form.
`y^{2} = x^{3} + a_{4} x + a_{6}`
Examples
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty line is needed here.

`y^{2} = x^{3} + a_{4} x + a_{6}`
Examples
========
References
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

[3] G. Hardy, E. Wright "An Introduction to the Theory of Numbers" Sixth Edition
"""

def __init__(self, a4, a6, a1=0, a2=0, a3=0, domain=QQ):
Copy link
Member

@czgdp1807 czgdp1807 Feb 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, in SymPy, __new__ is used as a constructor.

elif isinstance(self._domain, RationalField):
self._rank = None

def __call__(self, x, y, z=1):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this?

def minimal(self):
"""
Return minimal Weierstrass equation.
Examples
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty line is needed here.

+1

Return minimal Weierstrass equation.
Examples
========
>>> from sympy.ntheory.ec import EllipticCurve
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@jksuom
Copy link
Member

jksuom commented Feb 18, 2020

I think that git fetch origin pull/2449/head:elliptic-curve should create a new branch with the original commits.

i += 1
if p.z == 0:
return i
return oo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new line is needed at the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants