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(i) name = "p6_"+str(i) cgc = BentFunctionCayleyGraphClassification.load_mangled(name + ".sobj", dir=sobj_dirname) insert_classification(conn, cgc, name)
1 2 3 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)
2022-05-31 23:05:39.480172 before 2022-05-31 23:05:39.481183 after 12
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)
2022-05-31 23:05:39.552459 before 2022-05-31 23:05:39.554187 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())
2022-05-31 23:05:40.493969 1 2022-05-31 23:05:41.259589 2 2022-05-31 23:05:42.262146 3 2022-05-31 23:05:43.169159 4 2022-05-31 23:05:44.078996 5 2022-05-31 23:05:44.977874 6 2022-05-31 23:05:46.136206 7 2022-05-31 23:05:47.140389 8 2022-05-31 23:05:49.012154 9 2022-05-31 23:05:50.591327 10 2022-05-31 23:05:51.595664
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)
2022-05-31 23:05:55.554799 before 2022-05-31 23:05:55.555912 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)
2022-05-31 23:05:55.619528 before 2022-05-31 23:05:55.621320 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)
2022-05-31 23:05:55.682701 before 2022-05-31 23:05:55.684404 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_id, count(*) from matrices, ( select name, bent_function, cayley_graph_index, graph_id 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 graph natural join bent_function ) as repeats_with_counts where matrices.bent_function = repeats_with_counts.bent_function and matrices.bent_cayley_graph_index = repeats_with_counts.cayley_graph_index group by name, cayley_graph_index, graph_id order by graph_id """) print(datetime.datetime.now(), "after") for row in curs: for x in row: print(x,end=" ") print("")
2022-05-31 23:05:55.869847 before 2022-05-31 23:05:57.295262 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