Classification of bent functions by their Cayley graphs
The bent_function_cayley_graph_classification
module defines:
the
BentFunctionCayleyGraphClassification
class; which represents the classification of the Cayley graphs within the extended translation class of a bent function; andthe
BentFunctionCayleyGraphClassPart
class, which represents part of a Cayley graph classification.
AUTHORS:
Paul Leopardi (2016-08-02): initial version
EXAMPLES:
The classification of the bent function defined by the polynomial x2 + x1*x2.
sage: from boolean_cayley_graphs.bent_function import BentFunction
sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification as BentFunctionCGC
sage: R2.<x1,x2> = BooleanPolynomialRing(2)
sage: p = x2+x1*x2
sage: f = BentFunction(p)
sage: c = BentFunctionCGC.from_function(f)
sage: dict(sorted(c.__dict__.items()))
{'algebraic_normal_form': x0*x1 + x1,
'bent_cayley_graph_index_matrix': [0 0 1 0]
[1 0 0 0]
[0 0 0 1]
[0 1 0 0],
'cayley_graph_class_list': ['CK', 'C~'],
'dual_cayley_graph_index_matrix': [0 0 1 0]
[1 0 0 0]
[0 0 0 1]
[0 1 0 0],
'weight_class_matrix': [0 0 1 0]
[1 0 0 0]
[0 0 0 1]
[0 1 0 0]}
REFERENCES:
The extended translation equivalence class and the extended Cayley equivalence class of a bent function are defined by Leopardi [Leo2017].
- class boolean_cayley_graphs.bent_function_cayley_graph_classification.BentFunctionCayleyGraphClassPart(*args, **kwargs)[source]
Bases:
sage.structure.sage_object.SageObject
,boolean_cayley_graphs.saveable.Saveable
Partial classification of the Cayley graphs within the extended translation equivalence class of a bent function.
EXAMPLES:
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassPart as BentFunctionCGCP sage: R2.<x1,x2> = BooleanPolynomialRing(2) sage: p = x1+x2+x1*x2 sage: f = BentFunction(p) sage: c1 = BentFunctionCGCP.from_function(f, c_stop=1) sage: print(c1) BentFunctionCayleyGraphClassPart.from_function(BentFunction(x0*x1 + x0 + x1, c_start=0, c_stop=1)) sage: latex(c1) \text{\texttt{BentFunctionCayleyGraphClassPart.from{\char`\_}function(BentFunction(x0*x1{ }+{ }x0{ }+{ }x1,{ }c{\char`\_}start=0,{ }c{\char`\_}stop=1))}}
- classmethod from_function(bentf, list_dual_graphs=True, c_start=0, c_stop=None, limited_memory=False, algorithm='sage')[source]
Constructor from the
BentFunction
bentf
.INPUT:
bentf
– an object of classBentFunction
.list_dual_graphs
– boolean (default:True
). A flag indicating whether to list dual graphs.c_start
– integer (default: 0). The smallest value of c to use for extended translates.c_stop
– integer (default:None
). One more than largest value of c to use for extended translates.None
means use all remaining values.limited_memory
– boolean (default:False
). A flag indicating whether the classification might be too large to fit into memory.algorithm
– string (default:default_algorithm
). The algorithm used for canonical labelling.
OUTPUT:
An object of class BentFunctionCayleyGraphClassPart, initialized as follows.
algebraic_normal_form
is set tobentf.algebraic_normal_form()
,cayley_graph_class_list
is set to a list ofgraph6_string
stings corresponding to the complete set of non-isomorphic Cayley graphs of the bent functions within the extended translation equivalence class ofbentf
(and their duals, iflist_dual_graphs
isTrue
),bent_cayley_graph_index_matrix
is set to a matrix of indices intocayley_graph_class_list
corresponding to these bent functions,dual_cayley_graph_index_matrix
is set toNone
iflist_dual_graphs
isFalse
, otherwise it is set to a matrix of indices intocayley_graph_class_list
corresponding to the duals of these bent functions, andweight_class_matrix
is set to the 0-1 matrix of weight classes corresponding tobent_cayley_graph_index_matrix
,c_start
is set to smallest value of c used for extended translates.
Each entry
bent_cayley_graph_index_matrix[c-c_start,b]
corresponds to the Cayley graph of the bent function \(x \mapsto \mathtt{bentf}(x+b) + \langle c, x \rangle + \mathtt{bentf}(b)\). This enumerates all of the extended translates ofbentf
havingc
fromc_start
to but not includingc_stop
.EXAMPLES:
A partial classification of the bent function defined by the polynomial \(x_1 + x_2 + x_1 x_2\).
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassPart as BentFunctionCGCPart sage: R2.<x1,x2> = BooleanPolynomialRing(2) sage: p = x1+x2+x1*x2 sage: f = BentFunction(p) sage: c1 = BentFunctionCGCPart.from_function(f,c_start=2,c_stop=4) sage: dict(sorted(c1.__dict__.items())) {'algebraic_normal_form': x0*x1 + x0 + x1, 'bent_cayley_graph_index_matrix': [0 1 0 0] [0 0 0 1], 'c_start': 2, 'cayley_graph_class_list': ['CK', 'C~'], 'dual_cayley_graph_index_matrix': [0 1 0 0] [0 0 0 1], 'weight_class_matrix': [0 1 0 0] [0 0 0 1]}
A partial classification of the bent function defined by the polynomial \(x_1 + x_2 + x_1 x_2\), but with list_dual_graphs=False.
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification as BentFunctionCGC sage: R2.<x1,x2> = BooleanPolynomialRing(2) sage: p = x1+x2+x1*x2 sage: f = BentFunction(p) sage: c2 = BentFunctionCGCPart.from_function(f,list_dual_graphs=False,c_start=0,c_stop=2) sage: dict(sorted(c2.__dict__.items())) {'algebraic_normal_form': x0*x1 + x0 + x1, 'bent_cayley_graph_index_matrix': [0 1 1 1] [1 1 0 1], 'c_start': 0, 'cayley_graph_class_list': ['C~', 'CK'], 'dual_cayley_graph_index_matrix': None, 'weight_class_matrix': [1 0 0 0] [0 0 1 0]}
- class boolean_cayley_graphs.bent_function_cayley_graph_classification.BentFunctionCayleyGraphClassification(*args, **kwargs)[source]
Bases:
boolean_cayley_graphs.bent_function_cayley_graph_classification.BentFunctionCayleyGraphClassPart
Classification of the Cayley graphs within the extended translation equivalence class of a bent function.
EXAMPLES:
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification as BentFunctionCGC sage: R2.<x1,x2> = BooleanPolynomialRing(2) sage: p = x1+x2+x1*x2 sage: f = BentFunction(p) sage: c1 = BentFunctionCGC.from_function(f) sage: print(c1) BentFunctionCayleyGraphClassification.from_function(BentFunction(x0*x1 + x0 + x1)) sage: latex(c1) \text{\texttt{BentFunctionCayleyGraphClassification.from{\char`\_}function(BentFunction(x0*x1{ }+{ }x0{ }+{ }x1))}}
- bent_function_csv_suffix = '_bent_function.csv'
- cg_class_list_csv_suffix = '_cg_class_list.csv'
- classmethod cg_class_list_from_csv(file_name)[source]
Read a Cayley graph class list from a csv file.
The csv file is assumed to be created by the method save_cg_class_list_as_csv().
INPUT:
file_name
– the name of the csv file.
OUTPUT:
A list of Cayley graphs in graph6_string format.
EXAMPLES:
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification as BentFunctionCGC sage: import os sage: bf2 = BentFunction([1,0,1,1]) sage: c2 = BentFunctionCGC.from_function(bf2) sage: csv_name = tmp_filename(ext=".csv") sage: c2.save_cg_class_list_as_csv(csv_name) sage: cgcl_saved = BentFunctionCGC.cg_class_list_from_csv(csv_name) sage: print(cgcl_saved == c2.cayley_graph_class_list) True sage: os.remove(csv_name)
- first_matrix_index_list()[source]
Obtain a representative bent function corresponding to each extended Cayley class.
INPUT:
self
– the current object.
OUTPUT:
A list of tuples (i_n,j_n), each of which is the first index into the matrix self.bent_cayley_graph_index_matrix that contains the entry n. The first index is determined by
argwhere
.EXAMPLES:
The result for the bent function defined by the polynomial \(x_1 + x_2 + x_1 x_2\).
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification as BentFunctionCGC sage: R2.<x1,x2> = BooleanPolynomialRing(2) sage: p = x1+x2+x1*x2 sage: f = BentFunction(p) sage: c = BentFunctionCGC.from_function(f) sage: c.first_matrix_index_list() [(0, 0), (0, 1)]
- classmethod from_csv(file_name_prefix)[source]
Constructor from three csv files.
INPUT:
file_name_prefix
– string: the common prefix to use for file names.
OUTPUT:
None.
EXAMPLES:
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification as BentFunctionCGC sage: import os sage: bf2 = BentFunction([1,1,0,1]) sage: c2 = BentFunctionCGC.from_function(bf2) sage: prefix = tmp_filename() sage: c2.save_as_csv(prefix) sage: c2_saved = BentFunctionCGC.from_csv(prefix) sage: print(c2 == c2_saved) True sage: bent_function_csv_name = prefix + BentFunctionCGC.bent_function_csv_suffix sage: os.remove(bent_function_csv_name) sage: cg_class_list_csv_name = prefix + BentFunctionCGC.cg_class_list_csv_suffix sage: os.remove(cg_class_list_csv_name) sage: matrices_csv_name = prefix + BentFunctionCGC.matrices_csv_suffix sage: os.remove(matrices_csv_name)
- classmethod from_function(bentf, list_dual_graphs=True, limited_memory=False)[source]
Constructor from the
BentFunction
bentf
.INPUT:
bentf
– an object of classBentFunction
.list_dual_graphs
– boolean. a flag indicating whether to list dual graphs.limited_memory
– boolean. A flag indicating whether the classification might be too large to fit into memory. Default is False.
OUTPUT:
An object of class BentFunctionCayleyGraphClassification, initialized as follows.
algebraic_normal_form
is set tobentf.algebraic_normal_form()
,cayley_graph_class_list
is set to a list ofgraph6_string
strings corresponding to the complete set of non-isomorphic Cayley graphs of the bent functions within the extended translation equivalence class ofbentf
(and their duals, iflist_dual_graphs
isTrue
),bent_cayley_graph_index_matrix
is set to a matrix of indices intocayley_graph_class_list
corresponding to these bent functions,dual_cayley_graph_index_matrix
is set toNone
iflist_dual_graphs
isFalse
, otherwise it is set to a matrix of indices intocayley_graph_class_list
corresponding to the duals of these bent functions, andweight_class_matrix
is set to the 0-1 matrix of weight classes corresponding tobent_cayley_graph_index_matrix
.
Each entry
bent_cayley_graph_index_matrix[c,b]
corresponds to the Cayley graph of the bent function \(x \mapsto \mathtt{bentf}(x+b) + \langle c, x \rangle + \mathtt{bentf}(b)\). This enumerates all of the extended translates ofbentf
.EXAMPLES:
The classification of the bent function defined by the polynomial \(x_1 + x_2 + x_1 x_2\).
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification as BentFunctionCGC sage: R2.<x1,x2> = BooleanPolynomialRing(2) sage: p = x1+x2+x1*x2 sage: f = BentFunction(p) sage: c3 = BentFunctionCGC.from_function(f) sage: dict(sorted(c3.__dict__.items())) {'algebraic_normal_form': x0*x1 + x0 + x1, 'bent_cayley_graph_index_matrix': [0 1 1 1] [1 1 0 1] [1 0 1 1] [1 1 1 0], 'cayley_graph_class_list': ['C~', 'CK'], 'dual_cayley_graph_index_matrix': [0 1 1 1] [1 1 0 1] [1 0 1 1] [1 1 1 0], 'weight_class_matrix': [1 0 0 0] [0 0 1 0] [0 1 0 0] [0 0 0 1]}
TESTS:
The classification of the bent function defined by the polynomial \(x_1 + x_2 + x_1 x_2\), but with list_dual_graphs=False.
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification as BentFunctionCGC sage: R2.<x1,x2> = BooleanPolynomialRing(2) sage: p = x1+x2+x1*x2 sage: f = BentFunction(p) sage: c4 = BentFunctionCGC.from_function(f,list_dual_graphs=False) sage: dict(sorted(c4.__dict__.items())) {'algebraic_normal_form': x0*x1 + x0 + x1, 'bent_cayley_graph_index_matrix': [0 1 1 1] [1 1 0 1] [1 0 1 1] [1 1 1 0], 'cayley_graph_class_list': ['C~', 'CK'], 'dual_cayley_graph_index_matrix': None, 'weight_class_matrix': [1 0 0 0] [0 0 1 0] [0 1 0 0] [0 0 0 1]}
- classmethod from_parts(prefix_basename, dir=None, limited_memory=False)[source]
Constructor from saved class parts.
INPUTS:
prefix_basename
– string. The prefix to use with mangled_name() to obtain the file names of the saved class parts.dir
– string, optional. The directory where the parts are located. Default is None, meaning the current directory.limited_memory
– boolean, default is False. A flag indicating whether the classification might be too large to fit into memory.
OUTPUT:
An object of class BentFunctionCayleyGraphClassification, constructed from the saved class parts.
EXAMPLES:
A classification of the bent function defined by the polynomial \(x_1 + x_2 + x_1 x_2\).
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification as BentFunctionCGC sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassPart as BentFunctionCGCPart sage: import os.path sage: R2.<x1,x2> = BooleanPolynomialRing(2) sage: p = x1+x2+x1*x2 sage: f = BentFunction(p) sage: prefix = tmp_filename() sage: prefix_dirname = os.path.dirname(prefix) sage: prefix_basename = os.path.basename(prefix) sage: for row in range(4): ....: c = BentFunctionCGCPart.from_function(f, c_start=row,c_stop=row+1) ....: part_prefix = prefix_basename + "_" + str(row) ....: c.save_mangled( ....: part_prefix, ....: dir=prefix_dirname) sage: cl1 = BentFunctionCGC.from_parts( ....: prefix_basename, ....: dir=prefix_dirname) sage: cl1.report(report_on_matrix_details=True) Algebraic normal form of Boolean function: x0*x1 + x0 + x1 Function is bent. <BLANKLINE> Weight class matrix: [1 0 0 0] [0 0 1 0] [0 1 0 0] [0 0 0 1] <BLANKLINE> SDP design incidence structure t-design parameters: (True, (1, 4, 1, 1)) <BLANKLINE> Classification of Cayley graphs and classification of Cayley graphs of duals are the same: <BLANKLINE> There are 2 extended Cayley classes in the extended translation class. <BLANKLINE> Matrix of indices of Cayley graphs: [0 1 1 1] [1 1 0 1] [1 0 1 1] [1 1 1 0] sage: for row in range(4): ....: part_prefix = prefix_basename + "_" + str(row) ....: BentFunctionCGCPart.remove_mangled( ....: part_prefix, ....: dir=prefix_dirname)
- matrices_csv_suffix = '_matrices.csv'
- classmethod matrices_from_csv(dim, file_name)[source]
Read three matrices from a csv file.
The csv file is assumed to be created by the method save_matrices_as_csv().
INPUT:
dim
– integer: the dimension of the bent function.file_name
– the name of the csv file.
OUTPUT:
A tuple of matrices,
EXAMPLES:
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification as BentFunctionCGC sage: import os sage: bf2 = BentFunction([1,1,0,1]) sage: dim = bf2.nvariables() sage: c2 = BentFunctionCGC.from_function(bf2) sage: csv_name = tmp_filename(ext=".csv") sage: c2.save_matrices_as_csv(csv_name) sage: (ci_matrix,di_matrix,wc_matrix) = BentFunctionCGC.matrices_from_csv(dim, csv_name) sage: print(c2.bent_cayley_graph_index_matrix == ci_matrix) True sage: print(c2.dual_cayley_graph_index_matrix == di_matrix) True sage: print(c2.weight_class_matrix == wc_matrix) True sage: os.remove(csv_name)
TESTS:
Test the case where list_dual_graphs==False and dual_cayley_graph_index_matrix is None.
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification as BentFunctionCGC sage: import os sage: bf = BentFunction([1,1,0,1]) sage: dim = bf.nvariables() sage: c = BentFunctionCGC.from_function(bf, list_dual_graphs=False) sage: csv_name = tmp_filename(ext=".csv") sage: c.save_matrices_as_csv(csv_name) sage: (ci_matrix,di_matrix,wc_matrix) = BentFunctionCGC.matrices_from_csv(dim, csv_name) sage: print(c.bent_cayley_graph_index_matrix == ci_matrix) True sage: print(c.dual_cayley_graph_index_matrix == di_matrix) True sage: print(c.weight_class_matrix == wc_matrix) True sage: os.remove(csv_name)
- print_latex_table_of_cayley_classes(width=40, rows_per_table=6)[source]
Print a table of Cayley classes in LaTeX format.
For a given classification, print, in LaTeX format, the table of selected properties of the Cayley classes of that classification.
INPUT:
self
– the current object.width
– integer (default: 40): the table width.rows_per_table
– integer (default: 6). The number of rows to include before starting a new table.
OUTPUT:
(To standard output.) A table in LaTeX format.
EXAMPLES:
Print the table of Cayley classes for the classification of the bent function defined by the polynomial \(x_0 + x_0 x_1 + x_2 x_3\).
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification as BentFunctionCGC sage: R4.<x0,x1,x2,x3> = BooleanPolynomialRing(4) sage: p = x0+x0*x1+x2*x3 sage: f = BentFunction(p) sage: c = BentFunctionCGC.from_function(f) sage: c.print_latex_table_of_cayley_classes() \small{} \begin{align*} \def\arraystretch{1.2} \begin{array}{|cccl|} \hline \text{Class} & \text{Parameters} & \text{2-rank} & \text{Clique polynomial} \\ \hline 0 & (16, 6, 2, 2) & 6 & \begin{array}{l} 8t^{4} + 32t^{3} + 48t^{2} + 16t + 1 \end{array} \\ 1 & (16, 10, 6, 6) & 6 & \begin{array}{l} 16t^{5} + 120t^{4} + 160t^{3} \,+ \\ 80t^{2} + 16t + 1 \end{array} \\ \hline \end{array} \end{align*}
- print_latex_table_of_tonchev_graphs(width=40)[source]
Print a table comparing Cayley graphs with graphs from Tonchev’s codes.
Tonchev’s codes are binary projective two-weight codes as published by Tonchev [Ton1996], [Ton2007].
INPUT:
self
– the current object.width
– integer (default: 40): the table width.algorithm
– string (default:default_algorithm
). Algorithm used for canonical labelling.
OUTPUT:
(To standard output.) A table in LaTeX format.
Note
The comparison displayed in this table really only makes sense for bent functions in 6 dimensions.
EXAMPLES:
The classification for the bent function defined by the polynomial \(x_0 x_1 + x_2 x_3 + x_4 x_5\).
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification as BentFunctionCGC sage: R6.<x0,x1,x2,x3,x4,x5> = BooleanPolynomialRing(6) sage: p = x0*x1 + x2*x3 + x4*x5 sage: f = BentFunction(p) sage: c = BentFunctionCGC.from_function(f) # long time (60 seconds) sage: c.print_latex_table_of_tonchev_graphs() # long time (depends on line above) \begin{align*} \def\arraystretch{1.2} \begin{array}{|ccl|} \hline \text{Class} & \text{Parameters} & \text{Reference} \\ \hline 0 & [35,6,16] & \text{Table 1.156 1 (complement)} \\ 0 & [35,6,16] & \text{Table 1.156 2 (complement)} \\ 1 & [27,6,12] & \text{Table 1.155 1 } \\ \hline \end{array} \end{align*}
REFERENCES:
- report(report_on_matrix_details=False, report_on_graph_details=False)[source]
Print a report on the classification.
The report includes attributes and various computed quantities.
INPUT:
self
– the current object.report_on_matrix_details
– Boolean (default: False).If True, print each matrix.
report_on_graph_details
– Boolean (default: False).If True, produce a detailed report for each Cayley graph.
OUTPUT:
(To standard output) A report on the following attributes of
self
:algebraic_normal_form
cayley_graph_class_list
- If report_on_matrix_details is
True
: bent_cayley_graph_index_matrix
dual_cayley_graph_index_matrix
(only if this is notNone
and is different frombent_cayley_graph_index_matrix
)weight_class_matrix
- If report_on_matrix_details is
If report_on_graph_details is
True
: details of each graph incayley_graph_class_list
.
EXAMPLES:
Report on the classification of the bent function defined by the polynomial \(x_0 + x_0 x_1 + x_2 x_3\).
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification as BentFunctionCGC sage: R4.<x0,x1,x2,x3> = BooleanPolynomialRing(4) sage: p = x0+x0*x1+x2*x3 sage: f = BentFunction(p) sage: c = BentFunctionCGC.from_function(f) sage: c.report(report_on_matrix_details=True, report_on_graph_details=True) Algebraic normal form of Boolean function: x0*x1 + x0 + x2*x3 Function is bent. <BLANKLINE> Weight class matrix: [0 1 0 0 0 1 0 0 0 1 0 0 1 0 1 1] [0 0 0 1 0 0 0 1 0 0 0 1 1 1 1 0] [1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 1] [0 0 1 0 0 0 1 0 0 0 1 0 1 1 0 1] [0 1 0 0 1 0 1 1 0 1 0 0 0 1 0 0] [0 0 0 1 1 1 1 0 0 0 0 1 0 0 0 1] [1 0 0 0 0 1 1 1 1 0 0 0 1 0 0 0] [0 0 1 0 1 1 0 1 0 0 1 0 0 0 1 0] [0 1 0 0 0 1 0 0 1 0 1 1 0 1 0 0] [0 0 0 1 0 0 0 1 1 1 1 0 0 0 0 1] [1 0 0 0 1 0 0 0 0 1 1 1 1 0 0 0] [0 0 1 0 0 0 1 0 1 1 0 1 0 0 1 0] [1 0 1 1 0 1 0 0 0 1 0 0 0 1 0 0] [1 1 1 0 0 0 0 1 0 0 0 1 0 0 0 1] [0 1 1 1 1 0 0 0 1 0 0 0 1 0 0 0] [1 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0] <BLANKLINE> SDP design incidence structure t-design parameters: (True, (2, 16, 6, 2)) <BLANKLINE> Classification of Cayley graphs and classification of Cayley graphs of duals are the same: <BLANKLINE> There are 2 extended Cayley classes in the extended translation class. <BLANKLINE> Matrix of indices of Cayley graphs: [0 1 0 0 0 1 0 0 0 1 0 0 1 0 1 1] [0 0 0 1 0 0 0 1 0 0 0 1 1 1 1 0] [1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 1] [0 0 1 0 0 0 1 0 0 0 1 0 1 1 0 1] [0 1 0 0 1 0 1 1 0 1 0 0 0 1 0 0] [0 0 0 1 1 1 1 0 0 0 0 1 0 0 0 1] [1 0 0 0 0 1 1 1 1 0 0 0 1 0 0 0] [0 0 1 0 1 1 0 1 0 0 1 0 0 0 1 0] [0 1 0 0 0 1 0 0 1 0 1 1 0 1 0 0] [0 0 0 1 0 0 0 1 1 1 1 0 0 0 0 1] [1 0 0 0 1 0 0 0 0 1 1 1 1 0 0 0] [0 0 1 0 0 0 1 0 1 1 0 1 0 0 1 0] [1 0 1 1 0 1 0 0 0 1 0 0 0 1 0 0] [1 1 1 0 0 0 0 1 0 0 0 1 0 0 0 1] [0 1 1 1 1 0 0 0 1 0 0 0 1 0 0 0] [1 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0] <BLANKLINE> For each extended Cayley class in the extended translation class: Clique polynomial, strongly regular parameters, rank, and order of a representative graph; and linear code and generator matrix for a representative bent function: <BLANKLINE> EC class 0 : Algebraic normal form of representative: x0*x1 + x0 + x2*x3 Clique polynomial: 8*t^4 + 32*t^3 + 48*t^2 + 16*t + 1 Strongly regular parameters: (16, 6, 2, 2) Rank: 6 Order: 1152 <BLANKLINE> Linear code from representative: [6, 4] linear code over GF(2) Generator matrix: [1 0 0 0 0 1] [0 1 0 1 0 0] [0 0 1 1 0 0] [0 0 0 0 1 1] Linear code is projective. Weight distribution: {0: 1, 2: 6, 4: 9} <BLANKLINE> EC class 1 : Algebraic normal form of representative: x0*x1 + x0 + x1 + x2*x3 Clique polynomial: 16*t^5 + 120*t^4 + 160*t^3 + 80*t^2 + 16*t + 1 Strongly regular parameters: (16, 10, 6, 6) Rank: 6 Order: 1920 <BLANKLINE> Linear code from representative: [10, 4] linear code over GF(2) Generator matrix: [1 0 1 0 1 0 0 1 0 0] [0 1 1 0 1 1 0 1 1 0] [0 0 0 1 1 1 0 0 0 1] [0 0 0 0 0 0 1 1 1 1] Linear code is projective. Weight distribution: {0: 1, 4: 5, 6: 10}
REFERENCES:
- save_as_csv(file_name_prefix)[source]
Save the classification as three csv files with a common prefix.
INPUT:
self
– the current object.file_name_prefix
– string: the common prefix to use for file names.
OUTPUT:
None.
EXAMPLES:
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification as BentFunctionCGC sage: import os sage: bf2 = BentFunction([0,0,0,1]) sage: c2 = BentFunctionCGC.from_function(bf2) sage: prefix = tmp_filename() sage: c2.save_as_csv(prefix) sage: c2_saved = BentFunctionCGC.from_csv(prefix) sage: print(c2 == c2_saved) True sage: bent_function_csv_name = prefix + BentFunctionCGC.bent_function_csv_suffix sage: os.remove(bent_function_csv_name) sage: cg_class_list_csv_name = prefix + BentFunctionCGC.cg_class_list_csv_suffix sage: os.remove(cg_class_list_csv_name) sage: matrices_csv_name = prefix + BentFunctionCGC.matrices_csv_suffix sage: os.remove(matrices_csv_name)
- save_cg_class_list_as_csv(file_name)[source]
Save the Cayley graph class list to a csv file.
INPUT:
file_name
– the name of the csv file.
OUTPUT:
None.
EXAMPLES:
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification as BentFunctionCGC sage: import os sage: bf2 = BentFunction([1,0,1,1]) sage: c2 = BentFunctionCGC.from_function(bf2) sage: csv_name = tmp_filename(ext=".csv") sage: c2.save_cg_class_list_as_csv(csv_name) sage: cgcl_saved = BentFunctionCGC.cg_class_list_from_csv(csv_name) sage: print(cgcl_saved == c2.cayley_graph_class_list) True sage: os.remove(csv_name)
- save_matrices_as_csv(file_name)[source]
Save the matrices bent_cayley_graph_index_matrix, dual_cayley_graph_index_matrix and weight_class_matrix to a csv file.
INPUT:
file_name
– the name of the csv file.
OUTPUT:
None.
EXAMPLES:
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification as BentFunctionCGC sage: import os sage: bf2 = BentFunction([0,1,1,1]) sage: dim = bf2.nvariables() sage: c2 = BentFunctionCGC.from_function(bf2) sage: csv_name = tmp_filename(ext=".csv") sage: c2.save_matrices_as_csv(csv_name) sage: (ci_matrix,di_matrix,wc_matrix) = BentFunctionCGC.matrices_from_csv(dim, csv_name) sage: print(c2.bent_cayley_graph_index_matrix == ci_matrix) True sage: print(c2.dual_cayley_graph_index_matrix == di_matrix) True sage: print(c2.weight_class_matrix == wc_matrix) True sage: os.remove(csv_name)
TESTS:
Test the case where list_dual_graphs=False and dual_cayley_graph_index_matrix is None.
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification as BentFunctionCGC sage: import os sage: bf = BentFunction([1,0,1,1]) sage: dim = bf.nvariables() sage: c = BentFunctionCGC.from_function(bf, list_dual_graphs=False) sage: csv_name = tmp_filename(ext=".csv") sage: c.save_matrices_as_csv(csv_name) sage: (ci_matrix,di_matrix,wc_matrix) = BentFunctionCGC.matrices_from_csv(dim, csv_name) sage: print(c.bent_cayley_graph_index_matrix == ci_matrix) True sage: print(c.dual_cayley_graph_index_matrix == di_matrix) True sage: print(c.weight_class_matrix == wc_matrix) True sage: os.remove(csv_name)
- save_matrix_plots(figure_name, cmap='gist_stern')[source]
Plot the matrix attributes to figure files.
Use
matrix_plot
to plot the matrix attributesbent_cayley_graph_index_matrix
,dual_cayley_graph_index_matrix
, andweight_class_matrix
to corresponding figure files.INPUT:
self
– the current object.figure_name
– string. The prefix to use in the file names for the figures.cmap
– string (default:'gist_stern'
). The colormap to use withmatrixplot
.
OUTPUT:
(To figure files:
figure_name
+"_bent_cayley_graph_index_matrix.png"
,figure_name
+"_dual_cayley_graph_index_matrix.png"
,figure_name
+"_weight_class_matrix.png"
) Plots of the corresponding matrix attributes.EXAMPLES:
sage: from boolean_cayley_graphs.bent_function import BentFunction sage: from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification as BentFunctionCGC sage: import glob sage: import os sage: bf = BentFunction([1,1,0,1]) sage: dim = bf.nvariables() sage: c = BentFunctionCGC.from_function(bf) sage: figure_name = tmp_filename() sage: c.save_matrix_plots(figure_name) sage: figure_list = glob.glob(figure_name+"*.png") sage: for figure in figure_list: ....: print( ....: "_bent_cayley_graph_index_matrix.png" in figure or ....: "_dual_cayley_graph_index_matrix.png" in figure or ....: "_weight_class_matrix.png" in figure) ....: print(os.path.isfile(figure)) ....: os.remove(figure) True True True True True True