before deleting fragments for evaluation of vectors with one and minus one combinationa
This commit is contained in:
parent
d9986b63c1
commit
1ec26c1b55
@ -2,7 +2,7 @@
|
|||||||
import collections
|
import collections
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import itertools as it
|
import itertools as it
|
||||||
import re
|
|
||||||
|
|
||||||
class TorusCable(object):
|
class TorusCable(object):
|
||||||
def __init__(self, knot_formula, k_vector=None, q_vector=None):
|
def __init__(self, knot_formula, k_vector=None, q_vector=None):
|
||||||
@ -347,25 +347,18 @@ class TorusCable(object):
|
|||||||
if (a_1^2 - a_2^2 + a_3^2 - a_4^2) % q_4:
|
if (a_1^2 - a_2^2 + a_3^2 - a_4^2) % q_4:
|
||||||
continue
|
continue
|
||||||
if all(a in [1, q_4 - 1] for a in vector):
|
if all(a in [1, q_4 - 1] for a in vector):
|
||||||
is_all_one = True
|
continue
|
||||||
else:
|
|
||||||
is_all_one = False
|
|
||||||
if self.__is_sigma_for_vector_class_big(vector):
|
if self.__is_sigma_for_vector_class_big(vector):
|
||||||
good_vectors.append(vector)
|
good_vectors.append(vector)
|
||||||
# if is_all_one:
|
|
||||||
# print("\nHURA" * 100)
|
|
||||||
# print(self.knot_description)
|
|
||||||
# self.__tmp_print_all_sigma_for_vector_class(vector)
|
|
||||||
# pass
|
# pass
|
||||||
else:
|
else:
|
||||||
if is_all_one:
|
|
||||||
self.__tmp_get_max_sigma_for_vector_class(vector)
|
|
||||||
bad_vectors.append(vector)
|
bad_vectors.append(vector)
|
||||||
#####################################################
|
# large_sigma_for_all_combinations = False
|
||||||
if len(bad_vectors) > 8:
|
# if len(bad_vectors) > 8:
|
||||||
break
|
# break
|
||||||
####################################################
|
print(len(bad_vectors))
|
||||||
large_sigma_for_all_combinations = False
|
if a_1 and a_2 and a_3 and a_4:
|
||||||
|
assert len(bad_vectors) % 8 == 0
|
||||||
return good_vectors, bad_vectors
|
return good_vectors, bad_vectors
|
||||||
|
|
||||||
# searching for sigma > 5 + #(v_i != 0)
|
# searching for sigma > 5 + #(v_i != 0)
|
||||||
@ -399,9 +392,9 @@ class TorusCable(object):
|
|||||||
if print_results:
|
if print_results:
|
||||||
print("good : bad:\t " + str(number_of_all_good_v) +\
|
print("good : bad:\t " + str(number_of_all_good_v) +\
|
||||||
" : " + str(len(all_bad_vectors)))
|
" : " + str(len(all_bad_vectors)))
|
||||||
if len(all_bad_vectors) < 8:
|
# if len(all_bad_vectors) < 8:
|
||||||
print()
|
# print()
|
||||||
print(all_bad_vectors)
|
# print(all_bad_vectors)
|
||||||
|
|
||||||
|
|
||||||
return all_combinations_pass
|
return all_combinations_pass
|
||||||
@ -429,7 +422,6 @@ class SignatureFunction(object):
|
|||||||
def __init__(self, values=None, counter=None):
|
def __init__(self, values=None, counter=None):
|
||||||
# set values of signature jumps
|
# set values of signature jumps
|
||||||
if counter is None:
|
if counter is None:
|
||||||
counter = collections.Counter()
|
|
||||||
if values is None:
|
if values is None:
|
||||||
values = []
|
values = []
|
||||||
assert all(x < 1 for x, y in values),\
|
assert all(x < 1 for x, y in values),\
|
||||||
@ -482,7 +474,6 @@ class SignatureFunction(object):
|
|||||||
counter.subtract(self.cnt_signature_jumps)
|
counter.subtract(self.cnt_signature_jumps)
|
||||||
return SignatureFunction(counter=counter)
|
return SignatureFunction(counter=counter)
|
||||||
|
|
||||||
# TBD short
|
|
||||||
def __add__(self, other):
|
def __add__(self, other):
|
||||||
counter = copy(self.cnt_signature_jumps)
|
counter = copy(self.cnt_signature_jumps)
|
||||||
counter.update(other.cnt_signature_jumps)
|
counter.update(other.cnt_signature_jumps)
|
||||||
|
@ -6,17 +6,14 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import collections
|
|
||||||
# import inspect
|
|
||||||
import itertools as it
|
import itertools as it
|
||||||
import numpy as np
|
|
||||||
import re
|
import re
|
||||||
# try:
|
#
|
||||||
|
# if not os.path.isfile('cable_signature.py'):
|
||||||
|
# os.system('sage --preparse cable_signature.sage')
|
||||||
|
# os.system('mv cable_signature.sage.py cable_signature.py')
|
||||||
# from cable_signature import SignatureFunction, TorusCable
|
# from cable_signature import SignatureFunction, TorusCable
|
||||||
# except ModuleNotFoundError:
|
#
|
||||||
os.system('sage --preparse cable_signature.sage')
|
|
||||||
os.system('mv cable_signature.sage.py cable_signature.py')
|
|
||||||
from cable_signature import SignatureFunction, TorusCable
|
|
||||||
|
|
||||||
class Config(object):
|
class Config(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -45,7 +42,7 @@ class Config(object):
|
|||||||
self.verbose = False
|
self.verbose = False
|
||||||
|
|
||||||
self.print_results = True
|
self.print_results = True
|
||||||
# self.print_results = False
|
self.print_results = False
|
||||||
|
|
||||||
self.print_calculations_for_large_sigma = True
|
self.print_calculations_for_large_sigma = True
|
||||||
self.print_calculations_for_large_sigma = False
|
self.print_calculations_for_large_sigma = False
|
||||||
@ -84,29 +81,36 @@ class Config(object):
|
|||||||
# a_3 == 0, a_4 == 0, a_1, a_2 != 0
|
# a_3 == 0, a_4 == 0, a_1, a_2 != 0
|
||||||
it.product(range(1, q), range(1, 2), range(1), range(1)),
|
it.product(range(1, q), range(1, 2), range(1), range(1)),
|
||||||
]
|
]
|
||||||
# list_of_ranges = [
|
|
||||||
# # all characters a_1, a_2, a_3, a_4 != 0
|
list_of_ranges =
|
||||||
# # 1, 1, 1, 1
|
[
|
||||||
# it.product(range(1, 2), range(1, 2), range(1, 2), range(1, 2)),
|
# all characters a_1, a_2, a_3, a_4 != 0
|
||||||
#
|
# 1, 1, 1, 1
|
||||||
# # -1, -1, -1, 1
|
it.product(range(1, 2), range(1, 2), range(1, 2), range(1, 2)),
|
||||||
# it.product(range(q - 1, q), range(q - 1, q), range(q - 1, q), range(1, 2)),
|
|
||||||
#
|
# -1, -1, -1, 1
|
||||||
# # 1, -1, -1, 1
|
it.product(range(q - 1, q), range(q - 1, q), range(q - 1, q), \
|
||||||
# it.product(range(1, 2), range(q - 1, q), range(q - 1, q), range(1, 2)),
|
range(1, 2)),
|
||||||
# # -1 , -1, 1, 1
|
|
||||||
# it.product(range(q - 1, q), range(q - 1, q), range(1, 2), range(1, 2)),
|
# 1, -1, -1, 1
|
||||||
# # -1, 1, -1, 1
|
it.product(range(1, 2), range(q - 1, q), range(q - 1, q), \
|
||||||
# it.product(range(q - 1, q), range(1, 2), range(q - 1, q), range(1, 2)),
|
range(1, 2)),
|
||||||
#
|
# -1 , -1, 1, 1
|
||||||
# # 1, 1, -1, 1
|
it.product(range(q - 1, q), range(q - 1, q), range(1, 2), \
|
||||||
# it.product(range(1, 2), range(1, 2), range(q - 1, q), range(1, 2)),
|
range(1, 2)),
|
||||||
# # 1, -1, 1, 1
|
# -1, 1, -1, 1
|
||||||
# it.product(range(1, 2), range(q - 1, q), range(1, 2), range(1, 2)),
|
it.product(range(q - 1, q), range(1, 2), range(q - 1, q), \
|
||||||
# # -1, 1, 1, 1
|
range(1, 2)),
|
||||||
# it.product(range(q - 1, q), range(1, 2), range(1, 2), range(1, 2)),
|
# 1, 1, -1, 1
|
||||||
#
|
it.product(range(1, 2), range(1, 2), range(q - 1, q), \
|
||||||
# ]
|
range(1, 2)),
|
||||||
|
# 1, -1, 1, 1
|
||||||
|
it.product(range(1, 2), range(q - 1, q), range(1, 2), \
|
||||||
|
range(1, 2)),
|
||||||
|
# -1, 1, 1, 1
|
||||||
|
it.product(range(q - 1, q), range(1, 2), range(1, 2), \
|
||||||
|
range(1, 2)),
|
||||||
|
]
|
||||||
|
|
||||||
return list_of_ranges
|
return list_of_ranges
|
||||||
|
|
||||||
@ -121,8 +125,6 @@ def main(arg):
|
|||||||
knots_with_large_sigma = search_for_large_signature_value(limit=limit)
|
knots_with_large_sigma = search_for_large_signature_value(limit=limit)
|
||||||
# search_for_null_signature_value(limit=limit)
|
# search_for_null_signature_value(limit=limit)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# searching for sigma > 5 + #(v_i != 0) over given knot schema
|
# searching for sigma > 5 + #(v_i != 0) over given knot schema
|
||||||
def __search_for_large_signature_value(knot_formula, limit,
|
def __search_for_large_signature_value(knot_formula, limit,
|
||||||
verbose, print_results):
|
verbose, print_results):
|
||||||
@ -140,6 +142,7 @@ def __search_for_large_signature_value(knot_formula, limit,
|
|||||||
q[3] = P.next(q[2] * 4 + q[3])
|
q[3] = P.next(q[2] * 4 + q[3])
|
||||||
cable = TorusCable(knot_formula=knot_formula, q_vector=q)
|
cable = TorusCable(knot_formula=knot_formula, q_vector=q)
|
||||||
list_of_ranges = config.get_list_of_ranges(cable.q_vector[-1])
|
list_of_ranges = config.get_list_of_ranges(cable.q_vector[-1])
|
||||||
|
print(cable.knot_description)
|
||||||
if cable.eval_cable_for_large_sigma(list_of_ranges, verbose=verbose,
|
if cable.eval_cable_for_large_sigma(list_of_ranges, verbose=verbose,
|
||||||
print_results=print_results):
|
print_results=print_results):
|
||||||
good_knots.append(cable)
|
good_knots.append(cable)
|
||||||
@ -173,6 +176,7 @@ def search_for_large_signature_value(knot_formula=None, limit=None,
|
|||||||
k = [(P.unrank(i + config.start_shift) - 1)/2 for i in c]
|
k = [(P.unrank(i + config.start_shift) - 1)/2 for i in c]
|
||||||
cable = TorusCable(knot_formula=knot_formula, k_vector=k)
|
cable = TorusCable(knot_formula=knot_formula, k_vector=k)
|
||||||
list_of_ranges = config.get_list_of_ranges(cable.q_vector[-1])
|
list_of_ranges = config.get_list_of_ranges(cable.q_vector[-1])
|
||||||
|
print(cable.knot_description)
|
||||||
if cable.eval_cable_for_large_sigma(list_of_ranges, verbose=verbose,
|
if cable.eval_cable_for_large_sigma(list_of_ranges, verbose=verbose,
|
||||||
print_results=print_results):
|
print_results=print_results):
|
||||||
good_knots.append(cable)
|
good_knots.append(cable)
|
||||||
|
Loading…
Reference in New Issue
Block a user