本文整理汇总了Python中sympy.combinatorics.generators.rubik_cube_generators函数的典型用法代码示例。如果您正苦于以下问题:Python rubik_cube_generators函数的具体用法?Python rubik_cube_generators怎么用?Python rubik_cube_generators使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rubik_cube_generators函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_orbits
def test_orbits():
a = Permutation([2, 0, 1])
b = Permutation([2, 1, 0])
g = PermutationGroup([a, b])
assert g.orbit(0) == {0, 1, 2}
assert g.orbits() == [{0, 1, 2}]
assert g.is_transitive() and g.is_transitive(strict=False)
assert g.orbit_transversal(0) == \
[Permutation(
[0, 1, 2]), Permutation([2, 0, 1]), Permutation([1, 2, 0])]
assert g.orbit_transversal(0, True) == \
[(0, Permutation([0, 1, 2])), (2, Permutation([2, 0, 1])),
(1, Permutation([1, 2, 0]))]
G = DihedralGroup(6)
transversal, slps = _orbit_transversal(G.degree, G.generators, 0, True, slp=True)
for i, t in transversal:
slp = slps[i]
w = G.identity
for s in slp:
w = G.generators[s]*w
assert w == t
a = Permutation(list(range(1, 100)) + [0])
G = PermutationGroup([a])
assert [min(o) for o in G.orbits()] == [0]
G = PermutationGroup(rubik_cube_generators())
assert [min(o) for o in G.orbits()] == [0, 1]
assert not G.is_transitive() and not G.is_transitive(strict=False)
G = PermutationGroup([Permutation(0, 1, 3), Permutation(3)(0, 1)])
assert not G.is_transitive() and G.is_transitive(strict=False)
assert PermutationGroup(
Permutation(3)).is_transitive(strict=False) is False
开发者ID:sixpearls,项目名称:sympy,代码行数:33,代码来源:test_perm_groups.py
示例2: test_rubik
def test_rubik():
skip('takes too much time')
G = PermutationGroup(rubik_cube_generators())
assert G.order() == 43252003274489856000
G1 = PermutationGroup(G[:3])
assert G1.order() == 170659735142400
assert not G1.is_normal(G)
G2 = G.normal_closure(G1.generators)
assert G2.is_subgroup(G)
开发者ID:sixpearls,项目名称:sympy,代码行数:9,代码来源:test_perm_groups.py
示例3: test_rubik1
def test_rubik1():
gens = rubik_cube_generators()
gens1 = [gens[0]] + [p**2 for p in gens[1:]]
G1 = PermutationGroup(gens1)
assert G1.order() == 19508428800
gens2 = [p**2 for p in gens]
G2 = PermutationGroup(gens2)
assert G2.order() == 663552
assert G2.is_subgroup(G1)
C1 = G1.commutator()
assert C1.order() == 4877107200
assert C1.is_subgroup(G1)
assert not G2.is_subgroup(C1)
开发者ID:johanhake,项目名称:sympy,代码行数:13,代码来源:test_perm_groups.py
示例4: test_rubik1
def test_rubik1():
gens = rubik_cube_generators()
gens1 = [gens[-1]] + [p**2 for p in gens[1:]]
G1 = PermutationGroup(gens1)
assert G1.order() == 19508428800
gens2 = [p**2 for p in gens]
G2 = PermutationGroup(gens2)
assert G2.order() == 663552
assert G2.is_subgroup(G1, 0)
C1 = G1.derived_subgroup()
assert C1.order() == 4877107200
assert C1.is_subgroup(G1, 0)
assert not G2.is_subgroup(C1, 0)
G = RubikGroup(2)
assert G.order() == 3674160
开发者ID:sixpearls,项目名称:sympy,代码行数:16,代码来源:test_perm_groups.py
示例5: test_orbits
def test_orbits():
a = Permutation([2, 0, 1])
b = Permutation([2, 1, 0])
g = PermutationGroup([a, b])
assert g.orbit(0) == set([0, 1, 2])
assert g.orbits() == [set([0, 1, 2])]
assert g.is_transitive()
assert g.orbits(rep=True) == [0]
assert g.orbit_traversal(0) == \
[Permutation([0,1,2]), Permutation([1,2,0]), Permutation([2,0,1])]
orbt = g.orbit_traversal(1, af=True)
assert g.orbit_traversal(1, af=True) == [[2, 0, 1], [0, 1, 2], [1, 2, 0]]
a = Permutation(range(1, 100) + [0])
G = PermutationGroup([a])
assert G.orbits(rep=True) == [0]
gens = rubik_cube_generators()
g = PermutationGroup(gens, 48)
assert g.orbits(rep=True) == [0, 1]
assert not g.is_transitive()
开发者ID:johanhake,项目名称:sympy,代码行数:20,代码来源:test_perm_groups.py
示例6: test_orbits
def test_orbits():
a = Permutation([2, 0, 1])
b = Permutation([2, 1, 0])
g = PermutationGroup([a, b])
assert g.orbit(0) == set([0, 1, 2])
assert g.orbits() == [set([0, 1, 2])]
assert g.is_transitive() and g.is_transitive(strict=False)
assert g.orbit_transversal(0) == \
[Permutation([0, 1, 2]), Permutation([2, 0, 1]), Permutation([1, 2, 0])]
assert g.orbit_transversal(0, True) == \
[(0, Permutation([0, 1, 2])), (2, Permutation([2, 0, 1])), \
(1, Permutation([1, 2, 0]))]
a = Permutation(range(1, 100) + [0])
G = PermutationGroup([a])
assert [min(o) for o in G.orbits()] == [0]
G = PermutationGroup(rubik_cube_generators())
assert [min(o) for o in G.orbits()] == [0, 1]
assert not G.is_transitive() and not G.is_transitive(strict=False)
G = PermutationGroup([Permutation(0, 1, 3), Permutation(3)(0, 1)])
assert not G.is_transitive() and G.is_transitive(strict=False)
assert PermutationGroup(Permutation(3)).is_transitive(strict=False) is False
开发者ID:dyao-vu,项目名称:meta-core,代码行数:22,代码来源:test_perm_groups.py
注:本文中的sympy.combinatorics.generators.rubik_cube_generators函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论