Computational algebraic number theory

238 Views Asked by At

I'm a college student and my semester on ``basic" algebraic number theory course has started. The most `exciting" part of elementary number theory to me is that you can churn out some nice number theoretic calculation in c++/python and have some nice conjectures and then you can prove it theoretically which is really nice ! Or you can just fiddle around with them to have some intuition which is really valuable in general.

So I wanna do the same for algebraic number theory. Can you people recommend some software/books so that I calculate basic ANT stuff like for example checking whether the ring of integers of a number field is UFD or not, if it's UFD then checking how primes in $\mathcal{O}_{\mathbb{Q}}$ factor over $\mathcal{O}_{K} $, or for example when $L$ is an extension of $K$ then how primes in $\mathcal{O}_K$ factorizes in $\mathcal{O}_L$, ``density" of primes in that ring of integers etc etc ?

I tried Mathematica but then some people suggested that it won't be fit for my use, and then some other people suggested SageMath but I don't know how to use it for such purposes (the documentation looks to boring for me to read fully). I also know C++/Python but I don't know how to implement the algorithms for doing so (and the algorithms themselves are probably too tricky/time consuming to figure out by myself; and I am not sure whether figuring out the algorithms by myself would be a productive effort or not).

All in all: I want to know some programming languages/algorithms which are easily implemented by some non-CS student to be able to perform computational ANT experiments to have some nice conjectures and some concrete intuition in ANT.

1

There are 1 best solutions below

0
On

pari/gp is open source, easy to install, and has lots of dedicated number theory. Here is a random bit of code to get you started:

    bnf=bnfinit(x^2 + 163);
    nf=nfinit(x^2 + 163);
    bnfclgp(bnf)
    for(n=1,13,print([prime(n)," ",idealprimedec(nf,prime(n))]))
    q=idealprimedec(nf,41)[1];
    idealnorm(nf,q)
    bnfisprincipal(bnf,q)
    coeff=bnfisprincipal(bnf,q)[2]~;
    w=(coeff[1]*nf[7][1] + coeff[2]*nf[7][2]) * Mod(1,nf[1]);
    idealnorm(nf,w)

which tells you: $\mathbf{Q}(\sqrt{-163})$ has class number one, gives the decomposition of the first few primes, takes a prime $P$ above $41$, computes that it is principal, finds a generator which is $w$ and checks that has norm $41$.

    bnfa=bnfinit(x^2 + 79);
    nfa=nfinit(x^2 + 79);
    bnfclgp(bnfa)
    for(n=1,13,print([prime(n)," ",idealprimedec(nfa,prime(n))]))
    q=idealprimedec(nfa,5)[1];
    bnfisprincipal(bnfa,q)
    bnfisprincipal(bnfa,idealpow(nfa,q,5))
    coeffa=bnfisprincipal(bnfa,idealpow(nfa,q,5))[2]~;
    v=(coeffa[1]*nfa[7][1] + coeffa[2]*nfa[7][2]) * Mod(1,nfa[1]);
    idealnorm(nfa,v)

which tells you: $\mathbf{Q}(\sqrt{-79})$ has class number $5$, gives the decomposition of the first few primes, takes a prime $P$ above $5$, computes that it is not principal (it has computed the class group is cyclic of order $5$ with some specific generator and $P$ in the internal basis is the element "2 mod 5"), but checks that $P^5$ is principal, finds a generator which is $v$ and checks that has norm $5^5 = 3125$. Here is the output obtained by piping in the lines above:

    PARI/GP is free software, covered by the GNU General Public License, and
    comes WITHOUT ANY WARRANTY WHATSOEVER.

    Type ? for help, \q to quit.
    Type ?12 for how to get moral (and possibly technical) support.

    parisize = 8000000, primelimit = 500000
    %3 = [1, [], []]
    [2, " ", [[2, [2, 0]~, 1, 2, [1, 0]~]]]
    [3, " ", [[3, [3, 0]~, 1, 2, [1, 0]~]]]
    [5, " ", [[5, [5, 0]~, 1, 2, [1, 0]~]]]
    [7, " ", [[7, [7, 0]~, 1, 2, [1, 0]~]]]
    [11, " ", [[11, [11, 0]~, 1, 2, [1, 0]~]]]
    [13, " ", [[13, [13, 0]~, 1, 2, [1, 0]~]]]
    [17, " ", [[17, [17, 0]~, 1, 2, [1, 0]~]]]
    [19, " ", [[19, [19, 0]~, 1, 2, [1, 0]~]]]
    [23, " ", [[23, [23, 0]~, 1, 2, [1, 0]~]]]
    [29, " ", [[29, [29, 0]~, 1, 2, [1, 0]~]]]
    [31, " ", [[31, [31, 0]~, 1, 2, [1, 0]~]]]
    [37, " ", [[37, [37, 0]~, 1, 2, [1, 0]~]]]
    [41, " ", [[41, [0, 2]~, 1, 1, [2, 2]~], [41, [2, 2]~, 1, 1, [0, 2]~]]]
    %5 = 41
    %6 = [[]~, [0, 1]~]
    %9 = 41
    %12 = [5, [5], [[2, 1; 0, 1]]]
    [2, " ", [[2, [-1, 1]~, 1, 1, [0, 1]~], [2, [2, 1]~, 1, 1, [1, 1]~]]]
    [3, " ", [[3, [3, 0]~, 1, 2, [1, 0]~]]]
    [5, " ", [[5, [0, 2]~, 1, 1, [2, 2]~], [5, [2, 2]~, 1, 1, [0, 2]~]]]
    [7, " ", [[7, [7, 0]~, 1, 2, [1, 0]~]]]
    [11, " ", [[11, [-2, 2]~, 1, 1, [4, 2]~], [11, [4, 2]~, 1, 1, [-2, 2]~]]]
    [13, " ", [[13, [-4, 2]~, 1, 1, [6, 2]~], [13, [6, 2]~, 1, 1, [-4, 2]~]]]
    [17, " ", [[17, [17, 0]~, 1, 2, [1, 0]~]]]
    [19, " ", [[19, [-3, 2]~, 1, 1, [5, 2]~], [19, [5, 2]~, 1, 1, [-3, 2]~]]]
    [23, " ", [[23, [-5, 2]~, 1, 1, [7, 2]~], [23, [7, 2]~, 1, 1, [-5, 2]~]]]
    [29, " ", [[29, [29, 0]~, 1, 2, [1, 0]~]]]
    [31, " ", [[31, [-12, 2]~, 1, 1, [14, 2]~], [31, [14, 2]~, 1, 1, [-12, 2]~]]]
    [37, " ", [[37, [37, 0]~, 1, 2, [1, 0]~]]]
    [41, " ", [[41, [41, 0]~, 1, 2, [1, 0]~]]]
    %14 = [[2]~, [0, -1/4]~]
    %15 = [[0]~, [-55, -4]~]
    %18 = 3125
    Goodbye!