测试工具

sympy.combinatorics.testutil._cmp_perm_lists(first, second)[源代码][源代码]

将两个排列列表作为集合进行比较。

示例

>>> from sympy.combinatorics.permutations import Permutation
>>> from sympy.combinatorics.testutil import _cmp_perm_lists
>>> a = Permutation([0, 2, 3, 4, 1])
>>> b = Permutation([1, 2, 0, 4, 3])
>>> c = Permutation([3, 4, 0, 1, 2])
>>> ls1 = [a, b, c]
>>> ls2 = [b, c, a]
>>> _cmp_perm_lists(ls1, ls2)
True
sympy.combinatorics.testutil._naive_list_centralizer(self, other, af=False)[源代码][源代码]
sympy.combinatorics.testutil._verify_bsgs(group, base, gens)[源代码][源代码]

验证基和强生成集的正确性。

示例

>>> from sympy.combinatorics.named_groups import AlternatingGroup
>>> from sympy.combinatorics.testutil import _verify_bsgs
>>> A = AlternatingGroup(4)
>>> A.schreier_sims()
>>> _verify_bsgs(A, A.base, A.strong_gens)
True
sympy.combinatorics.testutil._verify_centralizer(group, arg, centr=None)[源代码][源代码]

验证一个组/集合/元素在另一个组中的中心化器。

这用于测试来自 sympy.combinatorics.perm_groups.centralizer()

示例

>>> from sympy.combinatorics.named_groups import (SymmetricGroup,
... AlternatingGroup)
>>> from sympy.combinatorics.perm_groups import PermutationGroup
>>> from sympy.combinatorics.permutations import Permutation
>>> from sympy.combinatorics.testutil import _verify_centralizer
>>> S = SymmetricGroup(5)
>>> A = AlternatingGroup(5)
>>> centr = PermutationGroup([Permutation([0, 1, 2, 3, 4])])
>>> _verify_centralizer(S, A, centr)
True
sympy.combinatorics.testutil._verify_normal_closure(group, arg, closure=None)[源代码][源代码]