Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
2

Number Fields and the Norm

asked 13 years ago

Eric Naslund gravatar image

updated 13 years ago

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 Z[ζ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

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
1

answered 11 years ago

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
Preview: (hide)
link
2

answered 13 years ago

parzan gravatar image

updated 13 years ago

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?

Preview: (hide)
link

Comments

This method also gives the trace :)

Menny gravatar imageMenny ( 13 years ago )

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: 13 years ago

Seen: 1,285 times

Last updated: Dec 20 '13