7 ms·
Show HN: Algebraic Number Theory in Python 3
- druml 9y agoIs the library published on PyPI?
- Labo333 9y agoNo but you can install any library from github with pip install --upgrade git+[URL]
- williamstein 9y agoYou can also publish anything to pypi in like 5 minutes. Go for it.
- Labo333 9y agoYes but I don't want to manage version numbers and release a new one each time I push a commit to my repo. Also anyone can take the code s/he wants directly. Do you have some kind of automatic pypi release system?
- Labo333 9y agoI did it https://pypi.python.org/pypi/algnuth https://pypi.python.org/pypi/algnuth :) I didn't know it was so important but I learn every day!
- adenadel 9y agoIt seems like this should be a part of Sage rather than a standalone library.
- mixedmath 9y agoI believe all this functionality is already within sage, except for the Solovay-Strassen primality test.
- Labo333 9y agoI don't think Sage has the Jacobi symbol (just the Legendre), but Jacobi and Solovay-Strassen are less than 20 lines. Anyway, the goal was to provide very simple and readable implementations. Sage is far more powerful. Also, I think Sage uses square free factorisation algorithms that run much faster than Berlekamp. Anyway, we had much fun coding that and I really didn't expect to receive so many uovotes!
- mixedmath 9y agoNo, it's good work. Sage is hard to read, and your code is easy to read. Good job!
- Labo333 9y agoThanks a lot :)
- williamstein 9y agoIndeed, Sage can be difficult to read, because our primary motivation is speed and scalable to support cutting edge research. If you don't know about it, you might find https://pypi.python.org/pypi/NZMATH https://pypi.python.org/pypi/NZMATH useful; it's BSD-licensed pure python number theory code.
- williamstein 9y ago(I'm the guy who started Sage.) Sage has the Jacobi symbol as of 7 years ago (see https://trac.sagemath.org/ticket/11138 https://trac.sagemath.org/ticket/11138 and https://github.com/sagemath/sage/blob/07d6c37d18811e2b377a9689790a7c5e24da16ba/src/sage/arith/misc.py#L3426 https://github.com/sagemath/sage/blob/07d6c37d18811e2b377a96...). Sage is pretty good at primality testing, because PARI is. I'm really glad that the author of this library is enjoying writing Algebraic number theory that is readable and in Python3. Go for it, and have fun!
- mbid 9y agoNot really what people/mathematicians would generally understand as "algebraic number theory". More like computational number theory or computational algebra.
- Labo333 9y agoIndeed :) But what did you expect when you clicked on a github link?
- williamstein 9y agoI think it's OK -- the things he's computing do fall within what mathematicians call "algebraic number theory". (I wrote a book on Algebraic Number Theory: https://wstein.org/books/ant/ https://wstein.org/books/ant/)
- Labo333 9y agoWow the adelic point of view is totally new for me!!! I add your book to my bookmarks and will definitely read it. It's really nice to make a chapter on elliptic curves, it's one of my domains of research (ECC). I have codes for CRT and Pell's equation as well, maybe I will upload them.
- ableal 9y ago"Origin of the name - In local class field theory, the group of units of the local field plays a central role. In global class field theory, the idele class group takes this role (see also the definition of the idele class group). The term "idele" is a variation of the term ideal. Both terms have a relation, see the theorem about the relation between the ideal class group and the idele class group. The term "idele" (French: idèle) is an invention of the French mathematician Claude Chevalley (1909–1984) and stands for "ideal element" (abbreviated: id.el.). The term "adele" (adèle) stands for additive idele." https://en.wikipedia.org/wiki/Adele_ring https://en.wikipedia.org/wiki/Adele_ring (Took me a few minutes just to get that - reminder, bring diving gear when venturing into math waters ;-)
- Labo333 9y ago
- FredrikMeyer 9y agoNice! Even though this is implemented before, it is easy to read (and if you only need simple functions, downloading Sage is a bit of a overkill (there is an online version of Sage which I used a lot during my PhD though!)). I like seeing simple implementations of things like this - inspiring for others thinking of similar things!
- williamstein 9y ago> (there is an online version of Sage ...) They are http://sagecell.sagemath.org/ http://sagecell.sagemath.org/ and https://cocalc.com https://cocalc.com