本文整理汇总了Python中sympy.combinatorics.named_groups.DihedralGroup.generate_dimino方法的典型用法代码示例。如果您正苦于以下问题:Python DihedralGroup.generate_dimino方法的具体用法?Python DihedralGroup.generate_dimino怎么用?Python DihedralGroup.generate_dimino使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sympy.combinatorics.named_groups.DihedralGroup
的用法示例。
在下文中一共展示了DihedralGroup.generate_dimino方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_centralizer
# 需要导入模块: from sympy.combinatorics.named_groups import DihedralGroup [as 别名]
# 或者: from sympy.combinatorics.named_groups.DihedralGroup import generate_dimino [as 别名]
def test_centralizer():
# the centralizer of the trivial group is the entire group
S = SymmetricGroup(2)
assert S.centralizer(Permutation(list(range(2)))).is_subgroup(S)
A = AlternatingGroup(5)
assert A.centralizer(Permutation(list(range(5)))).is_subgroup(A)
# a centralizer in the trivial group is the trivial group itself
triv = PermutationGroup([Permutation([0, 1, 2, 3])])
D = DihedralGroup(4)
assert triv.centralizer(D).is_subgroup(triv)
# brute-force verifications for centralizers of groups
for i in (4, 5, 6):
S = SymmetricGroup(i)
A = AlternatingGroup(i)
C = CyclicGroup(i)
D = DihedralGroup(i)
for gp in (S, A, C, D):
for gp2 in (S, A, C, D):
if not gp2.is_subgroup(gp):
assert _verify_centralizer(gp, gp2)
# verify the centralizer for all elements of several groups
S = SymmetricGroup(5)
elements = list(S.generate_dimino())
for element in elements:
assert _verify_centralizer(S, element)
A = AlternatingGroup(5)
elements = list(A.generate_dimino())
for element in elements:
assert _verify_centralizer(A, element)
D = DihedralGroup(7)
elements = list(D.generate_dimino())
for element in elements:
assert _verify_centralizer(D, element)
# verify centralizers of small groups within small groups
small = []
for i in (1, 2, 3):
small.append(SymmetricGroup(i))
small.append(AlternatingGroup(i))
small.append(DihedralGroup(i))
small.append(CyclicGroup(i))
for gp in small:
for gp2 in small:
if gp.degree == gp2.degree:
assert _verify_centralizer(gp, gp2)