本文整理汇总了Python中sympy.combinatorics.named_groups.DihedralGroup.center方法的典型用法代码示例。如果您正苦于以下问题:Python DihedralGroup.center方法的具体用法?Python DihedralGroup.center怎么用?Python DihedralGroup.center使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sympy.combinatorics.named_groups.DihedralGroup
的用法示例。
在下文中一共展示了DihedralGroup.center方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_center
# 需要导入模块: from sympy.combinatorics.named_groups import DihedralGroup [as 别名]
# 或者: from sympy.combinatorics.named_groups.DihedralGroup import center [as 别名]
def test_center():
# the center of the dihedral group D_n is of order 2 for even n
for i in (4, 6, 10):
D = DihedralGroup(i)
assert (D.center()).order() == 2
# the center of the dihedral group D_n is of order 1 for odd n>2
for i in (3, 5, 7):
D = DihedralGroup(i)
assert (D.center()).order() == 1
# the center of an abelian group is the group itself
for i in (2, 3, 5):
for j in (1, 5, 7):
for k in (1, 1, 11):
G = AbelianGroup(i, j, k)
assert G.center().is_subgroup(G)
# the center of a nonabelian simple group is trivial
for i in(1, 5, 9):
A = AlternatingGroup(i)
assert (A.center()).order() == 1
# brute-force verifications
D = DihedralGroup(5)
A = AlternatingGroup(3)
C = CyclicGroup(4)
G.is_subgroup(D*A*C)
assert _verify_centralizer(G, G)