Ask Your Question
2

Number Fields and the Norm

asked 2011-09-26 07:21:30 -0500

Eric Naslund gravatar image

updated 2011-09-26 07:25:51 -0500

Hello,

I am currently very confused about how to use [Number Fields in Sage].(http://www.sagemath.org/doc/reference/sage/rings/number_field/number_field.html). Things are not working.

Specifically I would like the norm of $\mathbb{Z}[\zeta_5]$ which should be a homogeneous polynomial of degree 4.

I tried:

K.<g> = NumberField(1+x+x^2+x^3+x^4)

a,b,c,d=var('a b c d')

(a+b*g+c*g^2+d*g^3).norm()

However that did not work.

I also tried:

K.<g>=CyclotomicField(5); K

a,b,c,d=var('a b c d')

(a+b*g+c*g^2+d*g^3).norm()

Instead of returning the norm in the Cyclotomic ring, this simply gave me the norm over the complex numbers, that is multiplication by the complex conjugate. These two things are very different, and the norm of the complex number is not at all correct. (It should be degree 4 not degree 2)

Any help is greatly appreciated, thank you

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2011-10-08 03:24:42 -0500

parzan gravatar image

updated 2011-10-11 04:40:30 -0500

I think this is a solution - please tell me if the result is indeed what you wanted to calculate:

sage: K.<g> = NumberField(1+x+x^2+x^3+x^4)
sage: var(','.join(['x%d'%i for i in range(K.degree())]))
(x0, x1, x2, x3)
sage: sum([eval('x%d'%i)*(g^i).matrix() for i in range(K.degree())])
[      x0       x1       x2       x3]
[     -x3  x0 - x3  x1 - x3  x2 - x3]
[-x2 + x3      -x2  x0 - x2  x1 - x2]
[-x1 + x2 -x1 + x3      -x1  x0 - x1]
sage: _.determinant()
x0^4 - x0^3*x1 - x0^3*x2 - x0^3*x3 + x0^2*x1^2 + 2*x0^2*x1*x2 + 2*x0^2*x1*x3 + x0^2*x2^2 - 3*x0^2*x2*x3 + x0^2*x3^2 - x0*x1^3 - 3*x0*x1^2*x2 + 2*x0*x1^2*x3 + 2*x0*x1*x2^2 - x0*x1*x2*x3 - 3*x0*x1*x3^2 - x0*x2^3 + 2*x0*x2^2*x3 + 2*x0*x2*x3^2 - x0*x3^3 + x1^4 - x1^3*x2 - x1^3*x3 + x1^2*x2^2 + 2*x1^2*x2*x3 + x1^2*x3^2 - x1*x2^3 - 3*x1*x2^2*x3 + 2*x1*x2*x3^2 - x1*x3^3 + x2^4 - x2^3*x3 + x2^2*x3^2 - x2*x3^3 + x3^4

In any case, it would be nice to be able to have a variable taking values in K. All these fail, for example:

sage: a=var('a') ; a*g
TypeError: unsupported operand parent(s) for '*': 'Symbolic Ring' and 'Number Field in g with defining polynomial x^4 + x^3 + x^2 + x + 1'
sage: a=var('a',domain=QQ) ; a*g
TypeError: unsupported operand parent(s) for '*': 'Symbolic Ring' and 'Number Field in g with defining polynomial x^4 + x^3 + x^2 + x + 1'
sage: a=var('a',domain=K) ; a*g
TypeError: unsupported operand parent(s) for '*': 'Symbolic Ring' and 'Number Field in g with defining polynomial x^4 + x^3 + x^2 + x + 1'

Does anyone have a suggestion?

edit flag offensive delete link more

Comments

This method also gives the trace :)

Menny gravatar imageMenny ( 2011-10-11 00:14:05 -0500 )edit
1

answered 2013-12-19 21:29:06 -0500

John Cremona gravatar image

I think this works better -- use polynomials, not symbolic expressions. I have written the following in a way which would work for any field in place of K:

sage: K.<g> = CyclotomicField(5)
sage: R = PolynomialRing(K,K.degree(),'x')
sage: sum([R.gen(i)*(g^i).matrix() for i in range(K.degree())]).det()
x0^4 - x0^3*x1 + x0^2*x1^2 - x0*x1^3 + x1^4 - x0^3*x2 + 2*x0^2*x1*x2 - 3*x0*x1^2*x2 - x1^3*x2 + x0^2*x2^2 + 2*x0*x1*x2^2 + x1^2*x2^2 - x0*x2^3 - x1*x2^3 + x2^4 - x0^3*x3 + 2*x0^2*x1*x3 + 2*x0*x1^2*x3 - x1^3*x3 - 3*x0^2*x2*x3 - x0*x1*x2*x3 + 2*x1^2*x2*x3 + 2*x0*x2^2*x3 - 3*x1*x2^2*x3 - x2^3*x3 + x0^2*x3^2 - 3*x0*x1*x3^2 + x1^2*x3^2 + 2*x0*x2*x3^2 + 2*x1*x2*x3^2 + x2^2*x3^2 - x0*x3^3 - x1*x3^3 - x2*x3^3 + x3^4

As already mentioned, one can just as easily get the trace or even the characteristic polynomial of a general element:

sage: M = sum([R.gen(i)*(g^i).matrix() for i in range(K.degree())])
sage: M.trace()
4*x0 - x1 - x2 - x3
sage: M.charpoly('t')
t^4 + (-4*x0 + x1 + x2 + x3)*t^3 + (6*x0^2 - 3*x0*x1 + x1^2 - 3*x0*x2 + 2*x1*x2 + x2^2 - 3*x0*x3 + 2*x1*x3 - 3*x2*x3 + x3^2)*t^2 + (-4*x0^3 + 3*x0^2*x1 - 2*x0*x1^2 + x1^3 + 3*x0^2*x2 - 4*x0*x1*x2 + 3*x1^2*x2 - 2*x0*x2^2 - 2*x1*x2^2 + x2^3 + 3*x0^2*x3 - 4*x0*x1*x3 - 2*x1^2*x3 + 6*x0*x2*x3 + x1*x2*x3 - 2*x2^2*x3 - 2*x0*x3^2 + 3*x1*x3^2 - 2*x2*x3^2 + x3^3)*t + x0^4 - x0^3*x1 + x0^2*x1^2 - x0*x1^3 + x1^4 - x0^3*x2 + 2*x0^2*x1*x2 - 3*x0*x1^2*x2 - x1^3*x2 + x0^2*x2^2 + 2*x0*x1*x2^2 + x1^2*x2^2 - x0*x2^3 - x1*x2^3 + x2^4 - x0^3*x3 + 2*x0^2*x1*x3 + 2*x0*x1^2*x3 - x1^3*x3 - 3*x0^2*x2*x3 - x0*x1*x2*x3 + 2*x1^2*x2*x3 + 2*x0*x2^2*x3 - 3*x1*x2^2*x3 - x2^3*x3 + x0^2*x3^2 - 3*x0*x1*x3^2 + x1^2*x3^2 + 2*x0*x2*x3^2 + 2*x1*x2*x3^2 + x2^2*x3^2 - x0*x3^3 - x1*x3^3 - x2*x3^3 + x3^4
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2011-09-26 07:21:30 -0500

Seen: 301 times

Last updated: Dec 19 '13