Ask Your Question

How do I show in sage that an ideal is contained in another?

asked 2020-06-07 13:35:39 +0200

Moondoggy gravatar image

For example I have

       sage: K.<a> = QuadraticField(5)
       OK = K. ring_of_integers ()
       sage: J=ideal(1+7*(1+sqrt(5))/2)

but this does not work.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-06-12 15:37:46 +0200

dan_fulea gravatar image

The following dialog worked for me...

sage: K.<a> = QuadraticField(5)                                                                                               
sage: OK = K.ring_of_integers()                                                                                               
sage: OK.gens()                                                                                                               
(1/2*a + 1/2, a)
sage: g = 1 + 7*(1+a)/2    # can be obviously expressed in terms of OK.gens()                                                 
sage: g in OK                                                                                                                 
sage: J = OK.ideal(g)    # works                                                                                              
sage: J                                                                                                                       
Fractional ideal (7/2*a + 9/2)

It was possible to initialize J, since its generator(s) $\in \mathcal O_K$. But if we try "the same" with some $h$ which is not integral...

sage: h = a/3                                                                                                                 
sage: h in OK                                                                                                                 
sage: H = OK.ideal(h)                                                                                                         
ValueError                                Traceback (most recent call last)
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


Asked: 2020-06-07 13:35:39 +0200

Seen: 193 times

Last updated: Jun 12 '20