Skip to content

Commit 875444d

Browse files
committed
Problem with orientations of simplices in simplicial complex maps.
1 parent 272582b commit 875444d

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

src/sage/topology/simplicial_complex_morphism.py

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,20 +244,41 @@ def __call__(self, x, orientation=False):
244244
(0, 1)
245245
sage: g(Simplex([0,1]), orientation=True) # needs sage.modules
246246
((0, 1), -1)
247+
248+
TESTS::
249+
250+
sage: S = SimplicialComplex([[1,2]],is_mutable=False).barycentric_subdivision()
251+
sage: T = SimplicialComplex([[1,2],[2,3],[1,3]],is_mutable=False).barycentric_subdivision()
252+
sage: f = {x[0]:x[0] for x in S.cells()[0]}
253+
sage: H = Hom(S,T)
254+
sage: z = H(f)
255+
sage: z.associated_chain_complex_morphism()
256+
Chain complex morphism:
257+
From: Chain complex with at most 2 nonzero terms over Integer Ring
258+
To: Chain complex with at most 2 nonzero terms over Integer Ring
247259
"""
248260
dim = self.domain().dimension()
249261
if not isinstance(x, Simplex) or x.dimension() > dim or x not in self.domain().faces()[x.dimension()]:
250262
raise ValueError("x must be a simplex of the source of f")
251263
tup = x.tuple()
252-
fx = []
253-
for j in tup:
254-
fx.append(self._vertex_dictionary[j])
264+
fx = [self._vertex_dictionary[j] for j in tup]
255265
if orientation:
256266
from sage.algebras.steenrod.steenrod_algebra_misc import convert_perm
257267
from sage.combinat.permutation import Permutation
258268

259269
if len(set(fx)) == len(tup):
260-
oriented = Permutation(convert_perm(fx)).signature()
270+
# We need to compare the image simplex, as given in
271+
# the order specified by self, with its orientation in
272+
# the codomain.
273+
image = Simplex(set(fx))
274+
Y_faces = self.codomain()._n_cells_sorted(image.dimension())
275+
idx = Y_faces.index(image)
276+
actual_image = Y_faces[idx]
277+
# The signature of the permutation specified by self:
278+
sign_image = Permutation(convert_perm(fx)).signature()
279+
# The signature of the permutation of the simplex in the domain:
280+
sign_simplex = Permutation(convert_perm(actual_image)).signature()
281+
oriented = sign_image * sign_simplex
261282
else:
262283
oriented = 1
263284
return (Simplex(set(fx)), oriented)

0 commit comments

Comments
 (0)