I used tab-completion to find the method cycle_tuples
:
sage: a = SymmetricGroup(7).list()[1900]
sage: a
(1,6)(2,5,4)(3,7)
sage: a.cycles()
[(1,6), (2,5,4), (3,7)]
sage: type(a.cycles()[1]) # not what we want
<class 'sage.groups.perm_gps.permgroup_element.SymmetricGroupElement'>
sage: a.cycle_tuples()
[(1, 6), (2, 5, 4), (3, 7)]
sage: type(a.cycle_tuples()[1]) # what we want!
<class 'tuple'>
sage: b = a.cycle_tuples()[1]
sage: b
(2, 5, 4)
sage: b[1]
5
(By "using tab-completion," I mean typing "a." and then hitting the TAB key.) cycle_tuples
is documented here.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…