Ask Your Question

i want to define field \mathbb Q (\sqrt 2,\sqrt 3) what command should use?

asked 2018-10-19 09:23:40 +0200

anonymous user


updated 2019-03-07 05:04:51 +0200

i tried doing it by spiliting field comand but it is not working ,if possible let me know about spliting field commands also

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2018-10-19 13:33:55 +0200

rburing gravatar image

updated 2018-10-19 13:35:27 +0200

You can do the following:

R.<x> = PolynomialRing(QQ)
f = (x^2-2)*(x^2-3)
K.<a> = f.splitting_field()

Note that f.splitting_field() requires a name for the primitive element of the field (a here), which is passed here by using the shorthand notation, as shown in the documentation.

To identify the elements of the splitting field K which correspond to the roots of f you can do e.g.


or in this case also something like

edit flag offensive delete link more

answered 2018-10-19 14:30:27 +0200

slelievre gravatar image

The most natural way is probably as follows.

sage: K = QQ[sqrt(2), sqrt(3)]
sage: K.inject_variables()
Defining sqrt2, sqrt3
sage: (sqrt2 + sqrt3)^2
2*sqrt3*sqrt2 + 5

The case of adjoining two algebraic numbers with the same minimal polynomial is more involved, see:

edit flag offensive delete link more

answered 2018-10-19 17:57:08 +0200

tmonteil gravatar image

Alternatively, you can do:

sage: number_field_elements_from_algebraics([QQbar(2).sqrt(), QQbar(3).sqrt()],minimal=True, same_field=True)
(Number Field in a with defining polynomial y^4 - 4*y^2 + 1,
 [-a^3 + 3*a, -a^2 + 2],
 Ring morphism:
   From: Number Field in a with defining polynomial y^4 - 4*y^2 + 1
   To:   Algebraic Field
   Defn: a |--> 0.5176380902050415?)
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

1 follower


Asked: 2018-10-19 09:23:40 +0200

Seen: 1,289 times

Last updated: Mar 07 '19