Ask Your Question
0

simplify not working correctly with conjugate?

asked 2019-09-08 18:55:07 +0200

Rutger gravatar image

In my notebook environment when I do this :

var('v','a')
t=(I*a/2)*(v-conjugate(v))
(t**3).expand()

It gives me the correct result. However when I do :

(t**3).expand().simplify()

The answer I get is zero. Is this a bug, or is there something I don't understand about the simplify function? Additionally: Is there another, better way to simplify expressions with many conjugates?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-09-08 21:52:19 +0200

eric_g gravatar image

Well, it seems that when using conjugate, you have to specify that the involved symbolic variables are complex. Indeed one has

sage: (x - conjugate(x)).simplify()
0
sage: v = var('v')
sage: (v - conjugate(v)).simplify()
0

(I am a little bit puzzled by this, since I thought Sage's symbolic variables are assumed complex by default)

But

sage: v = var('v', domain='complex')
sage: (v - conjugate(v)).simplify()
v - conjugate(v)

and

sage: v = var('v')
sage: assume(v, 'complex')
sage: (v - conjugate(v)).simplify()
v - conjugate(v)

So, regarding your example, you have to use var('a', 'v', domain='complex') in the first line.

edit flag offensive delete link more

Comments

Great, Thanks a lot!

Rutger gravatar imageRutger ( 2019-09-08 22:32:52 +0200 )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

Stats

Asked: 2019-09-08 18:55:07 +0200

Seen: 330 times

Last updated: Sep 08 '19