Opened 9 years ago

Closed 9 years ago

SimplicialComplex chain complex composition not zero

Reported by: Owned by: vbraun jhpalmieri major sage-5.10 algebraic topology jhpalmieri, tscrim sage-5.10.beta4 John Palmieri Volker Braun N/A

Description

```sage: t0 = SimplicialComplex()
sage: t0.homology()
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-374-8061bc7260ca> in <module>()
----> 1 t0.homology()

/home/vbraun/opt/sage-5.10.beta2/local/lib/python2.7/site-packages/sage/homology/cell_complex.pyc in homology(self, dim, **kwds)
547         # _homology_ method.  See SimplicialComplex for one example.
548         if hasattr(self, '_homology_'):
--> 549             return self._homology_(dim, **kwds)
550
551         C = self.chain_complex(cochain=cohomology, augmented=True,

/home/vbraun/opt/sage-5.10.beta2/local/lib/python2.7/site-packages/sage/homology/simplicial_complex.pyc in _homology_(self, dim, **kwds)
1923         kwds['subcomplex']=L
1924         C = self.chain_complex(dimensions=dims, augmented=True,
-> 1925                                cochain=cohomology, **kwds)
1926         if verbose:
1927             print " Done computing the chain complex. "

/home/vbraun/opt/sage-5.10.beta2/local/lib/python2.7/site-packages/sage/homology/simplicial_complex.pyc in chain_complex(self, **kwds)
1786             return ChainComplex(data=differentials, degree=1, **kwds)
1787         else:
-> 1788             return ChainComplex(data=differentials, degree=-1, **kwds)
1789
1790     def _homology_(self, dim=None, **kwds):

/home/vbraun/opt/sage-5.10.beta2/local/lib/python2.7/site-packages/sage/homology/chain_complex.pyc in __init__(self, data, **kwds)
460                             raise TypeError, "The differentials d_{%s} and d_{%s} are not compatible: their product is not defined." % (n, n+degree)
461                         if not prod.is_zero():
--> 462                             raise ValueError, "The differentials d_{%s} and d_{%s} are not compatible: their composition is not zero." % (n, n+degree)
463                 else:
464                     if not mat.nrows() == 0:

ValueError: The differentials d_{2} and d_{1} are not compatible: their composition is not zero.
```

on sage-5.10.beta2

comment:1 Changed 9 years ago by jhpalmieri

The problem is the `add_face` method: it should sort the new vertex set, just like the `__init__` method does. Actually, we should cache the setting of `sort_facets`, and if True, then `add_face` should sort the vertex set.

comment:2 Changed 9 years ago by jhpalmieri

First attempt at a patch.

comment:3 Changed 9 years ago by jhpalmieri

• Status changed from new to needs_review

comment:4 Changed 9 years ago by vbraun

• Authors set to John Palmieri
• Reviewers set to Volker Braun
• Status changed from needs_review to positive_review

Looks good to me!

comment:5 Changed 9 years ago by jdemeyer

• Merged in set to sage-5.10.beta4
• Resolution set to fixed
• Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.