Boolean-Cayley-graphs / boolean_cayley_graphs / __pycache__ / bent_function_cayley_graph_classification.cpython-39.pyc
24650 viewsa
�Ul_T) � @ s� d Z ddlmZ ddlmZmZ ddlmZ ddlmZ ddl m
Z
ddlmZ ddl
mZ dd lmZ dd
lmZ ddlmZ ddlmZ dd
lmZ ddlmZ ddlmZ ddlZddlZddlm Z ddl!m"Z" ddl!m#Z# ddl$m%Z% ddl&m'Z' ddl&m(Z( ddl)m*Z* ddl+m,Z, ddl+m-Z- ddl.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z6 ddl7Z7ddl8Z9dZ:G dd� dee/�Z;G d d!� d!e;�Z<dS )"a
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; and
* the ``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]_.
� )�datetime)�array�argwhere)�
LinearCode)�IncidenceStructure)�log)�Graph)�%strongly_regular_from_two_weight_code)�matrix)�latex)�load)�matrix_plot)�Integer)�
SageObject)�stdoutN)�BentFunction)�$binary_projective_two_weight_27_6_12)�$binary_projective_two_weight_35_6_16)�boolean_cayley_graph��linear_code_from_code_gens)�print_latex_code_parameters)�boolean_linear_code_graph)�
BijectiveList)�ShelveBijectiveList)�Saveable)�StronglyRegularGraph)�weight_class�sagec @ s@ e Zd ZdZdd� Zdd� Zedddd efd
d��Zdd
� Z dS )� BentFunctionCayleyGraphClassPartab
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))}}
c O s� z<|d }|j | _ |j| _|j| _|j| _|j| _|j| _W nV |�d�| _ |�d�| _|�d�| _|�dd�| _|�d�| _|�d�| _Y n0 dS ) a�
Constructor from an object or from class attributes.
INPUT:
- ``algebraic_normal_form`` -- a polynomial of the type
returned by ``BooleanFunction.algebraic_normal_form()``,
representing the ``BentFunction`` whose classification this is.
- ``cayley_graph_class_list`` -- a list of ``graph6_string`` strings
corresponding to the complete set of non-isomorphic Cayley graphs of
the bent functions within the extended translation equivalence class
of the ``BentFunction`` represented by ``algebraic_normal_form``,
and their duals, if ``dual_cayley_graph_index_matrix`` is not ``None``,
- ``bent_cayley_graph_index_matrix`` -- a ``Matrix` of integers,
which are indices into ``cayley_graph_class_list`` representing the
correspondence between bent functions and their Cayley graphs.
- ``dual_cayley_graph_index_matrix`` -- a ``Matrix` of integers,
which are indices into ``cayley_graph_class_list`` representing the
correspondence between dual bent functions and their Cayley graphs.
- ``weight_class_matrix`` -- a ``Matrix` of integers with value 0 or 1
corresponding to the weight class of each bent function.
- ``c_start`` -- an integer representing the Boolean vector
corresponding to the first row of each matrix.
OUTPUT:
None.
EFFECT:
The current object ``self`` is initialized as follows.
Each of
- ``algebraic_normal_form``
- ``cayley_graph_class_list``
- ``bent_cayley_graph_index_matrix``
- ``dual_cayley_graph_index_matrix``
- ``weight_class_matrix``
- ``c_start``
is set to the corresponding input parameter.
EXAMPLES:
The partial classification of the bent function defined by the polynomial
:math:`x_1 + x_2 + x_1 x_2` is copied from `c1` to `c2`.
::
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: c2 = BentFunctionCGCP(c1)
sage: print(c1 == c2)
True
r �algebraic_normal_form�cayley_graph_class_list�bent_cayley_graph_index_matrix�dual_cayley_graph_index_matrixN�weight_class_matrix�c_start)r r! r"