#15305: Allow natural morphism between tensor products
-------------------------------------------+-----------------------------
       Reporter:  tscrim                   |        Owner:  sage-combinat
           Type:  enhancement              |       Status:  needs_review
       Priority:  major                    |    Milestone:  sage-5.13
      Component:  coercion                 |   Resolution:
       Keywords:  tensor product coercion  |    Merged in:
        Authors:  Travis Scrimshaw         |    Reviewers:
Report Upstream:  N/A                      |  Work issues:
         Branch:                           |       Commit:
   Dependencies:  #15309                   |     Stopgaps:
-------------------------------------------+-----------------------------

Comment (by nthiery):

 Replying to [comment:10 nborie]:
 > {{{
 > def tensor_morphism(t):
 >     im = [M(R._sets[i].monomial(t[i])) for i,M in enumerate(self._sets)]
 >     return self.sum_of_terms([(tuple(x[0] for x in cp), B.prod(x[1] for
 x in cp))
 >                               for cp in im])
 > }}}

 In the above, M(...) calls a conversion morphism from R._sets[i] to M.
 More often than not, that morphism will be a module_morphism, and thus
 have a "on_basis" method. So if we request once for all the morphism, on
 could rewrite it as just phi.on_basis(t[i]), avoiding a lot of the
 overhead.

 Btw: doing this might be easier if one extracts a
 "tensor_product_of_morphisms" function.

--
Ticket URL: <http://trac.sagemath.org/ticket/15305#comment:13>
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/groups/opt_out.

Reply via email to