Boolean linear code graphs

The boolean_linear_code_graph module defines the functions:

  • boolean_linear_code_graph, which returns the graph corresponding to the linear code of a bent Boolean function; and

  • strongly_regular_from_code_gens, which returns the strongly regular graph corresponding to a list of generators of projective two-weight codes.

AUTHORS:

  • Paul Leopardi (2016-08-21): initial version

boolean_cayley_graphs.boolean_linear_code_graph.boolean_linear_code_graph(dim, f)[source]

Return the graph corresponding to the linear code of a bent Boolean function.

INPUT:

  • dim – positive integer. The assumed dimension of function f.

  • f – a Python function that takes a positive integer and returns 0 or 1. This is assumed to represent a bent Boolean function on \(\mathbb{F}_2^{dim}\) via lexicographical ordering.

OUTPUT:

An object of class Graph, representing the graph corresponding to the linear code of the bent Boolean function represented by f.

Warning

This function raises a ValueError if f is not bent.

REFERENCES:

EXAMPLES:

Where bf is a bent function.

sage: from sage.crypto.boolean_function import BooleanFunction
sage: bf = BooleanFunction([0,1,0,0,0,1,0,0,0,1,0,0,1,0,1,1])
sage: bf.is_bent()
True
sage: dim = bf.nvariables()
sage: from boolean_cayley_graphs.boolean_linear_code_graph import boolean_linear_code_graph
sage: bg = boolean_linear_code_graph(dim, bf)
sage: bg.is_strongly_regular()
True

Where f is not a bent function.

sage: from sage.crypto.boolean_function import BooleanFunction
sage: f = BooleanFunction([0,1,0,0,0,1,0,0,1,0,0,0,0,0,1,1])
sage: f.is_bent()
False
sage: from boolean_cayley_graphs.boolean_linear_code_graph import boolean_linear_code_graph
sage: dim = f.nvariables()
sage: g = boolean_linear_code_graph(dim, f)
Traceback (most recent call last):
    ...
ValueError: too many values to unpack (expected 2)
boolean_cayley_graphs.boolean_linear_code_graph.strongly_regular_from_code_gens(gens)[source]

Return the strongly regular graph corresponding to a list of generators.

INPUT:

  • gens – list. A list of strings of 0,1 characters. This is assumed to represent the generators of a projective two-weight linear code which yields a strongly regular graph.

OUTPUT:

An object of class Graph, representing the graph corresponding to the generators represented by gens.

Warning

This function raises a ValueError if gens is not a list of generators of a projective two-weight linear code which yields a strongly regular graph.

EXAMPLES:

Where ``gens`` is a list of generators for a code yielding a
strongly regular graph.

sage: from boolean_cayley_graphs.boolean_linear_code_graph import strongly_regular_from_code_gens
sage: gens = [
....: "100001",
....: "010100",
....: "001100",
....: "000011"]
sage: g = strongly_regular_from_code_gens(gens)
sage: g.is_strongly_regular()
True
Where ``nongens`` is a list of generators for a code that does *not*
yield a strongly regular graph.

sage: nongens = [
....: "10001",
....: "01000",
....: "00100",
....: "00011"]
sage: nong = strongly_regular_from_code_gens(nongens)
Traceback (most recent call last):
    ...
ValueError: too many values to unpack (expected 2)