Ask Your Question
2

Problem with factor and imag.

asked 2020-10-17 13:56:49 -0500

lfc gravatar image

updated 2020-10-18 02:01:58 -0500

slelievre gravatar image

I'm new to SageMath, and I'm not sure what's going wrong.

Here are the commands I enter and results I get:

sage: a, b, z = var('a, b, z')
sage: P = a*x - b*x
sage: Q = a*imag(z) - b*imag(z)
sage: P.factor()
(a - b)*x
sage: Q.factor()
0

Why is Q factoring to 0?

edit retag flag offensive close merge delete

Comments

Weird. assume(z, 'complex') seems to help.

rburing gravatar imagerburing ( 2020-10-17 19:16:40 -0500 )edit

Also

sage: Q.simplify_full()                                                         
0
FrédéricC gravatar imageFrédéricC ( 2020-10-18 02:33:42 -0500 )edit

Possible serious bug. Advice requested on sage-devel.

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2020-10-18 07:54:13 -0500 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2020-10-19 01:47:34 -0500

Emmanuel Charpentier gravatar image

This is now Trac#30793, discussed in sage-devel.

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

Stats

Asked: 2020-10-17 13:56:49 -0500

Seen: 82 times

Last updated: yesterday