I disagree with the question, starting with the first sentence. In Sage, the symmetric group is not a list. In fact clearly it isn't, because I can ask it for SymmetricGroup(100).order()
and it tells me the answer in 1ms.
Rather, Sage (and GAP, to which it is closely related) stores permutation groups as a collection of generators. In the case of $S_n$, it uses the generators $(1,2,\dots,n)$ and $(1,2)$ (try SymmetricGroup(5).gens()
). From the generators it computes a "strong generating set", and from that it can answer many of the most important questions by being intelligent.
In fact, the first rule of computational group theory is never to enumerate all the elements in the group.
Of course if $n$ is small enough then list(SymmetricGroup(n))
will output an answer. The exact order in which the elements are output is best thought of as an unimportant implementation detail, in my opinion. If you want them in a specific order, sort them that way.
If you dig into the code (see https://github.com/sagemath/sage/blob/f449b14ecae7a704739467245cf5e7561dfec490/src/sage/groups/perm_gps/permgroup.py#L1104) of course you can find out exactly how sage forms a list of the elements. But currently it is marked by a "todo: this is too slow for moderately small permutation groups", which just proves my point that it is an implementation detail and liable to change.
Also, note that list(SymmetricGroup(3))
and sorted(SymmetricGroup(3))
have different outputs. The latter seems to sort elements by one-line notation lexicographically.