예제 #1
0
 def testAutoCompleteArcslide(self):
     for slide, d_side_order in [
             (Arcslide(splitPMC(2), 2, 1), (3, 0)),
             (Arcslide(PMC([(0, 3), (1, 6), (2, 4), (5, 7)]), 2, 1),
              (5, 0, 4, 2)),
             (Arcslide(splitPMC(2), 2, 3), (3, 0)),
             (Arcslide(PMC([(0, 3), (1, 6), (2, 4), (5, 7)]), 5, 6),
              (5, 0, 3, 1))]:
         print slide, d_side_order
         raw_da = ArcslideDA(slide).getLocalDAStructure(seeds_only = True)
         autoCompleteDA(raw_da, d_side_order)
예제 #2
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)