Sage 在排列元素上找不到 cycle_type() 属性

Sage doesn't find cycle_type() attribute on a permutation element

我正在尝试与 Sage 一起研究一些群论。

特别是我试图学习与对称组相关的基本命令。

我的输入是

G=SymmetricGroup(6)

sigma=G('(1,3,5)(4,6)')

然后我使用 sigma.cycle_type() 并且根据文档,我应该得到一个列表作为输出,其中包含以递减顺序形成 sigma 的循环长度,在这种情况下我应该得到类似 [3, 2].相反,我得到一个 "AttributeError" :

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-25-94f73ca80516> in <module>()
----> 1 sigma.cycle_type()

/home/sage/sage-7.2/src/sage/structure/element.pyx in sage.structure.element.Element.__getattr__ (/home/sage/sage-7.2/src/build/cythonized/sage/structure/element.c:4649)()
    411             dummy_error_message.name = name
    412             raise dummy_attribute_error
--> 413         return getattr_from_other_class(self, P._abstract_element_class, name)
    414 
    415     def __dir__(self):

/home/sage/sage-7.2/src/sage/structure/misc.pyx in sage.structure.misc.getattr_from_other_class (/home/sage/sage-7.2/src/build/cythonized/sage/structure/misc.c:1870)()
    257         dummy_error_message.cls = type(self)
    258         dummy_error_message.name = name
--> 259         raise dummy_attribute_error
    260     if isinstance(attribute, methodwrapper):
    261         dummy_error_message.cls = type(self)

AttributeError: 'sage.groups.perm_gps.permgroup_element.SymmetricGroupElement' object has no attribute 'cycle_type'

我做错了什么?

可能您只需要更新版本的 Sage?在 7.3 的后期测试版中,我得到:

sage: sigma.cycle_type()
[3, 2, 1]

我应该指出,SageMathCloud 中的版本目前似乎太旧了,如果那是你的平台...