complex, real, common ring, crash in 'vector' constructor

asked 2015-04-08 14:11:48 -0500

beeson gravatar image

updated 2015-04-08 15:46:16 -0500

tmonteil gravatar image
(x,y,z) = var('x,y,z')
x = z.real_part()
y = z.imag_part()
test = vector((x,1,1))
test = vector((x,y,1))
test = vector((z.real_part,1,1))

Last line causes an error, can't find common ring for all elements.
These variables all have type "Expression"; but some expressions denote complex numbers and some denote real numbers. How do I tell sage about that? (Sage 6.5 on Mac OS 10).

edit retag flag offensive close merge delete


Didn't you forgot parenthesis in z.real_part() ?

tmonteil gravatar imagetmonteil ( 2015-04-08 15:47:50 -0500 )edit

tmonteil is right, your last line should be test = vector((z.real_part(),1,1)).

slelievre gravatar imageslelievre ( 2015-04-09 07:14:46 -0500 )edit