This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def final_seifert_circles(self): | |
sc = self.seifert_circles() | |
regions = self.regions() | |
y = self.PD_code() | |
while True: | |
x = deepcopy(y) | |
q1 = deepcopy(regions) | |
q = [[[],[]] for i in range(len(regions))] | |
for i in range(len(regions)): | |
for j in range(len(regions[i])): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def final_seifert_circles(self): | |
sc = self.seifert_circles() | |
regions = self.regions() | |
y = self.PD_code() | |
while True: | |
q = [[[],[]] for i in range(len(regions))] | |
for i in range(len(regions)): | |
for j in range(len(regions[i])): | |
if regions[i][j] < 0: | |
q[i][0].append(regions[i][j]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sage: L = link.Link(oriented_gauss_code = [[-1, +2, -3, 4, +5, +1, -2, +6, +7, 3, -4, -7, -6,-5],['-','-','-','-','+','-','+']]) | |
sage: L.regions() | |
[[4, -11], | |
[2, -7], | |
[6, -1], | |
[13, 9], | |
[-4, -10, -12], | |
[-8, -2, -6, -14], | |
[10, -3, 8, -13], | |
[14, -5, 12, -9], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def remove_regions(self): | |
y = self.PD_code() | |
x = deepcopy(y) | |
sc = self.seifert_circles() | |
regions = self.regions() | |
q1 = deepcopy(regions) | |
#splitting into positive and negative for each region | |
q = [[[],[]] for i in range(len(regions))] | |
for i in range(len(regions)): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add(self): | |
y = self.subtract() | |
<some other code> | |
if do something: | |
y = None | |
else: | |
return y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def final(self): | |
x = self.PD_code() | |
L = Link(PD_code = x) | |
y = L.remove_regions() | |
while True: | |
if y == 'No more regions': | |
break | |
else: | |
L = Link(PD_code = y) | |
y = L.remove_regions() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def remove_regions(self): | |
#self.oriented_gauss_code = oriented_gauss_code | |
z = self.PD_code() | |
x = deepcopy(z) | |
#x = self.PD_code_ogc(self.oriented_gauss_code) | |
#sc = self.seifert_circles(self.oriented_gauss_code) | |
sc = self.seifert_circles() | |
#print sc | |
#regions = self.regions(self.oriented_gauss_code) | |
regions = self.regions() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sage: L = link.Link(oriented_gauss_code = [[-1, +2, -3, 4, +5, +1, -2, +6, +7, 3, -4, -7, -6,-5],['-','-','-','-','+','-','+']]) | |
sage: L.PD_code() | |
[[1, 7, 2, 6], | |
[7, 3, 8, 2], | |
[3, 11, 4, 10], | |
[11, 5, 12, 4], | |
[14, 5, 1, 6], | |
[13, 9, 14, 8], | |
[12, 9, 13, 10]] | |
sage: e = [[1, 7, 2, 6], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sage: q = {1: [[18, 4, 19, 3], [17, 4, 18, 5]], 2: [[1, 9, 2, 8], [9, 3, 10, 2], [5, 13, 6, 12], [13, 7, 14, 6], [22, 7, 1, 8], [19, 11, 20, 10], [16, 11, 17, 12], [18, 4, 19, 3], [17, 4, 18, 5]], 3: [[1, 9, 2, 8], [9, 3, 10, 2], [5, 13, 6, 12], [13, 7, 14, 6], [22, 7, 1, 8], [19, 11, 20, 10], [16, 11, 17, 12], [21, 14, 22, 15], [20, 16, 21, 15]], 4: [[21, 14, 22, 15], [20, 16, 21, 15]]} | |
sage: t = {1: ['-', '+'], 2: ['-', '-', '-', '-', '+', '-', '+', '-', '+'], 3: ['-', '-', '-', '-', '+', '-', '+', '+', '-'], 4: ['+', '-']} | |
sage: for i in q.iterkeys(): | |
for j in range(len(q[i])): | |
if t[i][j] == "-": | |
del q[i][j][3] | |
del q[i][j][0] | |
elif t[i][j] == "+": | |
del q[i][j][1] | |
del q[i][j][0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def seifert_to_braid(self): | |
sc = self.final()[0] | |
regions = self.final()[1] | |
pd_code = self.final()[2] | |
#making regions positive | |
for i in regions: | |
for j in range(len(i)): | |
if i[j] < 0: | |
i[j] = (-1)*i[j] | |
#finding which sc are same as regions |