1 | initial version |

So which is explicitly the question?

If the question addresses the list of elements in the Weyl / Coxeter group of type $\tilde A_n$ of a given fixed `LENGTH`

, then the following code can do something for specific values of $n$:

```
W = WeylGroup( ["A", 3, 1 ], prefix='s' )
print "W = %s" % W
[ s0, s1, s2, s3 ] = W.simple_reflections()
LENGTH = 4
print "Using the iterator W.elements_of_length(%s)" % LENGTH
print "There are %s elements in W of length %s.\n" % ( len( [ w for w in W.elements_of_length(LENGTH) ] ), LENGTH )
print "They are:"
for w in W.elements_of_length(LENGTH) :
print w
for w in ( s0, s1, s2, s3, s0*s1, s0*s1*s0*s1*s2, s0*s1*s2*s3 ):
print "ORDER %9s for the element %s" % ( w.order(), w )
print "Are there finitely many reflections in W? %s" % W.reflections().is_finite()
```

Results:

```
W = Weyl Group of type ['A', 3, 1] (as a matrix group acting on the root space)
Using the iterator W.elements_of_length(4)
There are 34 elements in W of length 4.
They are:
s0*s1*s2*s0
s0*s1*s2*s1
s0*s1*s2*s3
s0*s3*s0*s1
s0*s3*s1*s0
s0*s3*s1*s2
s0*s3*s2*s0
s0*s3*s2*s1
s1*s0*s3*s0
s1*s0*s3*s1
s1*s0*s3*s2
s1*s2*s0*s1
s1*s2*s0*s3
s1*s2*s1*s0
s1*s2*s3*s0
s1*s2*s3*s1
s1*s2*s3*s2
s2*s0*s1*s0
s2*s0*s3*s0
s2*s0*s3*s1
s2*s0*s3*s2
s2*s1*s0*s3
s2*s3*s0*s1
s2*s3*s1*s0
s2*s3*s1*s2
s2*s3*s2*s0
s2*s3*s2*s1
s3*s0*s1*s0
s3*s0*s1*s2
s3*s1*s2*s0
s3*s1*s2*s1
s3*s2*s0*s1
s3*s2*s0*s3
s3*s2*s1*s0
ORDER 2 for the element s0
ORDER 2 for the element s1
ORDER 2 for the element s2
ORDER 2 for the element s3
ORDER 3 for the element s0*s1
ORDER 4 for the element s1*s2*s0
ORDER +Infinity for the element s0*s1*s2*s3
Are there finitely many reflections in W? False
```

Comments to the results:

- after the initialization of
`W`

(with the prefix set to`s`

), the line`[ s0, s1, s2, s3 ] = W.simple_reflections()`

insures that we see symbols, instead of representing matrices. - then all $34$ elements of length $4$ were computed.
- for some elements we print then the order, note that the element
`s0*s1*s2*s3`

has infinite order. - then we wanted to "compute all elements of order two", the reflections. Sage sets the result of
`is_finite`

for the set of reflections to false. Can we provide some examples of reflections of bigger and bigger length? In fact, looking at the apartments for the Weyl group of type $\tilde A_2$, extracted from paving the plane with equilateral triangles, each reflection w.r.t. some line corresponds to a reflections. - note that we may also initialize
`W`

as a`CoxeterGroup`

, but then there seems to be less functionality. we may also initialize

`W`

using the root system of the same type, this may be useful if we need to see something related to the root system. For instance:Y = RootSystem( ["A", 3, 1 ] ) W = WeylGroup( Y, prefix='s' ) [ s0, s1, s2, s3 ] = W.simple_reflections() print Y.dynkin_diagram()

This gives:

```
0
O-------+
| |
| |
O---O---O
1 2 3
A3~
```

Here are some elements of order two (type $\tilde A_1$), and it is clear that there are infinitely many of this pattern.

```
W = WeylGroup( ["A", 1, 1 ], prefix='s' )
[ s0, s1 ] = W.simple_reflections()
u = s0*s1
for k in range(10):
w = u^k * s0 * u.inverse()^k
print "Order %s for %s" % ( w.order(), w )
```

We get:

```
Order 2 for s0
Order 2 for s0*s1*s0*s1*s0
Order 2 for s0*s1*s0*s1*s0*s1*s0*s1*s0
Order 2 for s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0
Order 2 for s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0
Order 2 for s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0
Order 2 for s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0
Order 2 for s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0
Order 2 for s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0
Order 2 for s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0*s1*s0
```

The answer to the question *What if I want to get a list of all elements of a prescribed order?* is thus "there is yet no method to compute this infinite list either".

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.