#18487: float and CombinatorialFreeModule
-------------------------------------+-------------------------
       Reporter:  chapoton           |        Owner:
           Type:  defect             |       Status:  new
       Priority:  major              |    Milestone:  sage-6.10
      Component:  algebra            |   Resolution:
       Keywords:  float free module  |    Merged in:
        Authors:                     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------
Changes (by tscrim):

 * milestone:  sage-6.8 => sage-6.10


Comment:

 My guess is that the coercion framework is not working correctly with this
 (from the `_acted_upon_` method of the CFM element):
 {{{#!python
         # With the current design, the coercion model does not have
         # enough information to detect a priori that this method only
         # accepts scalars; so it tries on some elements(), and we need
         # to make sure to report an error.
         if isinstance(scalar, Element) and scalar.parent() is not
 self.base_ring():
             # Temporary needed by coercion (see Polynomial/FractionField
 tests).
             if self.base_ring().has_coerce_map_from(scalar.parent()):
                 scalar = self.base_ring()( scalar )
             else:
                 return None
 }}}
 and not doing the (correct) pushout construction. Thus it is not
 constructing the correct parent. I also get this:
 {{{
 sage: C = CombinatorialFreeModule(ZZ,['a','b','c'])
 sage: C.basis()['a'] * (2/3)
 ...
 TypeError: unsupported operand parent(s) for '*': 'Free module generated
 by {'a', 'b', 'c'} over Integer Ring' and 'Rational Field'
 }}}
 I don't think the cause is the above snippet, but I suspect it is further
 down with the construction functor for CFM's (or really lack thereof).
 Compare with:
 {{{
 sage: C.construction()
 sage: M = ZZ^3
 sage: 3.12 * M([1,0,0])
 (3.12000000000000, 0.000000000000000, 0.000000000000000)
 sage: _.parent()
 Vector space of dimension 3 over Real Field with 53 bits of precision
 sage: M.construction()
 (VectorFunctor, Integer Ring)
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/18487#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" 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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to