当前位置: 首页>>代码示例>>Python>>正文


Python SymmetricGroup.generate_dimino方法代码示例

本文整理汇总了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)
开发者ID:sixpearls,项目名称:sympy,代码行数:35,代码来源:test_perm_groups.py

示例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)
开发者ID:sixpearls,项目名称:sympy,代码行数:46,代码来源:test_perm_groups.py

示例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
开发者ID:A-turing-machine,项目名称:sympy,代码行数:8,代码来源:test_testutil.py


注:本文中的sympy.combinatorics.named_groups.SymmetricGroup.generate_dimino方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。