2020-10-14 17:21:17 +02:00
|
|
|
#!/usr/bin/python
|
2020-10-22 13:33:18 +02:00
|
|
|
|
|
|
|
# TBD: read about Factory Method, variable in docstring, sage documentation,
|
|
|
|
# print calc. to output file
|
|
|
|
# delete separation for twisted_part and untwisted_part
|
|
|
|
# decide about printing option
|
|
|
|
|
2020-10-15 07:16:42 +02:00
|
|
|
import os
|
|
|
|
import sys
|
2020-10-14 17:21:17 +02:00
|
|
|
|
2020-10-15 07:16:42 +02:00
|
|
|
import itertools as it
|
|
|
|
import re
|
2020-10-14 17:21:17 +02:00
|
|
|
import numpy as np
|
|
|
|
|
2020-11-05 15:10:12 +01:00
|
|
|
attach("signature.sage")
|
2020-10-15 07:16:42 +02:00
|
|
|
attach("cable_signature.sage")
|
2020-11-02 09:32:39 +01:00
|
|
|
|
2020-10-15 07:16:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Config(object):
|
|
|
|
def __init__(self):
|
|
|
|
self.f_results = os.path.join(os.getcwd(), "results.out")
|
|
|
|
|
|
|
|
# knot_formula is a schema for knots which signature function
|
|
|
|
# will be calculated
|
|
|
|
self.knot_formula = "[[k[0], k[1], k[3]], " + \
|
|
|
|
"[-k[1], -k[3]], " + \
|
|
|
|
"[k[2], k[3]], " + \
|
|
|
|
"[-k[0], -k[2], -k[3]]]"
|
|
|
|
|
|
|
|
# self.knot_formula = "[[k[0], k[1], k[4]], [-k[1], -k[3]], \
|
|
|
|
# [k[2], k[3]], [-k[0], -k[2], -k[4]]]"
|
|
|
|
#
|
|
|
|
# self.knot_formula = "[[k[3]], [-k[3]], \
|
|
|
|
# [k[3]], [-k[3]] ]"
|
|
|
|
#
|
|
|
|
# self.knot_formula = "[[k[3], k[2], k[0]], [-k[2], -k[0]], \
|
|
|
|
# [k[1], k[0]], [-k[3], -k[1], -k[0]]]"
|
|
|
|
#
|
|
|
|
# self.knot_formula = "[[k[0], k[1], k[2]], [k[3], k[4]], \
|
|
|
|
# [-k[0], -k[3], -k[4]], [-k[1], -k[2]]]"
|
|
|
|
# self.knot_formula = "[[k[0], k[1], k[2]], [k[3]],\
|
|
|
|
# [-k[0], -k[1], -k[3]], [-k[2]]]"
|
|
|
|
self.limit = 3
|
|
|
|
|
|
|
|
self.verbose = True
|
|
|
|
# self.verbose = False
|
|
|
|
|
2020-11-02 09:32:39 +01:00
|
|
|
|
|
|
|
|
2020-10-15 07:16:42 +02:00
|
|
|
def main(arg=None):
|
|
|
|
try:
|
|
|
|
limit = int(arg[1])
|
|
|
|
except (IndexError, TypeError):
|
|
|
|
limit = None
|
|
|
|
|
2020-11-05 15:10:12 +01:00
|
|
|
# global cable_template , cable_template_2, cable_template_1
|
2020-10-14 17:21:17 +02:00
|
|
|
|
2020-11-05 15:10:12 +01:00
|
|
|
knot_formula = "[[k[0], k[1], k[3]], " + \
|
|
|
|
"[-k[1], -k[3]], " + \
|
|
|
|
"[k[2], k[3]], " + \
|
|
|
|
"[-k[0], -k[2], -k[3]]]"
|
|
|
|
template = CableTemplate(knot_formula, q_vector=[3, 5, 7, 11])
|
|
|
|
cab = template.cable
|
|
|
|
# cab.plot_all_summands()
|
2020-11-05 17:59:36 +01:00
|
|
|
cab.plot_sum_for_theta_vector([0,4,0,4], save_to_dir=True)
|
2020-10-14 17:21:17 +02:00
|
|
|
# knot_formula = config.knot_formula
|
|
|
|
# q_vector = (3, 5, 7, 13)
|
|
|
|
# q_vector = (3, 5, 7, 11)
|
|
|
|
|
2020-10-17 20:15:48 +02:00
|
|
|
formula_1 = "[[k[0], k[5], k[3]], " + \
|
2020-11-02 09:32:39 +01:00
|
|
|
"[-k[1], -k[3]], " + \
|
|
|
|
"[k[2], k[3]], " + \
|
|
|
|
"[-k[0], -k[2], -k[3]]]"
|
2020-10-17 20:15:48 +02:00
|
|
|
formula_2 = "[[k[4], k[1], k[7]], " + \
|
2020-11-02 09:32:39 +01:00
|
|
|
"[-k[5], -k[7]], " + \
|
|
|
|
"[k[6], k[7]], " + \
|
|
|
|
"[-k[4], -k[6], -k[7]]]"
|
|
|
|
q_vector = (5, 13, 19, 41,\
|
2020-11-05 15:10:12 +01:00
|
|
|
7, 17, 23, 43)
|
|
|
|
q_vector_small = (3, 7, 13, 19,\
|
2020-11-02 09:32:39 +01:00
|
|
|
5, 11, 17, 23)
|
|
|
|
|
2020-11-05 15:10:12 +01:00
|
|
|
cable_template_1 = CableTemplate(knot_formula=formula_1)
|
|
|
|
cable_template_2 = CableTemplate(knot_formula=formula_2)
|
|
|
|
cable_template = cable_template_1 + cable_template_2
|
|
|
|
cable_with_shift = cable_template_1.add_with_shift(cable_template_2)
|
|
|
|
print(cable_with_shift.knot_formula)
|
|
|
|
cable_template.fill_q_vector()
|
2020-11-05 19:18:01 +01:00
|
|
|
print(cable_template.q_vector)
|
|
|
|
print(cable_template.knot_formula)
|
2020-11-05 15:10:12 +01:00
|
|
|
cable = cable_template.cable
|
2020-11-02 09:32:39 +01:00
|
|
|
|
2020-11-05 15:10:12 +01:00
|
|
|
sf = cable(4,4,4,4,0,0,0,0)
|
2020-11-02 09:32:39 +01:00
|
|
|
|
2020-11-05 15:10:12 +01:00
|
|
|
sf = cable_template.cable.signature_as_function_of_theta(4,1,1,4,0,0,0,0)
|
2020-11-02 09:32:39 +01:00
|
|
|
|
|
|
|
|
2020-11-05 19:18:01 +01:00
|
|
|
# cable_template.cable.is_signature_big_for_all_metabolizers()
|
2020-11-02 09:32:39 +01:00
|
|
|
|
2020-11-05 15:10:12 +01:00
|
|
|
|
|
|
|
cable_template_1 = CableTemplate(knot_formula=formula_1)
|
|
|
|
cable_template_2 = CableTemplate(knot_formula=formula_2)
|
|
|
|
cable_template = cable_template_1 + cable_template_2
|
2020-11-05 19:18:01 +01:00
|
|
|
# cable_template.cable.is_signature_big_for_all_metabolizers()
|
|
|
|
# sf = cable_template.cable.signature_as_function_of_theta(4,4,4,4,0,0,0,0)
|
2020-11-02 09:32:39 +01:00
|
|
|
|
|
|
|
|
2020-10-15 07:16:42 +02:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
global config
|
|
|
|
config = Config()
|
|
|
|
if '__file__' in globals():
|
|
|
|
# skiped in interactive mode as __file__ is not defined
|
|
|
|
main(sys.argv)
|
|
|
|
else:
|
|
|
|
pass
|
|
|
|
# main()
|
2020-10-17 20:15:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
This script calculates signature functions for knots (cable sums).
|
|
|
|
|
|
|
|
The script can be run as a sage script from the terminal
|
|
|
|
or used in interactive mode.
|
|
|
|
|
|
|
|
A knot (cable sum) is encoded as a list where each element (also a list)
|
|
|
|
corresponds to a cable knot, e.g. a list
|
|
|
|
[[1, 3], [2], [-1, -2], [-3]] encodes
|
|
|
|
T(2, 3; 2, 7) # T(2, 5) # -T(2, 3; 2, 5) # -T(2, 7).
|
|
|
|
|
|
|
|
To calculate the number of characters for which signature function vanish use
|
|
|
|
the function eval_cable_for_null_signature as shown below.
|
|
|
|
|
|
|
|
sage: eval_cable_for_null_signature([[1, 3], [2], [-1, -2], [-3]])
|
|
|
|
|
|
|
|
T(2, 3; 2, 7) # T(2, 5) # -T(2, 3; 2, 5) # -T(2, 7)
|
|
|
|
Zero cases: 1
|
|
|
|
All cases: 1225
|
|
|
|
Zero theta combinations:
|
|
|
|
(0, 0, 0, 0)
|
|
|
|
|
|
|
|
sage:
|
|
|
|
|
|
|
|
The numbers given to the function eval_cable_for_null_signature are k-values
|
|
|
|
for each component/cable in a direct sum.
|
|
|
|
|
|
|
|
To calculate signature function for a knot and a theta value, use function
|
|
|
|
get_signature_as_function_of_theta (see help/docstring for details).
|
|
|
|
|
|
|
|
About notation:
|
|
|
|
Cables that we work with follow a schema:
|
|
|
|
T(2, q_1; 2, q_2; 2, q_4) # -T(2, q_2; 2, q_4) #
|
|
|
|
# T(2, q_3; 2, q_4) # -T(2, q_1; 2, q_3; 2, q_4)
|
|
|
|
In knot_formula each k[i] is related with some q_i value, where
|
|
|
|
q_i = 2*k[i] + 1.
|
|
|
|
So we can work in the following steps:
|
|
|
|
1) choose a schema/formula by changing the value of knot_formula
|
|
|
|
2) set each q_i all or choose range in which q_i should varry
|
|
|
|
3) choose vector v / theata vector.
|
|
|
|
"""
|