Ejemplo n.º 1
0
 def f_crystal_operator(self, element_index, operator_index):
     multisetvalued = not self._decreasing
     w, i = self.factorizations[element_index]
     p, q = InsertionAlgorithm.hecke(w, i, multisetvalued=multisetvalued)
     q = q.f_crystal_operator(operator_index, multisetvalued=multisetvalued)
     if q is None:
         return None
     else:
         ans = InsertionAlgorithm.inverse_hecke(
             p, q, multisetvalued=multisetvalued)
         element_indices = [x for x in range(len(self)) if self[x] == ans]
         assert len(element_indices) == 1
         return element_indices[0]
Ejemplo n.º 2
0
def test_decreasing_word_crystal_locality():
    def to_tuple(word, record, k):
        tup = tuple(
            tuple(word[x] for x in range(len(record)) if record[x] == y)
            for y in range(1, k + 1))
        return ' | '.join([' '.join([str(a) for a in w]) for w in tup])

    for word in Permutation.hecke_words(5):
        for k in range(len(word)):
            for f in WordCrystalGenerator.get_increasing_factorizations(
                    word, k, decreasing=True):
                for op_index in range(1, len(f) - 1):
                    w, i = WordCrystalGenerator.factorization_tuple_to_array(f)
                    p, q = InsertionAlgorithm.hecke(w, i, multisetvalued=False)
                    q = q.f_crystal_operator(op_index)
                    if q is not None:
                        v, j = InsertionAlgorithm.inverse_hecke(
                            p, q, multisetvalued=False)

                        omit = [op_index, op_index + 1]

                        t = {
                            w[x]
                            for x in range(len(w))
                            if i[x] not in omit and w[x] != v[x]
                        }
                        t1 = tuple(w[x] for x in range(len(w))
                                   if i[x] not in omit)
                        t2 = tuple(v[x] for x in range(len(v))
                                   if j[x] not in omit)

                        if len(t) > 1:
                            print('t =', t)
                            print(op_index)
                            # print(w)
                            # print(i)
                            print(to_tuple(w, i, k))
                            print(to_tuple(v, j, k))
                            print()
                            # print(v)
                            # print(j)
                            print()
                        assert len(t) <= 1
Ejemplo n.º 3
0
def test_hecke_insertion():
    w = (3, 2, 1, 1)
    i = (1, 1, 1, 2)
    insertion, recording = InsertionAlgorithm.hecke(w, i, multisetvalued=False)
    p = Tableau({(1, 1): 1, (1, 2): 2, (1, 3): 3})
    q = Tableau({(1, 1): 1, (1, 2): 1, (1, 3): (1, 2)})
    print(insertion)
    assert insertion == p
    assert recording == q
    assert InsertionAlgorithm.inverse_hecke(p, q,
                                            multisetvalued=False) == (w, i)

    p = Tableau({(1, 1): 1, (1, 2): 2, (2, 1): 2})
    q = Tableau({(1, 1): 2, (1, 2): 3, (2, 1): 3})
    assert InsertionAlgorithm.inverse_hecke(
        p, q, multisetvalued=False) == ((1, 2, 1), (2, 3, 3))

    i = (1, 2, 3, 3)
    insertion, recording = InsertionAlgorithm.hecke(w, i)
    p = Tableau({(1, 1): 1, (2, 1): 2, (3, 1): 3})
    q = Tableau({(1, 1): 1, (2, 1): 2, (3, 1): (3, 3)})
    print(insertion)
    assert insertion == p
    assert recording == q
    assert InsertionAlgorithm.inverse_hecke(p, q) == (w, i)

    w = (1, 5, 1, 3, 3)
    i = (1, 1, 3, 3, 3)
    insertion, recording = InsertionAlgorithm.hecke(w)

    p = Tableau({(1, 1): 1, (1, 2): 3, (2, 1): 5})
    q = Tableau({(1, 1): 1, (1, 2): (2, 5), (2, 1): (3, 4)})

    assert insertion == p
    assert recording == q
    assert InsertionAlgorithm.inverse_hecke(p, q) == (w, (1, 2, 3, 4, 5))

    insertion, recording = InsertionAlgorithm.hecke(w, i)

    q = Tableau({(1, 1): 1, (1, 2): (1, 3), (2, 1): (3, 3)})

    assert insertion == p
    assert recording == q
    assert InsertionAlgorithm.inverse_hecke(p, q) == (w, i)

    insertion, q = InsertionAlgorithm.hecke((3, 4, 1, 2, 4))

    p = Tableau({
        (1, 1): 1,
        (1, 2): 2,
        (1, 3): 4,
        (2, 1): 3,
        (2, 2): 4,
    })
    assert insertion == p
    assert InsertionAlgorithm.inverse_hecke(p, q) == ((3, 4, 1, 2, 4),
                                                      (1, 2, 3, 4, 5))

    insertion, q = InsertionAlgorithm.hecke((3, 1, 2, 4))

    p = Tableau({(1, 1): 1, (1, 2): 2, (1, 3): 4, (2, 1): 3})
    assert insertion == p
    assert InsertionAlgorithm.inverse_hecke(p,
                                            q) == ((3, 1, 2, 4), (1, 2, 3, 4))
Ejemplo n.º 4
0
 def inverse_hecke(self):
     return lambda p, q: InsertionAlgorithm.inverse_hecke(
         p, q, multisetvalued=self.multisetvalued)
def irsk_inverse(tab):
    return Permutation(*InsertionAlgorithm.inverse_hecke(tab, tab)[0])
def anti_representative_m(mu):
    t = Tableau(
        {box: i + 1
         for i, box in enumerate(sorted(Partition.shape(mu)))})
    oneline, _ = InsertionAlgorithm.inverse_hecke(t, t)
    return Permutation(*oneline)