def get_faces(self): """Compute the indices of the faces (and other information we will need). """ for i, j in combinations(self.gens, 2): # this is the center of the initial face, # it's a vertex of the fundamental triangle. c0 = self.triangle_verts[self.vertex_at_mirrors(i, j)] # a list holds the vertices of the initial face. f0 = [] m = self.cox_mat[i][j] # this is the stabilizing subgroup of the initial face f0. H = (i, j) + self.get_orthogonal_stabilizing_mirrors((i, j)) # type indicates if this face is regular (0) or truncated (1). # it's truncated if and only if both mirrors are active. type = 0 # compute the words (may not be in normal form) for the # vertices of the initial face if self.active[i] and self.active[j]: type = 1 for k in range(m): f0.append(self.G.move(self.vtable, 0, (i, j) * k)) f0.append(self.G.move(self.vtable, 0, (i, j) * k + (i, ))) elif self.active[i] and m > 2: for k in range(m): f0.append(self.G.move(self.vtable, 0, (j, i) * k)) elif self.active[j] and m > 2: for k in range(m): f0.append(self.G.move(self.vtable, 0, (i, j) * k)) else: continue # compute coset representatives of the initial face, # each word in the result set maps f0 to a different face. reps = set(self.word_generator(parabolic=H)) # sort the faces in shortlex order. reps = self.G.sort_words(reps) # a set holds faces, we use a set here because though a word w # in H stabilizes f0, it may change cyclically rotate f0 to another # different ordered tuple. flist = [] for word in reps: # compute the indices of the vertices of the transformed face f = tuple(self.G.move(self.vtable, v, word) for v in f0) # check if `None` is in f (in this case f contains some # vertex that is not in the vertices list) or there already has # a rotated version of f in the set. if None not in f: center = self.transform(word, c0) coords = [self.vertices_coords[k] for k in f] face = DihedralFace(word, f, center, coords, type) flist.append(face) self.face_indices[(i, j)] = flist self.num_faces = sum(len(L) for L in self.face_indices.values())
def get_faces(self): for i, j in combinations(self.gens, 2): c0 = self.triangle_verts[self.vertex_at_mirrors(i, j)] f0 = [] m = self.cox_mat[i][j] H = (i, j) type = 0 if self.active[i] and self.active[j]: type = 1 for k in range(m): f0.append(self.G.move(self.vtable, 0, (i, j) * k)) f0.append(self.G.move(self.vtable, 0, (i, j) * k + (i, ))) elif self.active[i] and m > 2: for k in range(m): f0.append(self.G.move(self.vtable, 0, (j, i) * k)) elif self.active[j] and m > 2: for k in range(m): f0.append(self.G.move(self.vtable, 0, (i, j) * k)) else: continue reps = set( self.G.get_coset_representative(w, H) for w in self.words) reps = self.G.sort_words(reps) flist = [] for word in reps: f = tuple(self.G.move(self.vtable, v, word) for v in f0) if None not in f and not helpers.check_duplicate_face( f, flist): center = self.transform(word, c0) coords = [self.vertices_coords[k] for k in f] face = DihedralFace(word, f, center, coords, type) flist.append(face) self.face_indices[(i, j)] = flist self.num_faces = sum(len(L) for L in self.face_indices.values())