Ask Your Question
0

Zero check for certain numbers fail

asked 2022-12-15 10:03:53 +0100

philipp7 gravatar image

The following zero check yields an error in my copy of Sage (version 9.5):

real_part(log(QQbar((-1)^(1/3)))).is_zero()

The result of the computation should be True. The entire error message can be found here: https://pastebin.com/iYNjuwZJ I also checked the Sage Cell Server and the same error appears there. I could not find anything related on the Trac server. However, since I have no idea what is going wrong here, my search was very limited.

edit retag flag offensive close merge delete

Comments

From the log it seems that your sage is missing maxima. Could you try to run the command maxima(1)?

vdelecroix gravatar imagevdelecroix ( 2022-12-18 10:41:44 +0100 )edit

maxima(1) works in my installation and gives me a sage.interfaces.maxima.MaximaElement object.

philipp7 gravatar imagephilipp7 ( 2022-12-19 08:59:16 +0100 )edit

Could you give more details about your setup (operating system, how you did install Sage).

vdelecroix gravatar imagevdelecroix ( 2023-01-20 20:21:33 +0100 )edit

I install it by calling makeafter cloning form the github repo as described here: https://ask.sagemath.org/question/431... My OS is openSUSE Leap 15.2

philipp7 gravatar imagephilipp7 ( 2023-01-25 09:21:41 +0100 )edit

Then there was probably a problem in the compilation process. If you want a diagnosis you should post the files $SAGE_ROOT/config.log, $SAGE_ROOT/config.status and possibly the full $SAGE_ROOT/logs/install.log.

vdelecroix gravatar imagevdelecroix ( 2023-01-25 09:44:15 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-12-15 13:59:14 +0100

Emmanuel Charpentier gravatar image

updated 2022-12-15 14:02:18 +0100

WorksForMe(TM) in 9.8.beta4 :

sage: (-1)^(1/3)
(-1)^(1/3)
sage: QQbar((-1)^(1/3))
0.500000000000000? + 0.866025403784439?*I
sage: log(QQbar((-1)^(1/3)))
log(0.500000000000000? + 0.866025403784439?*I)
sage: real_part(log(QQbar((-1)^(1/3))))
log(1.000000000000000?)
sage: real_part(log(QQbar((-1)^(1/3)))).is_zero()
True

But beware : x^3+1==0 has three roots, whereas (-1)^(1/3) denotes only one of them. You should check :

sage: [u[0].log().real_part().is_zero() for u in (x^3+1).roots()]
[True, True, True]

or, if you prefer,

sage: [real_part(log(u.rhs())).is_zero() for u in solve(x^3+1==0, x)]
[True, True, True]

HTH,

edit flag offensive delete link more

Comments

BTW : this "triple check" isn't really necessary. Guess why...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2022-12-16 08:26:33 +0100 )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: 2022-12-15 10:03:53 +0100

Seen: 166 times

Last updated: Dec 15 '22