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