signature_function/main.ipynb

200 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


# magic functions that do not work in current ipython --version
# 
# auto check each cell, E703 - "statement ends with a semicolon"
# %flake8_on --ignore E703
import importlib

def import_sage(module_name):
    
    importlib.invalidate_caches() 
    sage_name = module_name + ".sage"
    python_name = module_name + ".sage.py"

    if os.path.isfile(sage_name):
        os.system('sage --preparse {}'.format(sage_name));
        os.system('mv {} {}.py'.format(python_name, module_name))
    if module_name in sys.modules:
        return importlib.reload(sys.modules[module_name])  
    return importlib.import_module(module_name, package=None)

cs = import_sage('cable_signature')
# sig = import_sage('signature')

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)
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()
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)
# 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)

Other cables



# 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]]]"
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)
cable = template.cable
# cable.plot_all_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

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()
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




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
slice_canidate.is_signature_big_for_all_metabolizers()
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
**********
[0, 0, 1, 1, 0, 0, 0, 0] 2
[0, 0, 2, 2, 0, 0, 0, 0] 2
[0, 0, 3, 3, 0, 0, 0, 0] 2
[0, 0, 4, 4, 0, 0, 0, 0] 6
[0, 0, 5, 5, 0, 0, 0, 0] 6
[0, 0, 6, 6, 0, 0, 0, 0] 6
[0, 0, 7, 7, 0, 0, 0, 0] 8
**********
[0, 1, 1, 0, 0, 0, 0, 0] 2
[0, 2, 2, 0, 0, 0, 0, 0] 2
[0, 3, 3, 0, 0, 0, 0, 0] 2
[0, 4, 4, 0, 0, 0, 0, 0] 6
[0, 5, 5, 0, 0, 0, 0, 0] 6
[0, 6, 6, 0, 0, 0, 0, 0] 6
[0, 7, 7, 0, 0, 0, 0, 0] 6
[0, 8, 8, 0, 0, 0, 0, 0] 8
**********
[0, 2, 2, 0, 0, 0, 0, 0] 2
[0, 4, 4, 0, 0, 0, 0, 0] 6
[0, 6, 6, 0, 0, 0, 0, 0] 6
[0, 8, 8, 0, 0, 0, 0, 0] 8
**********
[0, 3, 3, 0, 0, 0, 0, 0] 2
[0, 6, 6, 0, 0, 0, 0, 0] 6
[0, 9, 9, 0, 0, 0, 0, 0] 8
**********
[0, 4, 4, 0, 0, 0, 0, 0] -6
[0, 8, 8, 0, 0, 0, 0, 0] 8
**********
[0, 5, 5, 0, 0, 0, 0, 0] -6
[0, 10, 10, 0, 0, 0, 0, 0] 8
**********
[0, 6, 6, 0, 0, 0, 0, 0] -6
[0, 12, 12, 0, 0, 0, 0, 0] 10
**********
[0, 7, 7, 0, 0, 0, 0, 0] -6
[0, 14, 14, 0, 0, 0, 0, 0] 10
**********
[1, 0, 0, 1, 0, 0, 0, 0] 4
[2, 0, 0, 2, 0, 0, 0, 0] 4
[3, 0, 0, 3, 0, 0, 0, 0] 8
**********
[1, 1, 0, 0, 0, 0, 0, 0] 4
[2, 2, 0, 0, 0, 0, 0, 0] 4
[3, 3, 0, 0, 0, 0, 0, 0] 8
**********
[1, 1, 1, 1, 0, 0, 0, 0] 6
[2, 2, 2, 2, 0, 0, 0, 0] 6
[3, 3, 3, 3, 0, 0, 0, 0] 10
**********
[1, 2, 2, 1, 0, 0, 0, 0] 6
[2, 4, 4, 2, 0, 0, 0, 0] 10
**********
[1, 3, 3, 1, 0, 0, 0, 0] 6
[2, 6, 6, 2, 0, 0, 0, 0] 10
**********
[2, 2, 0, 0, 0, 0, 0, 0] 4
[4, 4, 0, 0, 0, 0, 0, 0] 4
[6, 6, 0, 0, 0, 0, 0, 0] 4
[8, 8, 0, 0, 0, 0, 0, 0] 8
**********
[2, 2, 1, 1, 0, 0, 0, 0] 6
[4, 4, 2, 2, 0, 0, 0, 0] 6
[6, 6, 3, 3, 0, 0, 0, 0] 6
[8, 8, 4, 4, 0, 0, 0, 0] 6
[10, 10, 5, 5, 0, 0, 0, 0] 6
[12, 12, 6, 6, 0, 0, 0, 0] 8
[14, 14, 7, 7, 0, 0, 0, 0] 8
[16, 16, 8, 8, 0, 0, 0, 0] 6
[18, 18, 9, 9, 0, 0, 0, 0] 10
**********
[4, 4, 0, 0, 0, 0, 0, 0] 4
[8, 8, 0, 0, 0, 0, 0, 0] 8
**********
[4, 4, 1, 1, 0, 0, 0, 0] 6
[8, 8, 2, 2, 0, 0, 0, 0] 8
[12, 12, 3, 3, 0, 0, 0, 0] 6
[16, 16, 4, 4, 0, 0, 0, 0] 8
[20, 20, 5, 5, 0, 0, 0, 0] 8
[24, 24, 6, 6, 0, 0, 0, 0] 10
**********
[5, 5, 0, 0, 0, 0, 0, 0] -4
[10, 10, 0, 0, 0, 0, 0, 0] 8
**********
[5, 5, 1, 1, 0, 0, 0, 0] 4
[10, 10, 2, 2, 0, 0, 0, 0] 8
[15, 15, 3, 3, 0, 0, 0, 0] 10
**********
[6, 6, 0, 0, 0, 0, 0, 0] -4
[12, 12, 0, 0, 0, 0, 0, 0] 4
[18, 18, 0, 0, 0, 0, 0, 0] 8
**********
[6, 6, 1, 1, 0, 0, 0, 0] -4
[12, 12, 2, 2, 0, 0, 0, 0] 6
[18, 18, 3, 3, 0, 0, 0, 0] 10
**********
[7, 7, 0, 0, 0, 0, 0, 0] -4
[14, 14, 0, 0, 0, 0, 0, 0] 8
**********
[7, 7, 1, 1, 0, 0, 0, 0] -6
[14, 14, 2, 2, 0, 0, 0, 0] 10
**********
[8, 8, 1, 1, 0, 0, 0, 0] 8
[16, 16, 2, 2, 0, 0, 0, 0] 10
**********
[12, 12, 0, 0, 0, 0, 0, 0] -4
[24, 24, 0, 0, 0, 0, 0, 0] 8
**********
[12, 12, 1, 1, 0, 0, 0, 0] -6
[24, 24, 2, 2, 0, 0, 0, 0] 10
**********
[26, 29, 0, 1, 0, 0, 0, 0] -8
[52, 58, 0, 2, 0, 0, 0, 0] 10

OK
**********
[0, 0, 0, 0, 0, 0, 1, 1] -4
[0, 0, 0, 0, 0, 0, 2, 2] 4
[0, 0, 0, 0, 0, 0, 3, 3] 4
[0, 0, 0, 0, 0, 0, 4, 4] 4
[0, 0, 0, 0, 0, 0, 5, 5] 4
[0, 0, 0, 0, 0, 0, 6, 6] 4
[0, 0, 0, 0, 0, 0, 7, 7] 4
[0, 0, 0, 0, 0, 0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 6, 6, 0, 0] 6
[0, 0, 0, 0, 7, 7, 0, 0] 6
[0, 0, 0, 0, 8, 8, 0, 0] 6
[0, 0, 0, 0, 9, 9, 0, 0] 6
[0, 0, 0, 0, 10, 10, 0, 0] 8
**********
[0, 0, 0, 0, 1, 1, 1, 1] -6
[0, 0, 0, 0, 2, 2, 2, 2] 6
[0, 0, 0, 0, 3, 3, 3, 3] 6
[0, 0, 0, 0, 4, 4, 4, 4] 6
[0, 0, 0, 0, 5, 5, 5, 5] 10
**********
[0, 0, 0, 0, 1, 2, 2, 1] -6
[0, 0, 0, 0, 2, 4, 4, 2] 10
**********
[0, 0, 0, 0, 1, 3, 3, 1] -6
[0, 0, 0, 0, 2, 6, 6, 2] 10
**********
[0, 0, 0, 0, 1, 6, 6, 1] 8
[0, 0, 0, 0, 2, 12, 12, 2] 10
**********
[0, 0, 0, 0, 1, 7, 7, 1] 8
[0, 0, 0, 0, 2, 14, 14, 2] 10
**********
[0, 0, 0, 0, 1, 8, 8, 1] 8
[0, 0, 0, 0, 2, 16, 16, 2] 12
**********
[0, 0, 0, 0, 1, 15, 11, 0] 6
[0, 0, 0, 0, 2, 30, 22, 0] 10
**********
[0, 0, 0, 0, 2, 2, 0, 0] -2
[0, 0, 0, 0, 4, 4, 0, 0] 2
[0, 0, 0, 0, 6, 6, 0, 0] 6
[0, 0, 0, 0, 8, 8, 0, 0] 6
[0, 0, 0, 0, 10, 10, 0, 0] 8
**********
[0, 0, 0, 0, 2, 2, 1, 1] -6
[0, 0, 0, 0, 4, 4, 2, 2] 6
[0, 0, 0, 0, 6, 6, 3, 3] 10
**********
[0, 0, 0, 0, 3, 3, 0, 0] -2
[0, 0, 0, 0, 6, 6, 0, 0] 6
[0, 0, 0, 0, 9, 9, 0, 0] 6
[0, 0, 0, 0, 12, 12, 0, 0] 8
**********
[0, 0, 0, 0, 3, 3, 1, 1] -6
[0, 0, 0, 0, 6, 6, 2, 2] 10
**********
[0, 0, 0, 0, 4, 4, 0, 0] -2
[0, 0, 0, 0, 8, 8, 0, 0] 6
[0, 0, 0, 0, 12, 12, 0, 0] 8
**********
[0, 0, 0, 0, 4, 4, 1, 1] -6
[0, 0, 0, 0, 8, 8, 2, 2] 10
**********
[0, 0, 0, 0, 5, 5, 0, 0] 6
[0, 0, 0, 0, 10, 10, 0, 0] 8
**********
[0, 0, 0, 0, 6, 6, 0, 0] 6
[0, 0, 0, 0, 12, 12, 0, 0] 8
**********
[0, 0, 0, 0, 7, 7, 0, 0] 6
[0, 0, 0, 0, 14, 14, 0, 0] 8
**********
[0, 0, 0, 0, 8, 8, 0, 0] 6
[0, 0, 0, 0, 16, 16, 0, 0] 10
**********
[0, 0, 0, 0, 9, 9, 0, 0] 6
[0, 0, 0, 0, 18, 18, 0, 0] 10
**********
[0, 0, 0, 0, 11, 15, 1, 0] 6
[0, 0, 0, 0, 22, 30, 2, 0] 10

OK
True
_, _, sf = slice_canidate((1, 1, 0, 0, 0,0,0,0))
slice_canidate.plot_sum_for_theta_vector([0,4,0,4,0,0,0,0], 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()