(16:46) gp > f=x^2 - x + 6; \\ quadratic field of disc -23 (16:47) gp > F=bnfinit(f); \\ a bnf has more data than what you get \\ from nfinit, in particular info about the class group \\ and the unit group (16:47) gp > F.clgp %3 = [3, [3], [[2, 1; 0, 1]]] \\ the class group of F is Z/3Z; see \\ docs for more info (16:47) gp > pl=idealprimedec(F,2); \\ primes over 2 (16:47) gp > #pl \\ how many %5 = 2 \\ 2, so split (16:47) gp > p=pl[1]; \\ pick one (16:47) gp > idealnorm(F,p) \\ ideal norm %7 = 2 \\ as expected (16:48) gp > bnfisprincipal(F,p) \\ is this ideal principal? %8 = [[1]~, [1, 0]~] \\ this means no, it's not. in fact \\ the [1]~ means it's a generator of the class group (16:48) gp > pl=idealprimedec(F,3); \\ primes over 3 (16:48) gp > q=pl[1] \\ one of them %10 = [3, [-1, 1]~, 1, 1, [0, -6; 1, 1]] \\ gp's data for an ideal (16:48) gp > idealnorm(F,q) \\ ideal norm %11 = 3 \\ again what we expect (16:49) gp > pq = idealmul(F,p,q) \\ product of ideals p and q %12 = [6 5] [0 1] (16:49) gp > idealnorm(F,pq) %13 = 6 \\ this ideal has norm 6 (16:49) gp > bnfisprincipal(F,pq) \\ is it principal? %14 = [[0]~, [-1, 1]~] \\ yes, the [0]~ means trivial class