Ask Your Question

complex conjugate of a variable

asked 2012-04-15 12:00:58 +0100

d3banjan gravatar image

updated 2012-04-15 14:50:40 +0100

I attempted to construct the complex conjugate of a variable thus -

x = var('x')
f = x*conjugate(x)

this throws a SyntaxError, although the f({x:2}) case works perfectly.

edit retag flag offensive close merge delete


why isn't the markdown for code working?

d3banjan gravatar imaged3banjan ( 2012-04-15 12:01:40 +0100 )edit

Missing linebreak. There seemed to be HTML tags interspersed in your post for some reason. Incidentally, you can click on the "010101" button to select and format code instead of doing a manual indent.

DSM gravatar imageDSM ( 2012-04-15 13:11:57 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-04-15 13:14:54 +0100

DSM gravatar image

f({x:2+2i}) can never have worked: 2i isn't valid Sage. Either use *I or j, depending on where you want the result to live:

sage: 2+2i   
   File "<ipython console>", line 1
SyntaxError: invalid syntax

sage: 2+2j
2.00000000000000 + 2.00000000000000*I
sage: parent(_)
Complex Field with 53 bits of precision
sage: 2+2*I    
2*I + 2
sage: parent(_)
Symbolic Ring
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


Asked: 2012-04-15 12:00:58 +0100

Seen: 3,391 times

Last updated: Apr 15 '12