flatsurf / sage-flatsurf

Flat surfaces in Sage
https://flatsurf.github.io/sage-flatsurf/
GNU General Public License v2.0
10 stars 10 forks source link

Simplicial homology group with coefficients QQ seems broken #310

Open videlec opened 1 week ago

videlec commented 1 week ago
from flatsurf import *
S = translation_surfaces.mcmullen_L(1,1,1,1)
H = S.homology(coefficients=QQ)
H.gens()

raises

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
Cell In[2], line 3
      1 S = translation_surfaces.mcmullen_L(Integer(1),Integer(1),Integer(1),Integer(1))
      2 H = S.homology(coefficients=QQ)
----> 3 H.gens()

File .../sage/misc/cachefunc.pyx:2333, in sage.misc.cachefunc.CachedMethodCallerNoArgs.__call__ (build/cythonized/sage/misc/cachefunc.c:16275)()
   2331 if self.cache is None:
   2332     f = self.f
-> 2333     self.cache = f(self._instance)
   2334 return self.cache
   2335

File .../flatsurf/geometry/homology.py:1039, in SimplicialHomologyGroup.gens(self)
   1036 if self._k < 0 or self._k > 2:
   1037     return ()
-> 1039 homology, from_homology, _ = self._homology()
   1040 return tuple(self(from_homology(g)) for g in homology.gens())

File .../sage/misc/cachefunc.pyx:2333, in sage.misc.cachefunc.CachedMethodCallerNoArgs.__call__ (build/cythonized/sage/misc/cachefunc.c:16275)()
   2331 if self.cache is None:
   2332     f = self.f
-> 2333     self.cache = f(self._instance)
   2334 return self.cache
   2335

File .../flatsurf/geometry/homology.py:875, in SimplicialHomologyGroup._homology(self)
    872     to_homology = F.module_morphism(function=_to_homology, codomain=homology)
    874     for gen in homology.gens():
--> 875         assert to_homology(from_homology(gen)) == gen
    877     return homology, from_homology, to_homology
    879 raise NotImplementedError(
    880     "cannot compute homology with this implementation yet"
    881 )

AssertionError:
videlec commented 1 day ago

Seems to be fixed after #313... not sure what changed.