signature_function/notebooks/tests.ipynb

35 KiB

%matplotlib inline
%load_ext pycodestyle_magic

# display full output, not only last result, except ended with semicolon
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = 'all';
from IPython.display import Image, SVG
import path
from cagosig import import_sage
cs = import_sage('cable_signature', package='cagosig', path=path.module_path)
sg = import_sage('signature', package='cagosig', path=path.module_path)
m = import_sage('main', package='cagosig', path=path.module_path)

Other cables

knot_formula = "[[k[0], k[1], k[3]]," + \
               " [-k[1], -k[3]]," + \
               " [k[2], k[3]]," + \
               " [-k[0], -k[2], -k[3]]]"
# q_vector = (3, 5, 7, 13)
q_vector = (3, 5, 7, 11)

template = cs.CableTemplate(knot_formula, q_vector=q_vector, verbose=True)
cable = template.cable
# cable.plot_all_summands()
cable.is_function_big_for_all_metabolizers(invariant=cs.SIGMA)
**********
Knot sum:
T(2, 3; 2, 5; 2, 11) # -T(2, 5; 2, 11) # T(2, 7; 2, 11) # -T(2, 3; 2, 7; 2, 11)
[ characters ] sigma value
[0, 0, 1, 1] 4
[0, 0, 2, 2] 4
[0, 0, 3, 3] 4
[0, 0, 4, 4] 4
[0, 0, 5, 5] 0
[0, 0, 6, 6] 0
[0, 0, 7, 7] 4
[0, 0, 8, 8] 4
[0, 0, 9, 9] 4
[0, 0, 10, 10] 4
False

Cables with 8 direct summands

formula_1 = "[[k[0], k[5], k[3]], " + \
                  "[-k[1], -k[3]], " + \
                   "[k[2], k[3]], " + \
           "[-k[0], -k[2], -k[3]]]"
formula_2 = "[[k[4], k[1], k[7]], " + \
                  "[-k[5], -k[7]], " + \
                   "[k[6], k[7]], " + \
           "[-k[4], -k[6], -k[7]]]"



cable_template_1 = cs.CableTemplate(knot_formula=formula_1)
cable_template_2 = cs.CableTemplate(knot_formula=formula_2)
cable_template = cable_template_1 + cable_template_2

Relatively small cables

q_vector = (5, 13, 19, 41,\
            7, 17, 23, 43)
cable_template.fill_q_vector(q_vector=q_vector)
cable = cable_template.cable
print(cable.knot_description)

q_vector_small = (3, 7, 13, 19,\
                  5, 11, 17, 23)
cable_template.fill_q_vector(q_vector=q_vector)
cable = cable_template.cable
print(cable.knot_description)
T(2, 5; 2, 17; 2, 41) # -T(2, 13; 2, 41) # T(2, 19; 2, 41) # -T(2, 5; 2, 19; 2, 41) # T(2, 7; 2, 13; 2, 43) # -T(2, 17; 2, 43) # T(2, 23; 2, 43) # -T(2, 7; 2, 23; 2, 43)
T(2, 5; 2, 17; 2, 41) # -T(2, 13; 2, 41) # T(2, 19; 2, 41) # -T(2, 5; 2, 19; 2, 41) # T(2, 7; 2, 13; 2, 43) # -T(2, 17; 2, 43) # T(2, 23; 2, 43) # -T(2, 7; 2, 23; 2, 43)
# cable.is_signature_big_for_all_metabolizers()

Slice candidate


cable_template.fill_q_vector()
# print(cable_template.q_vector)
# print(cable_template.knot_formula)

slice_canidate = cable_template.cable
print(slice_canidate.knot_description)
sf = slice_canidate(4,4,4,4,0,0,0,0)
sf = slice_canidate(4,1,1,4,0,0,0,0)


# cable.is_signature_big_for_all_metabolizers()
T(2, 5; 2, 71; 2, 347) # -T(2, 67; 2, 347) # T(2, 61; 2, 347) # -T(2, 5; 2, 61; 2, 347) # T(2, 11; 2, 67; 2, 367) # -T(2, 71; 2, 367) # T(2, 79; 2, 367) # -T(2, 11; 2, 79; 2, 367)


# knot_formula = "[[k[0], k[1], k[4]], [-k[1], -k[3]],\
#                  [k[2], k[3]], [-k[0], -k[2], -k[4]]]"

# knot_formula = "[[k[3]], [-k[3]],\
#                 [k[3]], [-k[3]] ]"

# knot_formula = "[[k[3], k[2], k[0]], [-k[2], -k[0]],\
#                  [k[1], k[0]], [-k[3], -k[1], -k[0]]]"

# knot_formula = "[[k[0], k[1], k[2]], [k[3], k[4]],\
#                  [-k[0], -k[3], -k[4]], [-k[1], -k[2]]]"

# knot_formula = "[[k[0], k[1], k[2]], [k[3]],\
#                  [-k[0], -k[1], -k[3]], [-k[2]]]"
formula_1 = "[[k[0], k[5], k[3]], " + \
                  "[-k[1], -k[3]], " + \
                   "[k[2], k[3]], " + \
           "[-k[0], -k[2], -k[3]]]"
formula_2 = "[[k[4], k[1], k[7]], " + \
                  "[-k[5], -k[7]], " + \
                   "[k[6], k[7]], " + \
           "[-k[4], -k[6], -k[7]]]"



cable_template_1 = cs.CableTemplate(knot_formula=formula_1)
cable_template_2 = cs.CableTemplate(knot_formula=formula_2)
cable_template = cable_template_1 + cable_template_2

cable_template.fill_q_vector()
# print(cable_template.q_vector)
# print(cable_template.knot_formula)

slice_canidate = cable_template.cable
print(slice_canidate.knot_description)
sf = slice_canidate(4,4,4,4,0,0,0,0)
sf = slice_canidate(4,1,1,4,0,0,0,0)


slice_canidate.q_order
# slice_canidate.is_signature_big_for_all_metabolizers()
T(2, 5; 2, 71; 2, 347) # -T(2, 67; 2, 347) # T(2, 61; 2, 347) # -T(2, 5; 2, 61; 2, 347) # T(2, 11; 2, 67; 2, 367) # -T(2, 71; 2, 367) # T(2, 79; 2, 367) # -T(2, 11; 2, 79; 2, 367)
127349
formula_1 = "[[k[0], k[5], k[3]], " + \
                  "[-k[5], -k[3]], " + \
                   "[k[2], k[3]], " + \
            "[-k[4], -k[2], -k[3]]]"
formula_2 = "[[k[4], k[1], k[7]], " + \
                  "[-k[1], -k[7]], " + \
                   "[k[6], k[7]], " + \
            "[-k[0], -k[6], -k[7]]]"




cable_template_1 = cs.CableTemplate(knot_formula=formula_1)
cable_template_2 = cs.CableTemplate(knot_formula=formula_2)
cable_template = cable_template_1 + cable_template_2
cable_template.fill_q_vector()

slice_canidate = cable_template.cable
print(slice_canidate.knot_description)

slice_canidate.q_order
# slice_canidate.is_signature_big_for_all_metabolizers()
sigma = slice_canidate.get_sigma_as_function_of_theta()
# sigma((0, 6, 6, 0, 0,0,0,0))
# 13450/83
sigma((9, 9, 9, 9, 0,0,0,0))
T(2, 11; 2, 53; 2, 347) # -T(2, 53; 2, 347) # T(2, 61; 2, 347) # -T(2, 7; 2, 61; 2, 347) # T(2, 7; 2, 71; 2, 367) # -T(2, 71; 2, 367) # T(2, 79; 2, 367) # -T(2, 11; 2, 79; 2, 367)
127349
-4




formula_1 = "[[k[0], k[5], k[3]], " + \
                  "[-k[1], -k[3]], " + \
                         "[ k[3]], " + \
            "[-k[4], -k[6], -k[3]]]"

formula_2 = "[[k[4], k[1], k[7]], " + \
                       "[ -k[7]], " + \
                   "[k[6], k[7]], " + \
            "[-k[0], -k[5], -k[7]]]"




cable_template_1 = cs.CableTemplate(knot_formula=formula_1)
cable_template_2 = cs.CableTemplate(knot_formula=formula_2)
cable_template = cable_template_1 + cable_template_2

cable_template.fill_q_vector()
# print(cable_template.q_vector)
# print(cable_template.knot_formula)

slice_canidate = cable_template.cable
print(slice_canidate.knot_description)
sf = slice_canidate(4,4,4,4,0,0,0,0)
sf = slice_canidate(4,1,1,4,0,0,0,0)
# slice_canidate.is_signature_big_for_all_metabolizers()
T(2, 11; 2, 71; 2, 313) # -T(2, 61; 2, 313) # T(2, 313) # -T(2, 7; 2, 67; 2, 313) # T(2, 7; 2, 61; 2, 347) # -T(2, 347) # T(2, 67; 2, 347) # -T(2, 11; 2, 71; 2, 347)
formula_1 = "       [ [k[5],  k[3]], " + \
            "       [ -k[1], -k[3]], " + \
                   "       [  k[3]], " + \
            "[-k[4],  -k[6], -k[3]]]"

formula_2 = "[[k[4],   k[1],  k[7]], " + \
                       "[    -k[7]], " + \
                     "[k[6],  k[7]], " + \
                    "[-k[5], -k[7]]]"




cable_template_1 = cs.CableTemplate(knot_formula=formula_1)
cable_template_2 = cs.CableTemplate(knot_formula=formula_2)
cable_template = cable_template_1 + cable_template_2

cable_template.fill_q_vector()
# print(cable_template.q_vector)
# print(cable_template.knot_formula)

slice_canidate = cable_template.cable
print(slice_canidate.knot_description)
sf = slice_canidate(4,4,4,4,0,0,0,0)
sf = slice_canidate(4,1,1,4,0,0,0,0)
slice_canidate.q_order
# slice_canidate.is_signature_big_for_all_metabolizers()
T(2, 43; 2, 191) # -T(2, 37; 2, 191) # T(2, 191) # -T(2, 5; 2, 41; 2, 191) # T(2, 5; 2, 37; 2, 211) # -T(2, 211) # T(2, 41; 2, 211) # -T(2, 43; 2, 211)
40301
sf = slice_canidate()
sf = sf[2]
sf.plot()
formula_1 = "[ [k[5],  k[3]], " + \
            "[ -k[1], -k[3]], " + \
            "[         k[3]], " + \
            "[ -k[6], -k[3]]]"

formula_2 = "[[ k[1],   k[7]], " + \
             "[        -k[7]], " + \
             "[  k[6],  k[7]], " + \
             "[ -k[5], -k[7]]]"




cable_template_1 = cs.CableTemplate(knot_formula=formula_1)
cable_template_2 = cs.CableTemplate(knot_formula=formula_2)
cable_template = cable_template_1 + cable_template_2

cable_template.fill_q_vector()
# print(cable_template.q_vector)
# print(cable_template.knot_formula)

slice_canidate = cable_template.cable
print(slice_canidate.knot_description)
sf = slice_canidate(4,4,4,4,0,0,0,0)
sf = slice_canidate(4,1,1,4,0,0,0,0)
slice_canidate.q_order
T(2, 17; 2, 83) # -T(2, 11; 2, 83) # T(2, 83) # -T(2, 13; 2, 83) # T(2, 11; 2, 103) # -T(2, 103) # T(2, 13; 2, 103) # -T(2, 17; 2, 103)
8549
# slice_canidate.is_sigma_big_for_all_metabolizers()
# slice_canidate.is_signature_big_for_all_metabolizers()
# slice_canidate.is_function_big_for_all_metabolizers()
slice_canidate.is_function_big_for_all_metabolizers(invariant=cs.SIGMA)
True
slice_canidate.is_function_big_for_all_metabolizers(invariant=cs.SIGNATURE)
True
sigma = slice_canidate.get_sigma_as_function_of_theta()
sigma((0, 6, 6, 0, 0,0,0,0))
# 13450/83
sigma((9, 0, 0, 9, 0,0,0,0))
4
-4
_, _, sf = slice_canidate((1, 1, 0, 0, 0,0,0,0))
sf
0: 0, 49/2822: -1, 1/34: 2, 61/1826: 1, 117/2822: -1, 1/22: -2, 105/1826: 1, 215/2822: -1, 3/34: 2, 283/2822: -1, 227/1826: 1, 381/2822: -1, 3/22: -2, 5/34: 2, 271/1826: 1, 449/2822: -1, 547/2822: -1, 7/34: 2, 393/1826: 1, 615/2822: -1, 5/22: -2, 437/1826: 1, 713/2822: -1, 9/34: 2, 781/2822: -1, 559/1826: 1, 879/2822: -1, 7/22: -2, 11/34: 2, 603/1826: 1, 947/2822: -1, 1045/2822: -1, 13/34: 2, 1113/2822: -1, 725/1826: 1, 9/22: -2, 769/1826: 1, 1211/2822: -1, 15/34: 2, 1279/2822: -1, 1543/2822: 1, 19/34: -2, 1611/2822: 1, 1057/1826: -1, 13/22: 2, 1101/1826: -1, 1709/2822: 1, 21/34: -2, 1777/2822: 1, 1875/2822: 1, 1223/1826: -1, 23/34: -2, 15/22: 2, 1943/2822: 1, 1267/1826: -1, 2041/2822: 1, 25/34: -2, 2109/2822: 1, 1389/1826: -1, 17/22: 2, 2207/2822: 1, 1433/1826: -1, 27/34: -2, 2275/2822: 1, 2373/2822: 1, 1555/1826: -1, 29/34: -2, 19/22: 2, 2441/2822: 1, 1599/1826: -1, 2539/2822: 1, 31/34: -2, 2607/2822: 1, 1721/1826: -1, 21/22: 2, 2705/2822: 1, 1765/1826: -1, 33/34: -2, 2773/2822: 1, 1: 0.
sg.SignaturePloter.plot(sf)

slice_canidate.plot_sum_for_theta_vector([0r,4r,0r,4r,0r,0r,0r,0r], save_to_dir=True)
T_17_83_inv_T_11_83_T_83_inv_T_13_83_T_11_103_inv_T_103_T_13_103_inv_T_17_103
'T_17_83_inv_T_11_83_T_83_inv_T_13_83_T_11_103_inv_T_103_T_13_103_inv_T_17_103'
sf.plot()