| 20 | |

| 21 | The two needed methods are |

| 22 | {{{ |

| 23 | ############################################################################# |

| 24 | ## |

| 25 | #F ReducedInRightCoset( <W> , <w> ) . . . . . reduced element in coset W.w |

| 26 | ## |

| 27 | ## w is an automorphism of a parent Coxeter group of W. |

| 28 | ## 'ReducedInRightCoset' returns the unique element in the right |

| 29 | ## coset W.w which is W-reduced. |

| 30 | ## |

| 31 | |

| 32 | AbsCoxOps.ReducedInRightCoset:=function(W,w)local i; |

| 33 | while true do |

| 34 | i := FirstLeftDescending(W, w); |

| 35 | if i=false then return w; fi; |

| 36 | w := W.reflections[i] * w; |

| 37 | od; |

| 38 | end; |

| 39 | |

| 40 | ############################################################################# |

| 41 | ## |

| 42 | #F ReducedRightCosetRepresentatives( <W>, <H> ) . . . . . . . . . . . . . |

| 43 | #F . . . . . . . . . . . . . . . distinguished right coset representatives |

| 44 | ## |

| 45 | ## 'ReducedRightCosetRepresentatives' returns a list of reduced words in the |

| 46 | ## Coxeter group <W> that are distinguished right coset representatives for |

| 47 | ## the right cosets H\W where H is a reflection subgroup of W. |

| 48 | ## |

| 49 | ReducedRightCosetRepresentatives:=function(W, H)local res, totest, new; |

| 50 | totest:=Set([W.identity]); |

| 51 | res:=Set([W.identity]); |

| 52 | repeat |

| 53 | new:=Concatenation(List(totest,w->List( |

| 54 | W.reflections{W.generatingReflections},s->ReducedInRightCoset(H, w*s)))); |

| 55 | UniteSet(res,totest); |

| 56 | totest:=Difference(new,res); |

| 57 | until Length(totest)=0; |

| 58 | InfoChevie2("#I nb. of cosets: ",Length(res),"\n"); |

| 59 | SortBy(res,x->CoxeterLength(W,x)); |

| 60 | return res; |

| 61 | end; |

| 62 | }}} |