本文整理汇总了Python中sympy.combinatorics.named_groups.SymmetricGroup.schreier_sims方法的典型用法代码示例。如果您正苦于以下问题:Python SymmetricGroup.schreier_sims方法的具体用法?Python SymmetricGroup.schreier_sims怎么用?Python SymmetricGroup.schreier_sims使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sympy.combinatorics.named_groups.SymmetricGroup
的用法示例。
在下文中一共展示了SymmetricGroup.schreier_sims方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_verify_bsgs
# 需要导入模块: from sympy.combinatorics.named_groups import SymmetricGroup [as 别名]
# 或者: from sympy.combinatorics.named_groups.SymmetricGroup import schreier_sims [as 别名]
def test_verify_bsgs():
S = SymmetricGroup(5)
S.schreier_sims()
base = S.base
strong_gens = S.strong_gens
assert _verify_bsgs(S, base, strong_gens) is True
assert _verify_bsgs(S, base[:-1], strong_gens) is False
assert _verify_bsgs(S, base, S.generators) is False
示例2: test_baseswap
# 需要导入模块: from sympy.combinatorics.named_groups import SymmetricGroup [as 别名]
# 或者: from sympy.combinatorics.named_groups.SymmetricGroup import schreier_sims [as 别名]
def test_baseswap():
S = SymmetricGroup(4)
S.schreier_sims()
base = S.base
strong_gens = S.strong_gens
assert base == [0, 1, 2]
deterministic = S.baseswap(base, strong_gens, 1, randomized=False)
randomized = S.baseswap(base, strong_gens, 1)
assert deterministic[0] == [0, 2, 1]
assert _verify_bsgs(S, deterministic[0], deterministic[1]) is True
assert randomized[0] == [0, 2, 1]
assert _verify_bsgs(S, randomized[0], randomized[1]) is True
示例3: test_orbits_transversals_from_bsgs
# 需要导入模块: from sympy.combinatorics.named_groups import SymmetricGroup [as 别名]
# 或者: from sympy.combinatorics.named_groups.SymmetricGroup import schreier_sims [as 别名]
def test_orbits_transversals_from_bsgs():
S = SymmetricGroup(4)
S.schreier_sims()
base = S.base
strong_gens = S.strong_gens
strong_gens_distr = _distribute_gens_by_base(base, strong_gens)
result = _orbits_transversals_from_bsgs(base, strong_gens_distr)
orbits = result[0]
transversals = result[1]
base_len = len(base)
for i in range(base_len):
for el in orbits[i]:
assert transversals[i][el](base[i]) == el
for j in range(i):
assert transversals[i][el](base[j]) == base[j]
order = 1
for i in range(base_len):
order *= len(orbits[i])
assert S.order() == order