Пример #1
0
    def __init__(self, start_pmc, insert_pos):
        """Specifies the starting PMC, and the point of inserting the genus-1
        split PMC.
        - insert_pos = 0: insert at bottom
        - insert_pos = start_pmc.n: insert at top

        """
        self.start_pmc = start_pmc
        self.insert_pos = insert_pos

        # Prepare end_pmc
        translate = dict()
        for p in range(self.start_pmc.n):
            if p < insert_pos:
                translate[p] = p
            else:  # p >= insert_pos
                translate[p] = p + 4
        self.end_pmc = PMC(
            [(translate[p], translate[q]) for p, q in self.start_pmc.pairs] +
            [(insert_pos, insert_pos+2), (insert_pos+1, insert_pos+3)])

        assert insert_pos >= 1 and insert_pos < start_pmc.n

        # Possible cases
        self.MIDDLE, self.NEXT_BOTTOM = 0, 1
        if insert_pos >= 2:
            self.case = self.MIDDLE
        else:
            self.case = self.NEXT_BOTTOM

        self.splitting1 = PMCSplitting(
            self.start_pmc, [(insert_pos-1, insert_pos-1)])
        self.splitting2 = PMCSplitting(
            self.end_pmc, [(insert_pos-1, insert_pos+3)])

        self.local_pmc1 = self.splitting1.local_pmc
        self.local_pmc2 = self.splitting2.local_pmc

        # Required so the left to right transition on the outside can proceed.
        assert self.splitting1.outer_pmc == self.splitting2.outer_pmc

        self.local_da = self.getLocalDAStructure()

        # Uncomment to use autoComplete. Note limit on len(coeffs_a) is 5.
        # if self.case == self.MIDDLE:
        #     autoCompleteDA(self.local_da, [0, 1])

        # Initiate the ExtendedDAStructure
        ExtendedDAStructure.__init__(
            self, self.local_da, self.splitting1, self.splitting2)

        # With generators set, add grading. Choose a generator of class zero as
        # base generator.
        for gen in self.generators:
            if gen.name[0] == "0":
                base_gen = gen
                break
        self.registerHDiagram(
            getSimpleCobordismDiagram(start_pmc, insert_pos), base_gen)
Пример #2
0
    def __init__(self, genus, c_pair):
        """Specifies genus of the starting PMC and the ID of the pair of
        anti-braid resolution.

        """
        self.genus = genus
        self.c_pair = c_pair
        self.pmc = linearPMC(genus)

        self.n = 4 * genus
        self.c1, self.c2 = self.pmc.pairs[c_pair]

        if self.c2 == self.c1 + 3:
            self.is_degenerate = False
        else:
            assert self.c2 == self.c1 + 2
            assert self.c1 == 0 or self.c2 == self.n - 1
            self.is_degenerate = True

        if self.is_degenerate:
            # One position between c1 and c2, called p
            self.p = self.c1 + 1
            self.p_pair = self.pmc.pairid[self.p]
        else:
            # Two positions between c1 and c2, for (d)own and (u)p
            self.d = self.c1 + 1
            self.u = self.c1 + 2
            self.d_pair = self.pmc.pairid[self.d]
            self.u_pair = self.pmc.pairid[self.u]

        # Necessary to get local DA structure.
        self.splitting = PMCSplitting(self.pmc, [(self.c1, self.c2)])
        self.local_pmc = self.splitting.local_pmc
        self.mapping = self.splitting.local_mapping

        # Local DA Structure
        self.local_da = self.getLocalDAStructure()

        ### Uncomment to use autocompleteda to construct arrows from seeds.
        # autoCompleteDA(self.local_da, ([]))

        # Initiate the ExtendedDAStructure
        ExtendedDAStructure.__init__(self, self.local_da,
                                     self.splitting, self.splitting)
Пример #3
0
    def __init__(self, cob):
        """Specifies the cobordism to use. cob should be of type Cobordism,
        with cob.side == LEFT.

        """
        assert cob.side == LEFT

        self.cob = cob
        self.genus, self.c_pair, self.n = cob.genus, cob.c_pair, cob.n
        self.start_pmc, self.end_pmc = cob.start_pmc, cob.end_pmc
        self.large_pmc, self.small_pmc = cob.large_pmc, cob.small_pmc
        self.is_degenerate = cob.is_degenerate
        self.c1, self.c2 = cob.c1, cob.c2

        # Four possible local cases
        self.MIDDLE, self.NEXT_TOP, self.TOP, self.BOTTOM = 0, 1, 2, 3

        if not self.is_degenerate:
            self.d, self.u = self.cob.d, self.cob.u
            self.to_s, self.pair_to_s = self.cob.to_s, self.cob.pair_to_s
            self.d_pair, self.u_pair = self.cob.d_pair, self.cob.u_pair
            self.du_pair = self.cob.du_pair  # refers to the smaller PMC.
            self.sd, self.su = self.small_pmc.pairs[self.du_pair]

            u1, u2 = self.large_pmc.pairs[self.u_pair]
            assert u1 == self.u
            if self.c_pair < 2*self.genus-2:
                # First case: c-pair at least two pairs from top
                self.case = self.MIDDLE
                self.splitting_small = PMCSplitting(
                    self.small_pmc, [(self.su-1, self.su)])
                self.splitting_large = PMCSplitting(
                    self.large_pmc, [(self.c1, u2)])
            else:
                # Second case: c-pair is the next-to-topmost pair
                assert self.c_pair == 2*self.genus-2
                assert u2 == u1 + 2
                self.case = self.NEXT_TOP
                self.splitting_small = PMCSplitting(
                    self.small_pmc, [(self.su, self.su)])
                self.splitting_large = PMCSplitting(
                    self.large_pmc, [(self.c1, u2)])
        else:
            assert self.c2 == self.c1 + 2
            if self.c_pair == 2*self.genus-1:
                # Third case: degenerate at top
                self.case = self.TOP
                self.splitting_small = PMCSplitting(
                    self.small_pmc, [(self.n-5, self.n-5)])  # topmost point
                self.splitting_large = PMCSplitting(
                    self.large_pmc, [(self.c1-2, self.c2)])
            else:
                # Fourth case: degenerate at bottom
                assert self.c_pair == 0
                self.case = self.BOTTOM
                self.splitting_small = PMCSplitting(self.small_pmc, [(0, 0)])
                self.splitting_large = PMCSplitting(self.large_pmc, [(0, 4)])

        # Assumes the LEFT case
        self.splitting1 = self.splitting_large
        self.splitting2 = self.splitting_small
        self.local_pmc1 = self.splitting1.local_pmc
        self.local_pmc2 = self.splitting2.local_pmc

        # Required so the left to right transition on the outside can proceed.
        assert self.splitting1.outer_pmc == self.splitting2.outer_pmc

        self.local_da = self.getLocalDAStructure()

        if self.case == self.MIDDLE:
            autoCompleteDA(self.local_da, [2, 1, 0, 5, 6])
        elif self.case == self.NEXT_TOP:
            autoCompleteDA(self.local_da, [2, 1, 0])
        elif self.case == self.TOP:
            autoCompleteDA(self.local_da, [3, 1])
        else:
            autoCompleteDA(self.local_da, [0, 3])

        # Initiate the ExtendedDAStructure
        ExtendedDAStructure.__init__(
            self, self.local_da, self.splitting1, self.splitting2)

        # With generators set, add grading. Any generator can serve as base_gen
        for gen in self.generators:
            base_gen = gen
            break
        self.registerHDiagram(getCobordismDiagramLeft(self.cob), base_gen)
Пример #4
0
    def __init__(self, slide):
        """Specifies the arcslide to use. slide should be of type Arcslide.
        In addition to recording slide, construct the following:
        local_pmc1, mapping1 - restriction of starting pmc to location of slide.
        outer_pmc1, outer_mapping1 - complement of slide in starting pmc.
        local_pmc2, mapping2, outer_pmc2, outer_mapping2
          - same, but for ending pmc.
        Moreover, find pattern_fun and translator as appropriate for the case at
        hand.

        """
        self.slide = slide
        self.pmc1, self.pmc2 = slide.start_pmc, slide.end_pmc

        n = self.pmc1.n
        b1, c1, c2 = slide.b1, slide.c1, slide.c2
        b1p, c1p, c2p = [slide.to_r[p] for p in b1, c1, c2]

        # Note intervals (start, end) with start > end are ignored.
        # patterns_base specifies one of the four base patterns of arcslides.
        # translator gives the mapping between points in the base pattern and
        # points in the pattern at hand.
        if b1 == c1 + 1:  # downward
            if c2 == c1 + 2:  # short underslide downward
                local_cut1, local_cut2 = ([(c1, c2)], [(c1p, c2p)])
                patterns_fun = ArcslideDA._short_underslide_down
                if c1 == 0:
                    translator = ([-1, 0, 1, 2, 3], [-1, 0, 1, 2, 3])
                elif c2 == n - 1:
                    translator = ([0, 1, 2, 3, -1], [0, 1, 2, 3, -1])
                else:
                    translator = None
            elif c2 > c1:  # general underslide downward
                local_cut1, local_cut2 = (
                    [(c1, b1), (c2, c2)], [(c1p, c1p), (b1p, c2p)])
                patterns_fun = ArcslideDA._general_underslide_down
                if c1 == 0:
                    translator = ([-1, 0, 1, 2, 3, 4, 5],
                                  [-1, 0, 1, 2, 3, 4, 5])
                elif c2 == n - 1:
                    translator = ([0, 1, 2, 3, 4, 5, -1],
                                  [0, 1, 2, 3, 4, 5, -1])
                else:
                    translator = None
            else:  # c2 < c1, general overslide downward
                local_cut1, local_cut2 = (
                    [(c2, c2), (c1, b1)], [(b1p, c2p), (c1p, c1p)])
                patterns_fun = ArcslideDA._general_underslide_down
                if c2 == 0 and b1 == n - 1:
                    translator = ([2, 3, 4, -1, -1, 0, 1],
                                  [3, 4, -1, -1, 0, 1, 2])
                elif c2 == 0:
                    translator = ([2, 3, 4, 5, -1, 0, 1],
                                  [3, 4, 5, -1, 0, 1, 2])
                elif b1 == n - 1:
                    translator = ([3, 4, 5, -1, 0, 1, 2],
                                  [4, 5, -1, 0, 1, 2, 3])
                else:
                    translator = ([3, 4, 5, 6, 0, 1, 2], [4, 5, 6, 0, 1, 2, 3])
        elif b1 == c1 - 1:  # upward
            if c2 == c1 - 2:  # short underslide upward
                local_cut1, local_cut2 = ([(c2, c1)], [(c2p, c1p)])
                patterns_fun = ArcslideDA._short_underslide_up
                if c2 == 0:
                    translator = ([-1, 0, 1, 2, 3], [-1, 0, 1, 2, 3])
                elif c1 == n - 1:
                    translator = ([0, 1, 2, 3, -1], [0, 1, 2, 3, -1])
                else:
                    translator = None
            elif c2 < c1:  # general underslide upward
                local_cut1, local_cut2 = (
                    [(c2, c2), (b1, c1)], [(c2p, b1p), (c1p, c1p)])
                patterns_fun = ArcslideDA._general_underslide_up
                if c2 == 0:
                    translator = ([-1, 0, 1, 2, 3, 4, 5],
                                  [-1, 0, 1, 2, 3, 4, 5])
                elif c1 == n - 1:
                    translator = ([0, 1, 2, 3, 4, 5, -1],
                                  [0, 1, 2, 3, 4, 5, -1])
                else:
                    translator = None
            else:  # c2 > c1, general overslide upward
                local_cut1, local_cut2 = (
                    [(b1, c1), (c2, c2)], [(c1p, c1p), (c2p, b1p)])
                patterns_fun = ArcslideDA._general_underslide_up
                if b1 == 0 and c2 == n - 1:
                    translator = ([3, 4, -1, -1, 0, 1, 2],
                                  [2, 3, 4, -1, -1, 0, 1])
                elif b1 == 0:
                    translator = ([3, 4, 5, -1, 0, 1, 2],
                                  [2, 3, 4, 5, -1, 0, 1])
                elif c2 == n - 1:
                    translator = ([4, 5, -1, 0, 1, 2, 3],
                                  [3, 4, 5, -1, 0, 1, 2])
                else:
                    translator = ([4, 5, 6, 0, 1, 2, 3], [3, 4, 5, 6, 0, 1, 2])
        else:
            # All cases are covered. Should not happen.
            raise NotImplementedError(
                "This slide pattern is not yet implemented.")

        self.patterns_fun = patterns_fun
        self.translator = translator

        # Necesssary to get local DA structure.
        self.splitting1 = PMCSplitting(self.pmc1, local_cut1)
        self.splitting2 = PMCSplitting(self.pmc2, local_cut2)
        self.local_pmc1 = self.splitting1.local_pmc
        self.local_pmc2 = self.splitting2.local_pmc
        self.mapping1 = self.splitting1.local_mapping
        self.mapping2 = self.splitting2.local_mapping

        # Required so the left to right transition on the outside can proceed.
        assert self.splitting1.outer_pmc == self.splitting2.outer_pmc

        # Initiate the ExtendedDAStructure
        ExtendedDAStructure.__init__(
            self, self.getLocalDAStructure(), self.splitting1, self.splitting2)

        # With generators set, add grading. Any generator can serve as base_gen
        for gen in self.generators:
            base_gen = gen
            break
        self.registerHDiagram(getArcslideDiagram(self.slide), base_gen)