... ok! Found it: sage: P = Permutations([1,2,3])
sage: elmts = P.elements_of_length(3) sage: e = next(elmts) sage: e [3, 2, 1] sage: e.to_matrix() [0 0 1] [0 1 0] [1 0 0] ... somehow was thinking of using too technical things. Le lundi 23 novembre 2020 à 14:44:00 UTC+1, jplab a écrit : > Hi all, > > I would have posted this question on AskSage, but I can't seem to be able > to connect through my google account (Authorization Error?). So I put the > question here. > > I would like to know how to iterate through permutation matrices of a > fixed size ($n\times n$) by breadth-first-search (by length in the weak > order poset). Somehow, this is pretty simple, but I can't seem to figure > this out from the jungle of methods available. > > I do know that it is possible to get the elements by lengths in the > CoxeterGroup(['A',n-1]) structure, but I want the permutation matrix > associate to the element. > > Somehow, tons of methods are available but the obvious > "permutation_matrix" is not there. > > Any hint? I know I missed something somewhere! > > J-P > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/a8e40b1b-64fd-41bc-8eac-30a925fa0a68n%40googlegroups.com.