Ask Your Question
0

Zero check for certain numbers fail

asked 2 years ago

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.

Preview: (hide)

Comments

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

vdelecroix gravatar imagevdelecroix ( 2 years ago )

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

philipp7 gravatar imagephilipp7 ( 2 years ago )

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

vdelecroix gravatar imagevdelecroix ( 2 years ago )

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 ( 2 years ago )

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 ( 2 years ago )

1 Answer

Sort by » oldest newest most voted
0

answered 2 years ago

Emmanuel Charpentier gravatar image

updated 2 years ago

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,

Preview: (hide)
link

Comments

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

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2 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: 2 years ago

Seen: 202 times

Last updated: Dec 15 '22