我正在尝试与 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 中的版本目前对于此来说似乎太旧了,如果那是您的平台......
关于python - Sage 在排列元素上找不到cycle_type() 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39156851/