Ask Your Question
2

i doesn't belong to QQbar ? Why ?

asked 2017-11-12 13:55:13 -0500

Emmanuel Charpentier gravatar image

updated 2017-11-13 03:30:54 -0500

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]
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
3

answered 2017-11-12 18:12:08 -0500

tmonteil gravatar image

updated 2017-11-12 18:12:45 -0500

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 flag offensive delete link more
0

answered 2018-08-03 07:46:47 -0500

Javidlg gravatar image

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

edit flag offensive delete link more

Comments

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 ( 2018-08-03 14:08:11 -0500 )edit

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: 2017-11-12 13:55:13 -0500

Seen: 171 times

Last updated: Aug 03