#16851: Implement direct sum and tensor products for chain complexes and Koszul
complexes
-------------------------------------+-------------------------------------
       Reporter:  tscrim             |        Owner:  tscrim
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.4
      Component:  algebraic          |   Resolution:
  topology                           |    Merged in:
       Keywords:                     |    Reviewers:
        Authors:  Travis Scrimshaw   |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  990c0dce6e53a005eb2b3cd44709379f5d7bf242
  u/tscrim/koszul_complexes          |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by jhpalmieri):

 The tensor product doesn't work if the chain complex is graded over a free
 abelian group: computing `(-1)^a` fails in this case, because `a` is a
 group element, not an integer. So you need to test for this case and
 replace `a` with `sum(a)` or something similar. (See also the
 `total_degree` function in my branch at #16508.)

 A related problem: if the differential has degree `d`, then I think the
 correct formula for the differential on the tensor product `x tensor y`
 involves the sign `(-1)^(|x| * |d|)`, where `|d|` is the degree of the
 differential on the second factor. With this sign convention (or with your
 choice of `(-1)^|x|`), if `C` and `D` are chain complexes with
 differentials of even degree, their tensor product will probably not be a
 chain complex any more, because the differential won't square to zero. It
 would be a good idea to add a warning about this in the documentation. (I
 know why you might want to grade over an arbitrary free abelian group, but
 I don't know why you would want a differential of even degree, so this is
 probably not a big deal.)

 Oh, and `cartesian_product` fails if graded over something other than
 `ZZ`, because the grading group needs to be explicitly stated if it's not
 `ZZ`. So something like this should fix it:
 {{{
 #!diff
 diff --git a/src/sage/homology/chain_complex.py
 b/src/sage/homology/chain_complex.py
 index 1c6fdfb..29ce6e7 100644
 --- a/src/sage/homology/chain_complex.py
 +++ b/src/sage/homology/chain_complex.py
 @@ -1758,7 +1758,8 @@ class ChainComplex_class(Parent):
          ret = {k: matrix.block_diagonal([d.get(k, zero) for d in diffs],
                                           subdivide=subdivide)
                 for k in keys}
 -        return ChainComplex(ret, degree_of_differential=deg_diff)
 +        return ChainComplex(ret, degree_of_differential=deg_diff,
 +                            grading_group=self._grading_group)

      def tensor(self, *factors, **kwds):
          r"""
 }}}
 You'll need a similar change at the end of the `tensor` method.

--
Ticket URL: <http://trac.sagemath.org/ticket/16851#comment:9>
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