#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:                     |  01158352cb6751e7286023c3031ad1120fa3cca1
  u/tscrim/koszul_complexes          |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by jhpalmieri):

 For `cartesian_product`, I think that the requirement that the degrees of
 the differentials of the factors must agree is completely natural, but it
 should be mentioned in the docstring and it should probably be doctested.
 Same for `tensor`.

 I think you can delete the line `zero = R.zero()` in `cartesian_product`.

 This is odd behavior when `subdivide=True` and there is more than one
 factor:
 {{{
 sage: m = identity_matrix(QQ, 2)
 sage: C = ChainComplex({0:m})
 sage: ascii_art(C.cartesian_product([C,C], subdivide=True))
             [1 0 0 0|0 0]
             [0 1 0 0|0 0]
             [0 0 1 0|0 0]
             [0 0 0 1|0 0]
             [-------+---]
             [0 0 0 0|1 0]
             [0 0 0 0|0 1]
  0 <-- C_1 <-------------- C_0 <-- 0
 }}}
 I was expecting the matrix to have subdivisions for each factor, not just
 the last one. I guess iterating `matrix.block_diagonal` doesn't preserve
 earlier subdivisions as you add more blocks. Something similar happens
 with `tensor`.

 Should it be `tensor` or `tensor_product`?

 In `cartesian_product`, is it worth pointing out that `subdivide` must be
 specified explicitly? That is, you can't do `C.cartesian_product(D,
 True)`.

 In `koszul_complex.py`, is the dot intentional in
 {{{
 ###################################################.#####################
 }}}
 In that file, people have different styles, but I prefer importing
 functions only when you need them, not at the top-level. Having them at
 the top-level could potentially slow down startup times, I think.

 In the `__classcall_private__` method for Koszul complexes, I don't
 understand the lines
 {{{
 if elements is None:
     elements = R
     if not elements:
         ...
 }}}
 If you call `KoszulComplex` with no arguments, you get an error before you
 reach this stage, so I think the second `if` can be skipped. I also gets
 various unhelpful error messages if I call `KoszulComplex(ZZ)` or
 `KoszulComplex(QQ)` without specifying `elements`. Maybe if `elements` is
 not specified, set it to an empty tuple instead? That is, if only one
 argument is passed, if it's an iterable, set `R` to be the parent of the
 first entry. Otherwise, set `R` to be that argument and set `elements` to
 be `()`. Or something like that.

 I was a little surprised that your code for Koszul complexes didn't use
 the tensor product you had just defined. I'm guess that your way is
 faster?

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