How to use the permuta.enumeration_strategies.core_strategies.RuCuCoreStrategy function in permuta

To help you get started, we’ve selected a few permuta examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PermutaTriangle / Permuta / tests / enumeration_strategies / test_core_strategies.py View on Github external
def test_applies(self):
        assert RuCuCoreStrategy([ru, cu])
        assert RuCuCoreStrategy([ru, cu, Perm((0, 1, 2, 3))])
        assert not RuCuCoreStrategy([ru, Perm((0, 1, 2, 3))]).applies()
        assert not RuCuCoreStrategy([ru, cu, Perm((1, 4, 0, 2, 3))]).applies()
        assert RuCuCoreStrategy([ru, cu, Perm((0, 1, 2, 3, 4))]).applies()
        assert RuCuCoreStrategy(
            [ru, cu, Perm((0, 2, 4, 1, 3)), Perm((0, 1, 3, 2, 4))]
        ).applies()
github PermutaTriangle / Permuta / tests / enumeration_strategies / test_core_strategies.py View on Github external
def test_specific_symmetry(self):
        b1 = frozenset([ru, cu, Perm((3, 0, 1, 2))])
        assert not RuCuCoreStrategy(b1)._applies_to_symmetry(b1)
        b2 = frozenset([ru, cu, Perm((0, 3, 2, 1))])
        assert not RuCuCoreStrategy(b2)._applies_to_symmetry(b2)
        b3 = frozenset([ru, cu])
        assert RuCuCoreStrategy(b3)._applies_to_symmetry(b3)
github PermutaTriangle / Permuta / tests / enumeration_strategies / test_enumeration_strategies.py View on Github external
def test_RuCu():
    assert not RuCuCoreStrategy([ru, cu, Perm((1, 4, 0, 2, 3))]).applies()
    assert not RuCuCoreStrategy([ru, Perm((0, 1, 2, 3))]).applies()
    assert RuCuCoreStrategy([ru, cu]).applies()
    assert RuCuCoreStrategy([ru, cu, Perm((0, 1, 2, 3, 4))]).applies()
github PermutaTriangle / Permuta / tests / enumeration_strategies / test_core_strategies.py View on Github external
def test_applies(self):
        assert RuCuCoreStrategy([ru, cu])
        assert RuCuCoreStrategy([ru, cu, Perm((0, 1, 2, 3))])
        assert not RuCuCoreStrategy([ru, Perm((0, 1, 2, 3))]).applies()
        assert not RuCuCoreStrategy([ru, cu, Perm((1, 4, 0, 2, 3))]).applies()
        assert RuCuCoreStrategy([ru, cu, Perm((0, 1, 2, 3, 4))]).applies()
        assert RuCuCoreStrategy(
            [ru, cu, Perm((0, 2, 4, 1, 3)), Perm((0, 1, 3, 2, 4))]
        ).applies()
github PermutaTriangle / Permuta / tests / enumeration_strategies / test_enumeration_strategies.py View on Github external
def test_RuCu():
    assert not RuCuCoreStrategy([ru, cu, Perm((1, 4, 0, 2, 3))]).applies()
    assert not RuCuCoreStrategy([ru, Perm((0, 1, 2, 3))]).applies()
    assert RuCuCoreStrategy([ru, cu]).applies()
    assert RuCuCoreStrategy([ru, cu, Perm((0, 1, 2, 3, 4))]).applies()
github PermutaTriangle / Permuta / tests / enumeration_strategies / test_core_strategies.py View on Github external
def test_applies(self):
        assert RuCuCoreStrategy([ru, cu])
        assert RuCuCoreStrategy([ru, cu, Perm((0, 1, 2, 3))])
        assert not RuCuCoreStrategy([ru, Perm((0, 1, 2, 3))]).applies()
        assert not RuCuCoreStrategy([ru, cu, Perm((1, 4, 0, 2, 3))]).applies()
        assert RuCuCoreStrategy([ru, cu, Perm((0, 1, 2, 3, 4))]).applies()
        assert RuCuCoreStrategy(
            [ru, cu, Perm((0, 2, 4, 1, 3)), Perm((0, 1, 3, 2, 4))]
        ).applies()
github PermutaTriangle / Permuta / tests / enumeration_strategies / test_core_strategies.py View on Github external
def test_specific_symmetry(self):
        b1 = frozenset([ru, cu, Perm((3, 0, 1, 2))])
        assert not RuCuCoreStrategy(b1)._applies_to_symmetry(b1)
        b2 = frozenset([ru, cu, Perm((0, 3, 2, 1))])
        assert not RuCuCoreStrategy(b2)._applies_to_symmetry(b2)
        b3 = frozenset([ru, cu])
        assert RuCuCoreStrategy(b3)._applies_to_symmetry(b3)
github PermutaTriangle / Permuta / tests / enumeration_strategies / test_core_strategies.py View on Github external
def test_specific_symmetry(self):
        b1 = frozenset([ru, cu, Perm((3, 0, 1, 2))])
        assert not RuCuCoreStrategy(b1)._applies_to_symmetry(b1)
        b2 = frozenset([ru, cu, Perm((0, 3, 2, 1))])
        assert not RuCuCoreStrategy(b2)._applies_to_symmetry(b2)
        b3 = frozenset([ru, cu])
        assert RuCuCoreStrategy(b3)._applies_to_symmetry(b3)
github PermutaTriangle / Permuta / permuta / enumeration_strategies / core_strategies.py View on Github external
class Ru2143CoreStrategy(CoreStrategy):
    patterns_needed = frozenset([R_U, Perm((1, 0, 3, 2))])
    corr_number = "10.5"

    @staticmethod
    def is_valid_extension(patt):
        mp = MeshPatt(
            Perm((0, 1)), [(0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 1), (2, 2)]
        )
        patt = fstrip(patt)
        return patt.avoids(mp) and last_skew_component(patt) not in Av([Perm((1, 0))])


core_strategies: List = [
    RuCuCoreStrategy,
    RdCdCoreStrategy,
    RuCuRdCdCoreStrategy,
    RuCuCdCoreStrategy,
    RdCdCuCoreStrategy,
    RdCuCoreStrategy,
    Rd2134CoreStrategy,
    Ru2143CoreStrategy,
]