本文整理汇总了Python中sympy.combinatorics.named_groups.SymmetricGroup.stabilizer方法的典型用法代码示例。如果您正苦于以下问题:Python SymmetricGroup.stabilizer方法的具体用法?Python SymmetricGroup.stabilizer怎么用?Python SymmetricGroup.stabilizer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sympy.combinatorics.named_groups.SymmetricGroup
的用法示例。
在下文中一共展示了SymmetricGroup.stabilizer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _subgroup_search
# 需要导入模块: from sympy.combinatorics.named_groups import SymmetricGroup [as 别名]
# 或者: from sympy.combinatorics.named_groups.SymmetricGroup import stabilizer [as 别名]
def _subgroup_search(i, j, k):
prop_true = lambda x: True
prop_fix_points = lambda x: [x(point) for point in points] == points
prop_comm_g = lambda x: rmul(x, g) == rmul(g, x)
prop_even = lambda x: x.is_even
for i in range(i, j, k):
S = SymmetricGroup(i)
A = AlternatingGroup(i)
C = CyclicGroup(i)
Sym = S.subgroup_search(prop_true)
assert Sym.is_subgroup(S)
Alt = S.subgroup_search(prop_even)
assert Alt.is_subgroup(A)
Sym = S.subgroup_search(prop_true, init_subgroup=C)
assert Sym.is_subgroup(S)
points = [7]
assert S.stabilizer(7).is_subgroup(S.subgroup_search(prop_fix_points))
points = [3, 4]
assert S.stabilizer(3).stabilizer(4).is_subgroup(
S.subgroup_search(prop_fix_points))
points = [3, 5]
fix35 = A.subgroup_search(prop_fix_points)
points = [5]
fix5 = A.subgroup_search(prop_fix_points)
assert A.subgroup_search(prop_fix_points, init_subgroup=fix35
).is_subgroup(fix5)
base, strong_gens = A.schreier_sims_incremental()
g = A.generators[0]
comm_g = \
A.subgroup_search(prop_comm_g, base=base, strong_gens=strong_gens)
assert _verify_bsgs(comm_g, base, comm_g.generators) is True
assert [prop_comm_g(gen) is True for gen in comm_g.generators]
示例2: test_subgroup_search
# 需要导入模块: from sympy.combinatorics.named_groups import SymmetricGroup [as 别名]
# 或者: from sympy.combinatorics.named_groups.SymmetricGroup import stabilizer [as 别名]
def test_subgroup_search():
prop_true = lambda x: True
prop_fix_points = lambda x: [x(point) for point in points] == points
prop_comm_g = lambda x: x*g == g*x
prop_even = lambda x: x.is_even
for i in range(10, 17, 2):
S = SymmetricGroup(i)
A = AlternatingGroup(i)
C = CyclicGroup(i)
Sym = S.subgroup_search(prop_true)
assert Sym == S
Alt = S.subgroup_search(prop_even)
assert Alt == A
Sym = S.subgroup_search(prop_true, init_subgroup=C)
assert Sym == S
points = [7]
assert S.stabilizer(7) == S.subgroup_search(prop_fix_points)
points = [3, 4]
assert S.stabilizer(3).stabilizer(4) ==\
S.subgroup_search(prop_fix_points)
points = [3, 5]
fix35 = A.subgroup_search(prop_fix_points)
points = [5]
fix5 = A.subgroup_search(prop_fix_points)
assert A.subgroup_search(prop_fix_points, init_subgroup=fix35) == fix5
base, strong_gens = A.schreier_sims_incremental()
g = A.generators[0]
comm_g =\
A.subgroup_search(prop_comm_g, base=base, strong_gens=strong_gens)
assert _verify_bsgs(comm_g, base, comm_g.generators) == True
assert [prop_comm_g(gen) == True for gen in comm_g.generators]
示例3: test_stabilizer
# 需要导入模块: from sympy.combinatorics.named_groups import SymmetricGroup [as 别名]
# 或者: from sympy.combinatorics.named_groups.SymmetricGroup import stabilizer [as 别名]
def test_stabilizer():
S = SymmetricGroup(2)
H = S.stabilizer(0)
assert H.generators == [Permutation(1)]
a = Permutation([2, 0, 1, 3, 4, 5])
b = Permutation([2, 1, 3, 4, 5, 0])
G = PermutationGroup([a, b])
G0 = G.stabilizer(0)
assert G0.order() == 60
gens_cube = [[1, 3, 5, 7, 0, 2, 4, 6], [1, 3, 0, 2, 5, 7, 4, 6]]
gens = [Permutation(p) for p in gens_cube]
G = PermutationGroup(gens)
G2 = G.stabilizer(2)
assert G2.order() == 6
G2_1 = G2.stabilizer(1)
v = list(G2_1.generate(af=True))
assert v == [[0, 1, 2, 3, 4, 5, 6, 7], [3, 1, 2, 0, 7, 5, 6, 4]]
gens = (
(1, 2, 0, 4, 5, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19),
(0, 1, 2, 3, 4, 5, 19, 6, 8, 9, 10, 11, 12, 13, 14,
15, 16, 7, 17, 18),
(0, 1, 2, 3, 4, 5, 6, 7, 9, 18, 16, 11, 12, 13, 14, 15, 8, 17, 10, 19))
gens = [Permutation(p) for p in gens]
G = PermutationGroup(gens)
G2 = G.stabilizer(2)
assert G2.order() == 181440
S = SymmetricGroup(3)
assert [G.order() for G in S.basic_stabilizers] == [6, 2]