some bad comments

This commit is contained in:
Maria Marchwicka 2020-07-13 21:03:26 +02:00
parent c168b16d73
commit 2477c79297

View File

@ -1,5 +1,6 @@
#!/usr/bin/python #!/usr/bin/python
# TBD: read about Factory Method, variable in docstring, sage documentation
def calculate_form(x, y, q4): def calculate_form(x, y, q4):
x1, x2, x3, x4 = x x1, x2, x3, x4 = x
y1, y2, y3, y4 = y y1, y2, y3, y4 = y
@ -8,8 +9,7 @@ def calculate_form(x, y, q4):
return form return form
def check_condition(v, q4): def check_condition(v, q4):
form = calculate_form(v, v, q4) if calculate_form(v, v, q4):
if form:
return False return False
return True return True
@ -91,8 +91,8 @@ class MySettings(object):
""" """
About notation: About notation:
Cables that we work with follow a schema: Cables that we work with follow a schema:
T(2, q_0; 2, q_1; 2, q_2) # T(2, q_1; 2, q_2) # T(2, q_0; 2, q_1; 2, q_2) # T(2, q_1; 2, q_2) #
# -T(2, q_3; 2, q_2) # -T(2, q_0; 2, q_3; 2, q_2) # -T(2, q_3; 2, q_2) # -T(2, q_0; 2, q_3; 2, q_2)
In knot_sum_formula each k[i] is related with some q_i value, where In knot_sum_formula each k[i] is related with some q_i value, where
q_i = 2*k[i] + 1. q_i = 2*k[i] + 1.
So we can work in the following steps: So we can work in the following steps:
@ -280,24 +280,32 @@ def get_shifted_combination(combination):
def get_blanchfield_for_pattern(k_n, theta): def get_blanchfield_for_pattern(k_n, theta):
""" """
This function calculates a twisted signature function for a given cable Arguments:
and theta/character. It returns object of class SignatureFunction. k_n: a number s.t. q_n = 2 * k_n + 1, where
It is based on Proposition 9.8. in Twisted Blanchfield Pairing. T(2, q_n) is a pattern knot for a single cable from a cable sum
theta: twist/character for the cable (value form v vector)
Return:
SignatureFunction created for twisted signature function
for a given cable and theta/character
Based on:
Proposition 9.8. in Twisted Blanchfield Pairing
(https://arxiv.org/pdf/1809.08791.pdf)
""" """
# TBD: k_n explanation
if theta == 0: if theta == 0:
a = get_untwisted_signature_function(k_n) a = get_untwisted_signature_function(k_n)
return a.square_root() + a.minus_square_root() return a.square_root() + a.minus_square_root()
results = [] results = []
k = abs(k_n) k = abs(k_n)
ksi = 1/(2 * k + 1) ksi = 1/(2 * k + 1)
# lambda_odd (theta + e) % 2 == 0:
# lambda_odd, i.e. (theta + e) % 2 != 0
for e in range(1, k + 1): for e in range(1, k + 1):
if (theta + e) % 2 != 0: if (theta + e) % 2 != 0:
results.append((e * ksi, 1 * sgn(k_n))) results.append((e * ksi, 1 * sgn(k_n)))
results.append((1 - e * ksi, -1 * sgn(k_n))) results.append((1 - e * ksi, -1 * sgn(k_n)))
# lambda_even # lambda_even
# print "normal" # print "normal"
for e in range(1, theta): for e in range(1, theta):
@ -315,11 +323,14 @@ def get_blanchfield_for_pattern(k_n, theta):
def get_cable_signature_as_theta_function(*arg): def get_cable_signature_as_theta_function(*arg):
""" """
This function takes as an argument a single cable T_(2, q), i.e. Argument:
arbitrary number of integers that encode the cable, n integers that encode a single cable, i.e.
and returns another function that alow to calculate signature function values of q_i for T(2,q_0; 2,q_1; ... 2, q_n)
for this single cable and a theta given as an argument. Return:
a function that returns SignatureFunction for this single cable
and a theta given as an argument
""" """
def get_signture_function(theta): def get_signture_function(theta):
""" """
This function returns SignatureFunction for previously defined single This function returns SignatureFunction for previously defined single
@ -328,9 +339,9 @@ def get_cable_signature_as_theta_function(*arg):
get_cable_signature_as_theta_function(*arg) get_cable_signature_as_theta_function(*arg)
with the cable description as an argument. with the cable description as an argument.
It is an implementaion of the formula: It is an implementaion of the formula:
Bl_theta(K'_(2, d)) = Bl_theta(K'_(2, d)) =
Bl_theta(T_2, d) + Bl(K')(ksi_l^(-theta) * t) Bl_theta(T_2, d) + Bl(K')(ksi_l^(-theta) * t)
+ Bl(K')(ksi_l^theta * t) + Bl(K')(ksi_l^theta * t)
""" """
# TBD: another formula (for t^2) description # TBD: another formula (for t^2) description
@ -340,7 +351,11 @@ def get_cable_signature_as_theta_function(*arg):
msg = "k for the pattern in the cable is " + str(arg[-1]) + \ msg = "k for the pattern in the cable is " + str(arg[-1]) + \
". Parameter theta should not be larger than abs(k)." ". Parameter theta should not be larger than abs(k)."
raise ValueError(msg) raise ValueError(msg)
# twisted part
cable_signature = get_blanchfield_for_pattern(arg[-1], theta) cable_signature = get_blanchfield_for_pattern(arg[-1], theta)
# untwisted part
for i, k in enumerate(arg[:-1][::-1]): for i, k in enumerate(arg[:-1][::-1]):
ksi = 1/(2 * k_n + 1) ksi = 1/(2 * k_n + 1)
power = 2^i power = 2^i
@ -422,9 +437,11 @@ def get_function_of_theta_for_sum(*arg):
def signature_function_for_sum(*thetas, **kwargs): def signature_function_for_sum(*thetas, **kwargs):
""" """
Arguments:
Returns object of SignatureFunction class for a previously defined Returns object of SignatureFunction class for a previously defined
connected sum of len(arg) cables. connected sum of len(arg) cables.
Accept len(arg) arguments: for each cable one theta parameter. Acept len(arg) arguments: for each cable one theta parameter.
If call with no arguments, all theta parameters are set to be 0. If call with no arguments, all theta parameters are set to be 0.
""" """
if 'verbose' in kwargs: if 'verbose' in kwargs:
@ -534,20 +551,19 @@ def check_squares(a, k):
else: else:
print "Trivial " + str(knot_sum) print "Trivial " + str(knot_sum)
return None return None
eval_cable_for_thetas(knot_sum) eval_cable_for_thetas(knot_sum)
def get_number_of_combinations(*arg): def get_number_of_combinations(*arg):
""" """
Arguments: Arguments:
arbitrary number of lists of numbers, each list encodes a single cable. arbitrary number of lists of numbers, each list encodes a single cable
Return: Return:
number of possible theta values combinations that could be applied number of possible theta values combinations that could be applied
for a given cable sum, for a given cable sum,
i.e. the product of q_j for j = {1,.. n}, i.e. the product of q_j for j = {1,.. n},
where n is a number of direct components in the cable sum, where n is a number of direct components in the cable sum,
and q_j is the last q parameter for the component (a single cable). and q_j is the last q parameter for the component (a single cable)
""" """
number_of_combinations = 1 number_of_combinations = 1
for knot in arg: for knot in arg:
@ -575,7 +591,7 @@ def mod_one(n):
Argument: Argument:
a number a number
Return: Return:
the fractional part of a number the fractional part of the argument
Examples: Examples:
sage: mod_one(9 + 3/4) sage: mod_one(9 + 3/4)
3/4 3/4