Marshall Hampton wrote: > Something odd is happening here. I just noticed that if we define v > as: > > v = vector(QQ,[1,1]) > > then there are no problems, even though the type(v) is the same as in > your code. I don't understand how the same type of object, with the > same values, would have different coercion behavior. >
I think that the issue might be the issue in #3058: http://trac.sagemath.org/sage_trac/ticket/3058 The problem comes up when the parent of v has a user-defined basis, instead of the standard basis: sage: v.parent() Vector space of degree 2 and dimension 1 over Rational Field User basis matrix: [1 1] Jason > -Marshall > > On Dec 19, 8:35 am, Jan Groenewald <j...@aims.ac.za> wrote: >> Hi >> >> >> >> On Fri, Dec 19, 2008 at 06:29:41AM -0800, daveloeffler wrote: >> >>> On Dec 19, 1:35 pm, Jan Groenewald <j...@aims.ac.za> wrote: >>>> The core is this: >>>>>>> sage: var('t') >>>>>>> t >>>>>>> sage: type(v) >>>>>>> <type 'sage.modules.vector_rational_dense.Vector_rational_dense'> >>>>>>> sage: type(v*t) >>>>>>> <type >>>>>>> 'sage.modules.free_module_element.FreeModuleElement_generic_dense'> >>>> I think v*t should have stayed the same type as v. >>> I disagree, since t is not a rational number -- it's a symbolic >>> variable -- so v*t has no right to be a Vector_rational_dense object. >>> The problem is that Sage isn't coercing the Vector_rational_dense >>> object A*v into a Vector_symbolic_dense in order to make sense of "A*v >>> - v*t", which it should do automatically. >> Yes, that does sound better. >> >> Jan > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---