A bug in simplify_rational() function?

asked 2017-11-26 13:35:08 +0200

When I run the following

var('z')
( 1/z + 1/z.conjugate() ).simplify_rational()

on sage-8.0 / Ubuntu 16.04 LTS, I get the following answer, which is evidently wrong.

2/z

Can anyone explain why this phenomenon happens? It it a bug in simplify_rational() function?

edit retag flag offensive close merge delete

Comments

The following dialog with the sage interpreter may highlight the implicit assumption:

sage: var('z')
z
sage: ( 1/z + 1/z.conjugate() ).simplify_rational()
2/z
sage: assume( z, 'complex' )
sage: ( 1/z + 1/z.conjugate() ).simplify_rational()
(z + conjugate(z))/(z*conjugate(z))
sage: ?assume
sage: forget()
sage: ( 1/z + 1/z.conjugate() ).simplify_rational()
2/z
dan_fulea gravatar imagedan_fulea ( 2017-11-26 18:19:02 +0200 )edit

I got it. Thank you very much.

pugnari gravatar imagepugnari ( 2017-11-27 04:10:57 +0200 )edit