First time here? Check out the FAQ!

Ask Your Question
2

i doesn't belong to QQbar ? Why ?

asked 7 years ago

Emmanuel Charpentier gravatar image

updated 2 years ago

tmonteil gravatar image

I do not understand this :

sage: sqrt(1) in QQbar
True
sage: sqrt(-2) in QQbar
True
sage: sqrt(-1) in QQbar
False

Can someone explain ?

Note that, however :

sage: [t[0] in QQbar for t in (x^2+1).roots(ring=QQbar)]
[True, True]
Preview: (hide)

Comments

Still the same bug on SageMath version 8.2, Release Date: 2018-05-05 . Nobody fix this? 0.0

Javidlg gravatar imageJavidlg ( 6 years ago )
1

1) This is not an answer...

2) see the mentioned ticket (as well as thetickets it refers to) to understand why there is not quick-and-easy fix for this one...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 6 years ago )

@Emmanuel Charpentier thanks for 1), my mistake. I decided to move back to linux, so my comment doesnt have sense anymore. Thanks for the feedback!

Javidlg gravatar imageJavidlg ( 5 years ago )

1 Answer

Sort by » oldest newest most voted
3

answered 7 years ago

tmonteil gravatar image

updated 3 years ago

This is definitely a bug, thanks for reporting! As you can see in the source code:

sage: QQbar.__contains__??

the test:

 elif EQ:

which corresponds to:

sage: bool(I == QQbar(I))

leads to:

TypeError: unsupported operand parent(s) for +: 'Number Field in I with defining polynomial x^2 + 1' and 'Algebraic Field'

which is catched to return False.

I have opened trac ticket 24209 for this.

EDIT This issue is fixed now (Sage 9.4-beta3):

sage: sqrt(-1) in QQbar                                                                                                                                                                                      
True
sage: I in QQbar                                                                                                                                                                                             
True
Preview: (hide)
link

Comments

Until Sage 9.3.rc4 I in QQbar returns False. Starting with Sage 9.3.rc5 it returns True.

It must have been solved by Sage Trac ticket 31628: fix/improve conversions to QQbar and AA.

slelievre gravatar imageslelievre ( 3 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

1 follower

Stats

Asked: 7 years ago

Seen: 967 times

Last updated: Jun 27 '21