#5562: coercion error with vectors and polynomial rings with 1 variable
----------------------------+-----------------------------------------------
 Reporter:  ncalexan        |       Owner:  was                            
     Type:  defect          |      Status:  new                            
 Priority:  major           |   Milestone:  sage-3.4.2                     
Component:  linear algebra  |    Keywords:  coercion vector polynomial ring
----------------------------+-----------------------------------------------
 This is strange: it matters how many variables are specified.  This fails
 and I think this is a bug:

 {{{
 sage: R.<u> = PolynomialRing(RDF, 1, 'u')
 sage: v1 = vector([u])
 sage: v2 = vector([CDF(2)])
 sage: v1 * v2
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)

 /home/ncalexan/sage-3.4.rc0-sage.math-
 only-x86_64-Linux/devel/sage/sage/functions/riemann_theta.py in <module>()

 /home/ncalexan/sage-3.4.rc0-sage.math-
 only-x86_64-Linux/local/lib/python2.5/site-
 packages/sage/structure/element.so in sage.structure.el\
 ement.Vector.__mul__ (sage/structure/element.c:10435)()

 /home/ncalexan/sage-3.4.rc0-sage.math-
 only-x86_64-Linux/local/lib/python2.5/site-
 packages/sage/structure/coerce.so in sage.structure.coe\
 rce.CoercionModel_cache_maps.bin_op (sage/structure/coerce.c:5847)()

 TypeError: unsupported operand parent(s) for '*': 'Ambient free module of
 rank 1 over the integral domain Multivariate Polynomial Ring i\
 n u over Real Double Field' and 'Vector space of dimension 1 over Complex
 Double Field'
 }}}

 But both of these succeed:

 {{{
 sage: R.<u, v> = RDF[]
 sage: v1 = vector([u])
 sage: v2 = vector([CDF(2)])
 sage: v1 * v2
 2.0*u
 }}}

 {{{
 sage: R.<u> = RDF[]
 sage: v1 = vector([u])
 sage: v2 = vector([CDF(2)])
 sage: v1 * v2
 2.0*u
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5562>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to