Ask Your Question
0

how to use variables (`var`)

asked 2013-06-10 09:27:53 +0100

updated 2013-06-10 09:31:29 +0100

I thought they are complex by default. But even when I try to force the domain to be complex, I always get x.conjugate().simplify() == x. Why? See also below:

sage: t1,t2,t4 = var("t1 t2 t4")
sage: t2.conjugate().simplify()
t2
sage: t1,t2,t4 = var("t1 t2 t4", domain="complex")
sage: t2
t2
sage: t2.is_real()
False
sage: t2.conjugate().simplify()
t2
sage: (t2.real()*2 - t2).simplify()
t2
sage: t2.real().simplify()
t2
sage: t2.imag().simplify()
0
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-06-10 09:41:44 +0100

tmonteil gravatar image

updated 2013-06-10 09:44:02 +0100

This is a known issue, see for example trac ticket 6862, and ask question 2287.

What you can do is to use the assume function, as in the following:

sage: t1,t2,t4 = var("t1 t2 t4")
sage: assume(t2,'complex')
sage: t2.conjugate().simplify()
conjugate(t2)
sage: t2.real().simplify()
realpart(t2)
sage: t2.imag().simplify()
imagpart(t2)
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

Stats

Asked: 2013-06-10 09:27:53 +0100

Seen: 820 times

Last updated: Jun 10 '13