Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 8800
Kernel: SageMath 9.5
import datetime import os import sqlite3 from boolean_cayley_graphs.bent_function import BentFunction from boolean_cayley_graphs.classification_database_sqlite3 import * from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification
db_dirname=os.path.join("..","db") sobj_dirname=os.path.join("..","sobj")
rm -f test_p6.db
conn = create_database("test_p6.db") conn = create_classification_tables("test_p6.db")
for i in range(1,5): print(datetime.datetime.now(), i) name = "p6_"+str(i) cgc = BentFunctionCayleyGraphClassification.load_mangled(name + ".sobj", dir=sobj_dirname) insert_classification(conn, cgc, name)
2023-01-18 00:09:44.738566 1 2023-01-18 00:09:47.971304 2 2023-01-18 00:09:50.392083 3 2023-01-18 00:09:50.798809 4
cgc.report()
Algebraic normal form of Boolean function: x0*x1*x2 + x0*x3 + x1*x3*x4 + x1*x5 + x2*x3*x5 + x2*x3 + x2*x4 + x2*x5 + x3*x4 + x3*x5 Function is bent. SDP design incidence structure t-design parameters: (True, (2, 64, 28, 12)) Classification of Cayley graphs and classification of Cayley graphs of duals are the same: There are 3 extended Cayley classes in the extended translation class.
bentf = BentFunction(cgc.algebraic_normal_form) c = select_classification_where_bent_function(conn, bentf) c.report()
Algebraic normal form of Boolean function: x0*x1*x2 + x0*x3 + x1*x3*x4 + x1*x5 + x2*x3*x5 + x2*x3 + x2*x4 + x2*x5 + x3*x4 + x3*x5 Function is bent. SDP design incidence structure t-design parameters: (True, (2, 64, 28, 12)) Classification of Cayley graphs and classification of Cayley graphs of duals are the same: There are 3 extended Cayley classes in the extended translation class.
c = select_classification_where_name(conn, "p6_1") c.report()
Algebraic normal form of Boolean function: x0*x1 + x2*x3 + x4*x5 Function is bent. SDP design incidence structure t-design parameters: (True, (2, 64, 28, 12)) Classification of Cayley graphs and classification of Cayley graphs of duals are the same: There are 2 extended Cayley classes in the extended translation class.
curs = conn.cursor() print(datetime.datetime.now(), "before") curs.execute("SELECT COUNT(ROWID) FROM cayley_graph") print(datetime.datetime.now(), "after") for row in curs: for x in row: print(x)
2023-01-18 00:09:52.012755 before 2023-01-18 00:09:52.014381 after 12
curs = conn.cursor() print(datetime.datetime.now(), "before") curs.execute("SELECT * FROM graph") print(datetime.datetime.now(), "after")
2023-01-18 00:09:52.250714 before 2023-01-18 00:09:52.252170 after
print(datetime.datetime.now(), "before") curs.execute("SELECT COUNT(ROWID) FROM graph") print(datetime.datetime.now(), "after") for row in curs: for x in row: print(x)
2023-01-18 00:09:52.514735 before 2023-01-18 00:09:52.516550 after 11
conn.close()
rm -f test_p8.db
conn = create_database("test_p8.db") conn = create_classification_tables("test_p8.db")
for i in range(1,11): name = "p8_"+str(i) cgc = BentFunctionCayleyGraphClassification.load_mangled(name + ".sobj", dir=sobj_dirname) print(datetime.datetime.now(), i) insert_classification(conn, cgc, name) print(datetime.datetime.now())
2023-01-18 00:09:56.874949 1 2023-01-18 00:10:12.527393 2 2023-01-18 00:10:21.122624 3 2023-01-18 00:10:28.028806 4 2023-01-18 00:10:33.545277 5 2023-01-18 00:10:36.488421 6 2023-01-18 00:10:38.124097 7 2023-01-18 00:10:39.397405 8 2023-01-18 00:10:40.682930 9 2023-01-18 00:10:42.339054 10 2023-01-18 00:10:43.627746
c8_5 = select_classification_where_name(conn, "p8_5") c8_5.report()
Algebraic normal form of Boolean function: x0*x1*x2 + x0*x6 + x1*x3*x4 + x1*x4 + x1*x5 + x2*x3*x5 + x2*x4 + x3*x7 Function is bent. SDP design incidence structure t-design parameters: (True, (2, 256, 120, 56)) Classification of Cayley graphs and classification of Cayley graphs of duals are the same: There are 9 extended Cayley classes in the extended translation class.
bentf = BentFunction(c8_5.algebraic_normal_form) c = select_classification_where_bent_function(conn, bentf) c.report()
Algebraic normal form of Boolean function: x0*x1*x2 + x0*x6 + x1*x3*x4 + x1*x4 + x1*x5 + x2*x3*x5 + x2*x4 + x3*x7 Function is bent. SDP design incidence structure t-design parameters: (True, (2, 256, 120, 56)) Classification of Cayley graphs and classification of Cayley graphs of duals are the same: There are 9 extended Cayley classes in the extended translation class.
c8_6 = select_classification_where_name(conn, "p8_6") c8_6.report()
Algebraic normal form of Boolean function: x0*x1*x2 + x0*x2 + x0*x3 + x1*x3*x4 + x1*x6 + x2*x3*x5 + x2*x4 + x5*x7 Function is bent. SDP design incidence structure t-design parameters: (True, (2, 256, 120, 56)) Classification of Cayley graphs and classification of Cayley graphs of duals are the same: There are 9 extended Cayley classes in the extended translation class.
curs = conn.cursor() print(datetime.datetime.now(), "before") curs.execute("SELECT COUNT(*) FROM cayley_graph") print(datetime.datetime.now(), "after") for row in curs: for x in row: print(x)
2023-01-18 00:10:47.954266 before 2023-01-18 00:10:47.955176 after 66
curs = conn.cursor() print(datetime.datetime.now(), "before") curs.execute("SELECT COUNT(ROWID) FROM cayley_graph") print(datetime.datetime.now(), "after") for row in curs: for x in row: print(x)
2023-01-18 00:10:48.461690 before 2023-01-18 00:10:48.463025 after 66
print(datetime.datetime.now(), "before") curs.execute("SELECT COUNT(ROWID) FROM graph") print(datetime.datetime.now(), "after") for row in curs: for x in row: print(x)
2023-01-18 00:10:48.694081 before 2023-01-18 00:10:48.695756 after 55
conn.close()
conn = connect_to_database('test_p8.db')
curs = conn.cursor() print(datetime.datetime.now(), "before") curs.execute(""" select name, cayley_graph_index, graph.rowid, count(*) from matrices, ( select name, bent_function, cayley_graph_index, canonical_label_hash from ( select canonical_label_hash from cayley_graph group by canonical_label_hash having count (canonical_label_hash) > 1) as repeats natural join cayley_graph natural join bent_function ) as repeats_with_counts, graph where matrices.bent_function = repeats_with_counts.bent_function and matrices.bent_cayley_graph_index = repeats_with_counts.cayley_graph_index and graph.canonical_label_hash = repeats_with_counts.canonical_label_hash group by name, cayley_graph_index, graph.rowid order by graph.rowid, name, cayley_graph_index """) print(datetime.datetime.now(), "after") for row in curs: for x in row: print(x,end=" ") print("")
2023-01-18 00:10:49.621418 before 2023-01-18 00:10:51.116214 after p8_1 0 1 34816 p8_2 0 1 6144 p8_1 1 2 30720 p8_2 3 2 2048 p8_5 0 17 4096 p8_6 0 17 4096 p8_5 1 18 6144 p8_6 1 18 6144 p8_5 2 19 6144 p8_6 2 19 6144 p8_5 3 20 2048 p8_6 5 20 2048 p8_5 4 21 2048 p8_6 8 21 2048 p8_5 5 22 6144 p8_6 6 22 6144 p8_5 6 23 6144 p8_6 7 23 6144 p8_5 7 24 16384 p8_6 3 24 16384 p8_5 8 25 16384 p8_6 4 25 16384
conn.close()