If you're looking for something like Length /@ First @ Cycles[{{1, 2, 3, 4, 5}, {6, 7}}], we can easily package that in a function:
cycleShape[Cycles[x_List]] := Length /@ x
The question then is how you want the "shape" to be ordered; for example, should Cycles[{{1, 2, 3, 4, 5}, {6, 7}}] have shape {5, 2} or {2, 5}? If we want to put the shape into a canonical form based only on the list of cycle lengths we can just use Sort:
cycleShape[Cycles[x_List]] := Sort[Length /@ x]
But if we want it to reflect the canonical ordering of the cycles, we can simply use the original definition. This is because Cycles automatically sorts its argument (try evaluating Cycles[{{6, 7}, {1, 2, 3, 4, 5}}] by itself). However, using the first definition (without Sort applied afterwards) would mean that, for example, Cycles[{{1, 2}, {3, 4, 5}}] and Cycles[{{1, 2, 5}, {3, 4}}] (both of which are in canonical Mathematica form) would have different shapes, despite being conjugate permutations (by the permutation Cycles[{{1, 3}, {2, 4}}]).
Length /@ First @ Cycles[{{1, 2, 3, 4, 5}, {6, 7}}]? (It could be useful to apply aSortto the result as well, I'm not sure) As a function definition:cycleShape[Cycles[x_List]] := Sort[Length /@ x]– thorimur Oct 04 '21 at 16:55shapedoes ... The equivalent ofnp.shapeisDimensions. – Szabolcs Oct 04 '21 at 18:37