Hello,
You have an answer there :
http://stackoverflow.com/questions/14084317/python-mutable-vectors-are-unhashable-error
Next in my trying code in sagemath cloud (worksheet cell)
Dominique
OP_2 = MatrixSpace(CDF,2,2)
sigma_x = OP_2([0,1,1,0])
sigma_y = OP_2([0,i,-i,0])
sigma_z = OP_2([1,0,0,-1])
t=var('t')
H1=(1-t)*sigma_x+t*sigma_z
H1.eigenvectors_left()
# NOK
#w = H1.eigenvectors_left(); print "w = ",w
#z = w[0][1]; print "z = ",z
#z1 = vector(z[0]); print "z1 = ",z1
#print "type(z1) = ",type(z1) # type(z1) = <class
'sage.modules.vector_symbolic_dense.FreeModule_ambient_field_with_category.element_class'>
#v1 = {SR,2,z1}; print "v1 = ",v1
# NOK
#z2 = vector((6,5))
#print "type(z2) = ",type(z2) # type(z2) = <type
'sage.modules.vector_integer_dense.Vector_integer_dense'>
#v2 = {SR,2,z2}; print "v2 = ",v2
# OK
#z3 = vector((6,5))
#z3.set_immutable() # type(z3) = <type
'sage.modules.vector_integer_dense.Vector_integer_dense'>
#print "type(z3) = ",type(z3)
#v3 = {SR,2,z3}; print "v3 = ",v3
# OK
w = H1.eigenvectors_left(); print "w = ",w
z = w[0][1]; print "z = ",z
z4 = vector(z[0]); print "z4 = ",z4
z4.set_immutable()
print "type(z4) = ",type(z4) #
type(z4) = <class
'sage.modules.vector_symbolic_dense.FreeModule_ambient_field_with_category.element_class'>
v4 = {SR,2,z4}; print "v4 = ",v4
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.