#  tntorch: Tensor Network Learning with PyTorch

Mikhail Usvyatsov  Rafael Ballester-Ripoll  Konrad Schindler  ETH Zurich,
Switzerland, {mikhailu<EMAIL_ADDRESS>
###### Abstract

We present tntorch, a tensor learning framework that supports multiple
decompositions (including Candecomp/Parafac, Tucker, and Tensor Train) under a
unified interface. With our library, the user can learn and handle low-rank
tensors with automatic differentiation, seamless GPU support, and the
convenience of PyTorch’s API. Besides decomposition algorithms, tntorch
implements differentiable tensor algebra, rank truncation, cross-
approximation, batch processing, comprehensive tensor arithmetics, and more.

_Keywords_ tensor decompositions $\cdot$ pytorch $\cdot$ low-rank methods
$\cdot$ multilinear algebra

##  1 Introduction

In many machine learning and data analysis tasks one is faced with multi-
dimensional data arrays. Tensors are a powerful tool to represent and handle
such data, but often constitute a bottleneck in terms of storage and
computation. _Tensor decompositions_ expand a tensor into a set of separable
terms. If the tensor has low rank (i.e., there are much fewer degrees of
freedom than tensor elements), then such a decomposition can dramatically
reduce the representation size (Kolda and Bader,, 2009; Cichocki et al.,,
2016; Khrulkov et al.,, 2019).

Tensor decompositions play an increasingly important role in machine learning:
they are used to factorize neural network weights (Novikov et al.,, 2015;
Gusak et al.,, 2019; Wang et al.,, 2020; Idelbayev and Carreira-Perpiñán,,
2020; Kossaifi et al.,, 2020), to accelerate learning and inference (Ma et
al.,, 2019; Hrinchuk et al.,, 2019; Usvyatsov et al.,, 2021), to impose priors
that improve accuracy (Kuznetsov et al.,, 2019; He et al.,, 2022) and
robustness (Kolbeinsson et al.,, 2021), etc. For more applications of tensors
in machine learning see (Panagakis et al.,, 2021). Importantly, the
distinction between the different classical decomposition schemes has become
blurred, as newer types of low-rank constraints and tensor indexing schemes
have gained popularity (Novikov et al.,, 2015; Khrulkov et al.,, 2019;
Cichocki et al.,, 2016; Usvyatsov et al.,, 2021). There exist multiple
frameworks (Novikov et al.,, 2020; Kossaifi et al.,, 2019) with emphasis on
different aspects. We believe that more than ever, tensor software must be
flexible regarding the underlying tensor formats, while exposing a natural and
accessible interface to the user.

To this end, we introduce tntorch (github.com/rballester/tntorch), an open-
source Python package that abstracts the choice of format, while providing a
wide range of tools for tensor learning, manipulation, and analysis. Compared
to similar recent libraries T3F (Novikov et al.,, 2020), TensorLy (Kossaifi et
al.,, 2019), TedNet (Pan et al.,, 2021), TensorD (Hao et al.,, 2018),
TensorNetwork (Roberts et al.,, 2019), and tt-pytorch (Khrulkov et al.,,
2019), tntorch emphasizes an easy-to-use, decomposition-independent interface
inherited from PyTorch111tntorch can be installed conveniently via the PyPI
package manager (command: pip install tntorch). The package’s API is fully
documented and features a score of tutorial Jupyter notebooks
(tntorch.readthedocs.io) across a variety of use cases. See Section A.2 for a
point-by-point comparison with the aforementioned software packages as of June
2022.

##  2 Supported Tensor Formats

tntorch supports several decomposition models that are important in the
context of machine learning, including Candedomp/Parafac (CP, Harshman,,
1970), the Tucker decomposition222The Tucker tensor is represented as a TT
with arbitrary ranks, which has equal expressive power. Furthermore, Tucker
factors are implemented as standard unconstrained matrices, in contrast to
other implementations that often implement them as unitary/orthogonal
matrices. (de Lathauwer et al.,, 2000), and the tensor train (TT, Oseledets,,
2011). These formats are encapsulated into a single class Tensor and share a
common interface for all supported operations, which in turn replicate the API
of PyTorch as closely as possible. Internally, the decomposition is stored as
a low-rank _tensor network_ : a graph whose nodes are low-dimensional tensors
and whose edges are tensor dimensions that may be contracted together
(Cichocki et al.,, 2016) by performing the corresponding operation (e.g., a
matrix-vector product). Tensors in tntorch can mix more than one format, e.g.,
one may attach Tucker factors to TT cores, interleave CP and TT cores, or even
blend all three formats in various ways. See Fig. 1 for illustrative examples.

(a) 4D CP

(b) 4D TT-Tucker

(c) 5D CP-TT-Tucker (one of many possible combinations)

Figure 1: Examples of tensor networks that can be assembled in tntorch. A
square represents a matrix, as used for CP factors, Tucker factors, and for
the first and last cores of a TT; a circle is a 3D tensor and is used for
internal TT cores; a dot is a 3D copy tensor (Biamonte,, 2019), i.e., a super-
diagonal tensor with ones along the diagonal.

In tntorch, every decomposition consists of a sequence of cores and,
optionally, one or more factors. All nodes of the resulting tensor network may
also be accessed directly if the user desires low-level control. By virtue of
this abstraction, other tensor formats such as Indscal, Candelinc, Dedicom,
and Paratuck2 (Kolda and Bader,, 2009) can be represented as Tensor objects,
too. See documentation for details.

##  3 Features and Operations

###  3.1 Learning Tensors

Given a data tensor, tntorch can fit a decomposition in multiple ways. E.g.,
gradient descent is available out-of-the-box, thanks to PyTorch’s automatic
differentiation and the numerous optimizers it provides. It is very general,
as it can be used to learn incomplete tensors, tensors with constraints, or to
add various loss terms. For the case of learning TT tensors, a cross-
approximation routine is provided that performs adaptive sampling (Oseledets
and Tyrtyshnikov,, 2010). Other methods include _TT-SVD_ (Oseledets,, 2011),
_higher-order SVD_ and _alternating least squares_ (Kolda and Bader,, 2009)
for the TT, Tucker and CP formats, respectively.

###  3.2 Tensor Arithmetics

The library supports tensor$\times$matrix and tensor$\times$vector products,
element-wise operations, dot products, convolution, concatenation, mode
reordering, padding, orthogonalization, rank truncation, and more. These are
useful for common use cases in machine learning: tensor completion; learning
low-rank layers or compressing/approximating existing layers; applying multi-
linear operators; dimensionality reduction; etc. Advanced element-wise
functions such as /, exp, and tanh can be approximately computed via cross-
approximation (currently available for TT tensors). Besides these features,
tntorch also implements further, miscellaneous tools, such as: sensitivity
analysis; Boolean algebra operations; statistical moments; a smart reduction
operator; sampling from TT-compressed distributions; multi-linear polynomial
expansions; etc.

###  3.3 Slicing and Indexing

Any Tensor may be accessed in several ways:

  * -

_Basic indexing_ via slices in the format start:stop:step and variants, as in
t[::-1];

  * -

_Fancy indexing_ via handcrafted, possibly irregular slices, e.g. by passing a
list of indices as in t[:, (0, 3, 4)];

  * -

Indexing by NumPy arrays. For example, accessing an $N$-dimensional tensor by
an $M\times N$ NumPy matrix returns a 1D tensor with $M$ elements.

  * -

Insertion of dummy dimensions, as in t[None, :], or ellipsis, as in t[..., 3];

  * -

Broadcasting is supported, i.e., operations will be repeated along one or more
dimensions when their sizes do not match. For example, if t is a 1D tensor,
then t[:, None] + t[None, :] is a square matrix.

Such read operations match the behavior of PyTorch tensors almost
exactly333Interleaving fancy and basic indices is not supported, as it is in
general computationally expensive.. They are performed in the compressed
domain and return a compressed Tensor. Moreover, tensors can be edited using
the expected syntax, as in a[:, 0, :] = 2 * b[0, :, :] or t[(0, 2), ..., -1,
::3] += 1. All read/write operations preserve differentiability, a behavior at
present unique to tntorch, to the best of our knowledge.

###  3.4 Batched Tensors

Batch processing is an important capability to increase the efficiency of
tensor-based learning. Besides being differentiable and GPU-ready,
decomposition and arithmetic operations in tntorch work on batches of tensors
in any format; internally, a batch is represented as an extra dimension in
every node of the tensor network. As an example, we can decompose multiple
tensors into TT cores at once using the TT-SVD algorithm (Oseledets,, 2011),
with linear algebra operations applied in batches. See Section 4 for a
benchmark.

###  3.5 Tensor Train Matrices

The TT matrix decomposition has recently become a particularly relevant
format, because it is, among others, well-suited to compress neural weight
layers (Novikov et al.,, 2015). Unlike standard tensors, a TT matrix has a
different indexing scheme, with two sets of row and column indices. As a
consequence, TT matrices come with a distinct set of computation rules for
standard operations such as matrix$\times$vector multiplication. Therefore,
they have their own class TTMatrix, with a separate API. See additional
details in Section A.4

##  4 Performance

We benchmark tntorch’s running times across four representative operations: TT
decomposition using the TT-SVD algorithm, cross-approximation, and two
arithmetic operations that can be achieved by direct manipulation of TT cores
(Oseledets,, 2011). We test four modalities: CPU vs. GPU, and in both cases
for loop vs. vectorized batch processing. As a baseline, we also compare with
the Python library ttpy (Oseledets,, 2015), which is written in NumPy and
FORTRAN and also implements these four operations. All experiments use
randomly initialized tensors of TT-rank $R=20$, physical dimension sizes
$I=15,\dots,45$, and number of dimensions $N=8$ (except for the TT-SVD
experiment, where $N=4$). We used PyTorch 1.13.0a0+git87148f2 (compiled from
source) and NumPy 1.22.4 on an Intel(R) Core(TM) i7-7700K CPU with 64Gb RAM
and an NVIDIA GeForce RTX 3090 GPU.

Results are reported in Fig. 2. Note that the GPU is more performant on both
batch and non-batch modes. Also, tntorch scales better (or similarly, for
cross-approximation) than the baseline w.r.t. the tensor size, and is thus a
good fit for data-intensive ML applications.

(a) Element-wise sum

(b) Element-wise product

(c) TT-SVD

(d) Cross-approximation

Figure 2: Runtimes of four operations with varying tensor sizes (average time
per processed object, over 10 runs). The batch size is set to $B=32$. Best
viewed in color.

##  5 Conclusions

We have introduced tntorch, a PyTorch-powered library that unifies multiple
efficient tensor formats under the same interface, together with a rich suite
of learning and analysis routines. The library comes with many standard
features of modern machine learning frameworks, including auto-
differentiation, GPU and batch processing, and advanced indexing. tntorch
imitates the look and feel of standard PyTorch tensors, while making the power
of low-rank tensor decompositions accessible for machine learning.

##  Appendix A Appendix

###  A.1 Additional details

We heavily exploit the versatility of Einstein summation algebra as made
possible by PyTorch’s einsum function. Effectively, einsum allows to represent
tensor operations like summation and multiplication using compact strings of
symbols, each encoding one tensor index. tntorch represents basic
decompositions using:

  * •

CP: a sequence of 2D factor matrices

  * •

TT: a sequence of 3D tensor train cores

  * •

Tucker: the cores are TT-like, but they are chosen so as to be error-free
(i.e. they are not rank reduced). In addition, there is a sequence of 2D
factors to encode the Tucker bases.

###  A.2 Comparison between tensor libraries

| tntorch | T3F | TensorLy | TedNet | TensorD | TensorNetwork | tt-pytorch
---|---|---|---|---|---|---|---
Tensor arithmetics | ✓ | ✓ | - | - | ✓ | - | -
Fancy indexing | ✓ | - | - | - | - | - | -
CP decomposition | ✓ | - | ✓ | ✓ | ✓ | ✓111Tensor networks can be constructed, but no tools are provided to decompose a given data tensor into a desired network. | -
Tucker decomposition | ✓ | - | ✓ | - | ✓ | ✓111Tensor networks can be constructed, but no tools are provided to decompose a given data tensor into a desired network. | -
TT decomposition | ✓ | ✓ | ✓ | ✓ | - | ✓111Tensor networks can be constructed, but no tools are provided to decompose a given data tensor into a desired network. | ✓
CP/Tucker/TT blending | ✓222Batched decomposition of a data tensor is not supported. | - | - | - | - | ✓111Tensor networks can be constructed, but no tools are provided to decompose a given data tensor into a desired network. | -
Tensor ring | - | - | - | ✓ | - | ✓111Tensor networks can be constructed, but no tools are provided to decompose a given data tensor into a desired network. | ✓
Hierarchical/tree formats | - | - | - | - | - | ✓111Tensor networks can be constructed, but no tools are provided to decompose a given data tensor into a desired network. | -
TT matrix | ✓ | ✓ | ✓ | - | - | ✓111Tensor networks can be constructed, but no tools are provided to decompose a given data tensor into a desired network. | -
CP matrix | ✓ | - | - | - | - | ✓111Tensor networks can be constructed, but no tools are provided to decompose a given data tensor into a desired network. | -
Cross-approximation | ✓ | - | ✓ | - | - | - | -
Global optimization | ✓ | - | - | - | - | - | -
Riemannian optimization | - | ✓ | - | - | - | - | -
Batch processing | ✓ | ✓222Batched decomposition of a data tensor is not supported. | - | ✓ | - | ✓111Tensor networks can be constructed, but no tools are provided to decompose a given data tensor into a desired network. | -
Sparse tensor algorithms | - | ✓ | ✓ | - | - | - | -
Table 1: Feature comparison between tntorch and six related libraries that
also support GPU processing and automatic differentiation as of June 2022.

###  A.3 Cross-approximation

tntorch implements _cross-approximation_ (Oseledets and Tyrtyshnikov,, 2010),
a powerful technique to learn a compressed TT tensor out of a black-box
function by evaluating it on a limited set of samples. This is a valuable tool
when the target tensor does not fit into memory but it can be sampled on
demand, and can be used for surrogate modeling or to efficiently compute
functions of already compressed tensors. Cross-approximation has also been
adapted as a gradient-free global optimizer for discrete problems, and an
implementation is available in tntorch. See Sozykin et al., (2022) for a
detailed example of an application in reinforcement learning. tntorch also
provides a differentiable version of cross-approximation which alternates
between sample selection (which is a combinatorial, non-differentiable
heuristic), followed by evaluation and backpropagation of the target function
on the selected samples (Usvyatsov et al.,, 2021).

Under the hood, cross-approximation selects indices based on a tensor version
of an earlier algorithm known as _maxvol_ (Mikhalev and Oseledets,, 2018). In
short, _maxvol_ is a greedy heuristic that finds the $k$ most linearly
independent rows or columns from a given matrix (known to be an
$\mathcal{NP}$-hard problem (Civril and Magdon-Ismail,, 2009)). We use the
_maxvolpy_ library by Mikhalev, (2016), which relies on BLAS, for this
algorithm, but tntorch also provides its own implementation to fall back to
whenever BLAS is not available.

###  A.4 Tensor Train Matrices

A matrix of shape $M\times N$ (Fig. 3(a)) transforms to a tensor of shape
$m_{1}\times\dots\times m_{k}\times n_{1}\times\dots\times n_{k}$, where
$M=m_{1}\times\dots\times m_{k}$ and $N=n_{1}\times\dots\times n_{k}$.
Corresponding row and column dimensions are grouped together and the shape of
the resulting tensor becomes $m_{1}\times n_{1}\times\dots\times m_{k}\times
n_{k}$ (Fig. 3(b)). The tensor is subject to standard TT decomposition with
the cores of shape $R_{i}\times m_{i}n_{i}\times R_{i+1}$ (Fig. 3(c)) and
finally each core is reshaped to $R_{i}\times m_{i}\times n_{i}\times R_{i+1}$
(Fig. 3(d)), separating each input and output dimension on the core level.
Many operations discussed in Izmailov et al., (2018) have also been
implemented in tntorch, including fast matrix inverse and determinant
algorithms for rank-1 TT matrices that are equivalent to Kronecker products.

(a) Matrix of shape $M\times N$

(b) Tensor of shape $m_{1}\times n_{1}\times\dots\times m_{4}\times n_{4}$

(c) 4D TT tensor

(d) 4D TT matrix

Figure 3: Example of conversion of matrix to 4D TT tensor and corresponding TT
matrix

tt_multiply. In TT format matrix$\times$vector multiplication does not require
decompression. The vector of shape $N$ (Fig. 4(a)) is reshaped as in Fig. 4 to
a tensor of shape $n_{1}\times\dots\times n_{k}$ (Fig. 4(b)), such that
$N=n_{1}\times\dots\times n_{k}$ and corresponding dimensions are contracted
with the TT matrix (Fig. 3(d)). The result of matrix$\times$vector operation
is a contracted tensor of shape $m_{1}\times\dots\times m_{k}$, which can be
reshaped back to a vector of shape $M$. See (Novikov et al.,, 2015) for more
details.

(a) Vector of shape $N$

(b) Vector of shape $n_{1}\times\dots\times n_{4}$

Figure 4: Example of vector transformation for tt_multiply

###  A.5 CP Matrices

Similarly to TT matrix decomposition, we have also implemented a CP matrix
decomposition. The scheme for indexing and regrouping dimensions is identical
to that of TTMatrix. In a CP matrix, each CP factor has shape
$m_{i}n_{i}\times R$ but is conceptually equivalent to $m_{i}\times
n_{i}\times R$, where $m_{i}$ and $n_{i}$ are spatial dimensions. Like
TTMatrix, CP matrices require custom operations (such as matrix$\times$vector
products) that are not available for CP tensors and thus are implemented as a
separate class CPMatrix. See Fig. 1(a) for a visualization of a CP tensor and
Fig. 5 for the corresponding CP matrix with $I_{k}=m_{k}\times n_{k}$.

Figure 5: 4D CP matrix, during matrix$\times$vector multiplication dimensions
$m_{k}$ are contracted with corresponding vector dimensions

## References

  * Biamonte, (2019) Biamonte, J. (2019).  Lectures on quantum tensor networks.  arXiv preprint arXiv:1912.10049.
  * Cichocki et al., (2016) Cichocki, A., Lee, N., Oseledets, I. V., Phan, A.-H., Zhao, Q., and Mandic, D. P. (2016).  Tensor networks for dimensionality reduction and large-scale optimization: Part 1 - Low-rank tensor decompositions.  Foundations and Trends in Machine Learning, 9(4-5):249–429.
  * Civril and Magdon-Ismail, (2009) Civril, A. and Magdon-Ismail, M. (2009).  On selecting a maximum volume sub-matrix of a matrix and related problems.  Theoretical Computer Science, 410(47-49):4801–4811.
  * de Lathauwer et al., (2000) de Lathauwer, L., de Moor, B., and Vandewalle, J. (2000).  On the best rank-1 and rank-($R_{1},R_{2},...,R_{N}$) approximation of higher-order tensors.  SIAM Journal of Matrix Analysis and Applications, 21(4):1324–1342.
  * Gusak et al., (2019) Gusak, J., Kholiavchenko, M., Ponomarev, E., Markeeva, L., Oseledets, I., and Cichocki, A. (2019).  MUSCO: Multi-stage compression of neural networks.  arXiv preprint 1903.09973.
  * Hao et al., (2018) Hao, L., Liang, S., Ye, J., and Xu, Z. (2018).  TensorD: A tensor decomposition library in TensorFlow.  Neurocomputing, 318:196–200.
  * Harshman, (1970) Harshman, R. A. (1970).  Foundations of the PARAFAC procedure: Models and conditions for an “explanatory” multi-modal factor analysis.  UCLA Working Papers in Phonetics, 16:1–84.
  * He et al., (2022) He, W., Chen, Y., Yokoya, N., Li, C., and Zhao, Q. (2022).  Hyperspectral super-resolution via coupled tensor ring factorization.  Pattern Recognition, 122:108280.
  * Hrinchuk et al., (2019) Hrinchuk, O., Khrulkov, V., Mirvakhabova, L., Orlova, E., and Oseledets, I. (2019).  Tensorized embedding layers for efficient model compression.  arXiv preprint 1901.10787.
  * Idelbayev and Carreira-Perpiñán, (2020) Idelbayev, Y. and Carreira-Perpiñán, M. Á. (2020).  Low-rank compression of neural nets: Learning the rank of each layer.  In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8049–8059.
  * Izmailov et al., (2018) Izmailov, P., Novikov, A., and Kropotov, D. (2018).  Scalable gaussian processes with billions of inducing inputs via tensor train decomposition.  In International Conference on Artificial Intelligence and Statistics, pages 726–735. PMLR.
  * Khrulkov et al., (2019) Khrulkov, V., Hrinchuk, O., Mirvakhabova, L., Orlova, E., and Oseledets, I. (2019).  Tensorized embedding layers for efficient model compression.  arXiv preprint 1901.10787.
  * Kolbeinsson et al., (2021) Kolbeinsson, A., Kossaifi, J., Panagakis, Y., Bulat, A., Anandkumar, A., Tzoulaki, I., and Matthews, P. M. (2021).  Tensor dropout for robust learning.  IEEE Journal of Selected Topics in Signal Processing, 15(3):630–640.
  * Kolda and Bader, (2009) Kolda, T. G. and Bader, B. W. (2009).  Tensor decompositions and applications.  SIAM Review, 51(3):455–500.
  * Kossaifi et al., (2019) Kossaifi, J., Panagakis, Y., Anandkumar, A., and Pantic, M. (2019).  TensorLy: Tensor learning in Python.  Journal of Machine Learning Research, 20(1):925–930.
  * Kossaifi et al., (2020) Kossaifi, J., Toisoul, A., Bulat, A., Panagakis, Y., Hospedales, T. M., and Pantic, M. (2020).  Factorized higher-order CNNs with an application to spatio-temporal emotion estimation.  In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6060–6069.
  * Kuznetsov et al., (2019) Kuznetsov, M., Polykovskiy, D., Vetrov, D., and Zhebrak, A. (2019).  A prior of a googol Gaussians: a tensor ring induced prior for generative models.  In Advances in Neural Information Processing Systems, pages 4104–4114.
  * Ma et al., (2019) Ma, X., Zhang, P., Zhang, S., Duan, N., Hou, Y., Zhou, M., and Song, D. (2019).  A tensorized transformer for language modeling.  In Advances in Neural Information Processing Systems, pages 2232–2242.
  * Mikhalev, (2016) Mikhalev, A. (2016).  maxvolpy: routines for finding maximum volume submatrices and building cross- and CGR-approximations.  BitBucket repository, https://bitbucket.org/muxas/maxvolpy.
  * Mikhalev and Oseledets, (2018) Mikhalev, A. and Oseledets, I. V. (2018).  Rectangular maximum-volume submatrices and their applications.  Linear Algebra and its Applications, 538(Supplement C):187 – 211\.
  * Novikov et al., (2020) Novikov, A., Izmailov, P., Khrulkov, V., Figurnov, M., and Oseledets, I. (2020).  Tensor train decomposition on TensorFlow (T3F).  Journal of Machine Learning Research, 21:1–7.
  * Novikov et al., (2015) Novikov, A., Podoprikhin, D., Osokin, A., and Vetrov, D. (2015).  Tensorizing neural networks.  In Advances in Neural Information Processing Systems, pages 442–450.
  * Oseledets, (2011) Oseledets, I. V. (2011).  Tensor-train decomposition.  SIAM Journal on Scientific Computing, 33(5):2295–2317.
  * Oseledets, (2015) Oseledets, I. V. (2015).  ttpy: Python implementation of the tensor train (TT)-Toolbox.  GitHub repository, https://github.com/oseledets/ttpy.
  * Oseledets and Tyrtyshnikov, (2010) Oseledets, I. V. and Tyrtyshnikov, E. (2010).  TT-cross approximation for multidimensional arrays.  Linear Algebra Applications, 432(1):70–88.
  * Pan et al., (2021) Pan, Y., Wang, M., and Xu, Z. (2021).  TedNet: a PyTorch toolkit for tensor decomposition networks.  arXiv e-prints.
  * Panagakis et al., (2021) Panagakis, Y., Kossaifi, J., Chrysos, G. G., Oldfield, J., Nicolaou, M. A., Anandkumar, A., and Zafeiriou, S. (2021).  Tensor methods in computer vision and deep learning.  Proceedings of the IEEE, 109(5):863–890.
  * Roberts et al., (2019) Roberts, C., Milsted, A., Ganahl, M., Zalcman, A., Fontaine, B., Zou, Y., Hidary, J., Vidal, G., and Leichenauer, S. (2019).  TensorNetwork: A library for physics and machine learning.
  * Sozykin et al., (2022) Sozykin, K., Chertkov, A., Schutski, R., Phan, A.-H., Cichocki, A., and Oseledets, I. (2022).  Ttopt: A maximum volume quantized tensor train-based optimization and its application to reinforcement learning.  arXiv preprint arXiv:2205.00293.
  * Usvyatsov et al., (2021) Usvyatsov, M., Makarova, A., Ballester-Ripoll, R., Rakhuba, M., Krause, A., and Schindler, K. (2021).  Cherry-picking gradients: Learning low-rank embeddings of visual data via differentiable cross-approximation.  In International Conference on Computer Vision.
  * Wang et al., (2020) Wang, D., Wu, B., Zhao, G., Chen, H., Deng, L., Yan, T., and Li, G. (2020).  Kronecker cp decomposition with fast multiplication for compressing rnns.  arXiv preprint 2008.09342.


11institutetext:  Department of Mathematics
Indian Institute of Technology Roorkee, Roorkee 247667, India;
11email: {aditi.gangopadhyay<EMAIL_ADDRESS>22institutetext: Department
of Mathematics
Indian Institute of Technology Jodhpur, 342030, India
22email<EMAIL_ADDRESS>33institutetext: Novosibirsk State University,
Novosibirsk, 630090, Russia
33email<EMAIL_ADDRESS>44institutetext: Department of Computer
Science and Engineering,
Indian Institute of Technology Roorkee, Roorkee 247667, India;
44email<EMAIL_ADDRESS>
# Rayleigh quotients of Dillon’s functions

Aditi Kar Gangopadhyay 11 Mansi 11 Bimal Mandal 22
Aleksandr Kutsenko 33 Sugata Gangopadhyay 44

###### Abstract

The Walsh–Hadamard spectrum of a bent function uniquely determines a dual
function. The dual of a bent function is also bent. A bent function that is
equal to its dual is called a self-dual function. The Hamming distance between
a bent function and its dual is related to its Rayleigh quotient. Carlet,
Danielsen, Parker, and Solé [2] studied Rayleigh quotients of bent functions
in ${\mathcal{P}S}_{ap}$, and obtained an expression in terms of a character
sum [6]. We use another approach comprising of Desarguesian spreads to obtain
the complete spectrum of Rayleigh quotients of bent functions in
$\mathcal{PS}_{ap}$.

###### Keywords:

Boolean function, Walsh–Hadamard transform, Self-dual bent function, Rayleigh
quotient, Desarguesian spreads

##  1 Introduction

Let ${\mathbb{F}}_{2}$ be the prime field of characteristic $2$, and let
$[n]=\\{1,2,\ldots,n\\}$. We denote by ${\mathbb{F}}_{2^{n}}$ the extension
field of degree $n$ over ${\mathbb{F}}_{2}$. The $n$-dimensional vector space
of $n$-tuples of ${\mathbb{F}}_{2}$ is
${\mathbb{F}}_{2}^{n}=\\{(x_{1},x_{2},\ldots,x_{n})\mathrel{\mathop{\mathchar
58\relax}}x_{i}\in{\mathbb{F}}_{2},\mbox{ for all }i\in[n]\\}$. We adopt the
convention of writing a vector ${\bf x}$ in ${\mathbb{F}}_{2}^{n}$ as ${\bf
x}=(x_{1},x_{2},\ldots,x_{n})$ where $x_{i}\in{\mathbb{F}}_{2}$ are the
coordinates. The weight of a vector ${\bf x}\in\mathbb{F}_{2}^{n}$ is ${\rm
wt}({\bf x})=\displaystyle\sum_{i=1}^{n}x_{i}$ where sum is over integers. Let
$E_{e}=\\{{\bf x}\in\mathbb{F}_{2}^{n}\mathrel{\mathop{\mathchar
58\relax}}{\rm wt}({\bf x})\mbox{ is even}\\}$ and $E_{o}=\\{{\bf
x}\in\mathbb{F}_{2}^{n}\mathrel{\mathop{\mathchar 58\relax}}{\rm wt}({\bf
x})\mbox{ is odd}\\}$. The inner product on ${\mathbb{F}}_{2}^{n}$ is defined
by ${\bf x}\cdot{\bf y}=\oplus_{i=1}^{n}x_{i}y_{i}$, for all ${\bf x},{\bf
y}\in{\mathbb{F}}_{2}^{n}$, where $\oplus$ denotes addition over modulo $2$.

The trace function ${\rm Tr}_{1}^{n}\mathrel{\mathop{\mathchar
58\relax}}{\mathbb{F}}_{2^{n}}\rightarrow{\mathbb{F}}_{2}$ is defined by ${\rm
Tr}_{1}^{n}(x)=x+x^{2}+\cdots+x^{2^{n-1}}$, for all
$x\in{\mathbb{F}}_{2^{n}}$. The inner product on ${\mathbb{F}}_{2^{n}}$ is
defined by $(x,y)\mapsto{\rm Tr}_{1}^{n}(xy)$, for all
$x,y\in{\mathbb{F}}_{2^{n}}$. We use one of the above inner products depending
on our choice of the domain of Boolean functions. Suppose $U$ is a subspace of
${\mathbb{F}}_{2}^{n}$. The dual space of $U$ is

$U^{\perp}=\\{{\bf x}\in{\mathbb{F}}_{2}^{n}\mathrel{\mathop{\mathchar
58\relax}}{\bf x}\cdot{\bf y}=0,\mbox{ for all }{\bf y}\in U\\},$

or, equivalently, if $U$ is considered to be a vector subspace of
${\mathbb{F}}_{2^{n}}$, the dual space of $U$ is

$U^{\perp}=\\{x\in{\mathbb{F}}_{2^{n}}\mathrel{\mathop{\mathchar
58\relax}}{\rm Tr}_{1}^{n}(xy)=0,\mbox{ for all }y\in U\\}.$

###### Definition 1

A Boolean function in $n$ variables is an ${\mathbb{F}}_{2}$-valued function
from ${\mathbb{F}}_{2}^{n}$, or equivalently from ${\mathbb{F}}_{2^{n}}$ to
${\mathbb{F}}_{2}$.

Carlet [1], and Cusick and Stănică [3] are excellent sources for studying
Boolean functions relevant to cryptography and coding theory. Any Boolean
function $f$ in $n$ variables has a unique polynomial representation, called
the algebraic normal form (ANF) of $f$, of the form

$f(x_{1},x_{2},\ldots,x_{n})=\displaystyle\bigoplus_{{\bf
a}\in{\mathbb{F}}_{2}^{n}}\mu_{{\bf a}}\prod_{i=1}^{n}x_{i}^{a_{i}},$

where the coefficients $\mu_{{\bf a}}\in{\mathbb{F}}_{2}$, for all ${\bf
a}=(a_{1},a_{2},\ldots,a_{n})\in{\mathbb{F}}_{2}^{n}$. Let $\mathfrak{B}_{n}$
be the set of all Boolean functions in $n$ variables. The weight of $f$ is
${\rm wt}(f)=|{\rm supp}(f)|$, where ${\rm supp}(f)=\\{{\bf
x}\in{\mathbb{F}}_{2}^{n}\mathrel{\mathop{\mathchar 58\relax}}f({\bf x})\neq
0\\}$ is called the support of $f$. A function $f\in\mathfrak{B}_{n}$ is said
to be balanced if ${\rm wt}(f)=2^{n-1}$. The algebraic degree of $f$ is
$deg(f)=\max\\{{\rm wt}({\bf a})\mathrel{\mathop{\mathchar 58\relax}}\mu_{{\bf
a}}\neq 0\\}$. A Boolean function of degree atmost $1$ is called an affine
function. The set of all $n$-variable affine Boolean functions is denoted by
$\mathfrak{A}_{n}$. Affine functions in $n$ variables have the form
$f(x_{1},x_{2},\ldots,x_{n})=\oplus_{i=1}^{n}a_{i}x_{i}\oplus\varepsilon$,
where $a_{i},\varepsilon\in{\mathbb{F}}_{2}$, for all $i=1,2,\ldots,n$. If
$\varepsilon=0$, then $f$ is said to be an $n$-variable linear function, and
the set of all such functions is denoted by $\mathfrak{L}_{n}$. The Hamming
distance between two Boolean functions $f,g\in\mathfrak{B}_{n}$ is
$dist(f,g)=|\\{{\bf x}\in{\mathbb{F}}_{2}^{n}\mathrel{\mathop{\mathchar
58\relax}}f({\bf x})\neq g({\bf x})\\}|$. The minimum of the Hamming distances
of $f$ from the set of affine functions is called its nonlinearity, i.e.,
$nl_{f}=dist(f,\mathfrak{A}_{n})=\min\\{dist(f,g)\mathrel{\mathop{\mathchar
58\relax}}g\in\mathfrak{A}_{n}\\}$. The Walsh–Hadamard transform of
$f\in\mathfrak{B}_{n}$ is an integer-valued function
$W_{f}\mathrel{\mathop{\mathchar
58\relax}}{\mathbb{F}}_{2}^{n}\rightarrow{\mathbb{Z}}$, defined by

$W_{f}({\bf u})=\displaystyle\sum_{{\bf x}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf
x})\oplus{\bf u}\cdot{\bf x}},$

for all ${\bf u}\in{\mathbb{F}}_{2}^{n}$. The multiset $[W_{f}({\bf
u})\mathrel{\mathop{\mathchar 58\relax}}{\bf u}\in{\mathbb{F}}_{2}^{n}]$ is
said to be the Walsh–Hadamard spectrum of $f$. For each ${\bf
u}\in{\mathbb{F}}_{2}^{n}$, $W_{f}({\bf u})$ is used to calculate the distance
between $f$ and linear function ${\bf u}\cdot{\bf x}$. The relation between
the nonlinearity of $f$ and its Walsh–Hadamard spectrum is given by

$nl_{f}=2^{n-1}-\frac{1}{2}\max_{{\bf u}\in{\mathbb{F}}_{2}^{n}}|W_{f}({\bf
u})|.$

The functions with high nonlinearity have been studied in great detail due to
their applications in designing several cryptographic primitives. For any
positive, even integer $n$, the upper bound of nonlinearity is attained by a
class of functions called bent functions. Mesnager [8] is the most extensive
reference for studying bent functions. Contrarily, Tokareva [10] provides a
concise review of the theory of bent functions along with several intriguing
historical insights. This paper centres around finding the distribution of
Hamming distance of a bent function and their dual for some special classes of
bent functions.

###  1.1 Bent functions, duality, and Rayleigh quotients

Any Boolean function $f\in\mathfrak{B}_{n}$ satisfies Parseval’s identity
$\sum_{{\bf u}\in{\mathbb{F}}_{2}^{n}}|W_{f}({\bf u})|^{2}=2^{2n}$. In other
words, the average of the squares of the Walsh–Hadamard coefficients is
$2^{n}$. Since the maximum value in a data set of non–negative integers is
always greater than or equal to the average, i.e., $\max_{{\bf
u}\in{\mathbb{F}}_{2}^{n}}|W_{f}({\bf u})|\geq 2^{\frac{n}{2}}$. Thus,
nonlinearity of any Boolean function is bounded above by
$2^{n-1}-2^{\frac{n}{2}-1}$, i.e., for any $f\in\mathfrak{B}_{n}$

$nl_{f}\leq 2^{n-1}-2^{\frac{n}{2}-1}.$

When $n$ is even, this bound is attainable by a class of functions which are
called bent Boolean functions.

###### Definition 2

Let $n$ be a positive even integer. A Boolean function $f\in\mathfrak{B}_{n}$
that has nonlinearity $nl_{f}=2^{n-1}-2^{\frac{n}{2}-1}$ is said to be bent.

Equivalently, a Boolean function in $n$ variables is called bent if and only
if $|W_{f}({\bf u})|=2^{\frac{n}{2}}$, for all ${\bf
u}\in{\mathbb{F}}_{2}^{n}$. Thus, bent functions are defined over an even
number of variables and its Walsh–Hadamard spectrum consists of two values
only.

###### Definition 3

If $f\in\mathfrak{B}_{n}$ is a bent function, then there exists a unique
function $\widetilde{f}\mathrel{\mathop{\mathchar
58\relax}}{\mathbb{F}}_{2}^{n}\rightarrow{\mathbb{F}}_{2}$ such that

$W_{f}({\bf u})=(-1)^{\widetilde{f}({\bf u})}2^{\frac{n}{2}},\mbox{ for all
}{\bf u}\in{\mathbb{F}}_{2}^{n}.$

The function $\widetilde{f}$ is said to be the dual of $f$, and it is also a
bent function in $n$ variables.

In particular, if $f=\widetilde{f}$ then $f$ is called self-dual, and if
$f=\widetilde{f}\oplus 1$, i.e., $\widetilde{f}$ is complement of $f$ then $f$
is called anti-self-dual. Rothaus [13] first constructed a class of bent
functions, called Maiorana–McFarland bent functions. Let $n=2k$. A function
$f\mathrel{\mathop{\mathchar
58\relax}}{\mathbb{F}}_{2}^{k}\times{\mathbb{F}}_{2}^{k}\rightarrow{\mathbb{F}}_{2}$
is in Maiorana–McFarland bent class if

$f({\bf x},{\bf y})={\bf x}\cdot\pi({\bf y})\oplus g({\bf y}),$

for all ${\bf x},{\bf y}\in{\mathbb{F}}_{2}^{k}$, where
$\pi\mathrel{\mathop{\mathchar
58\relax}}{\mathbb{F}}_{2}^{k}\rightarrow{\mathbb{F}}_{2}^{k}$ is permutation
and $g\mathrel{\mathop{\mathchar
58\relax}}{\mathbb{F}}_{2}^{k}\rightarrow{\mathbb{F}}_{2}$ is any Boolean
function in $k$ variables. The dual of Maiorana–McFarland function $f$ is also
of the same type given as:

$\widetilde{f}({\bf x},{\bf y})={\bf x}\cdot\pi^{-1}({\bf y})\oplus
g(\pi^{-1}({\bf y})),$

for all ${\bf x},{\bf y}\in{\mathbb{F}}_{2}^{k}$. Dillon [4, 5] constructed
another class of bent functions, called partial spread ($\mathcal{PS}$), whose
support is the union of elements of partial spreads of ${\mathbb{F}}_{2}^{n}$.
Further, Dillon constructed a subclass of partial spread functions consisting
of elements from a spread. We call these functions Dillon’s functions [6].

###### Definition 4

Let $n=2k$ be an even integer. A partial spread of ${\mathbb{F}}_{2}^{n}$
consists of pairwise supplementary $k$-dimensional subspaces of
${\mathbb{F}}_{2}^{n}$. A partial spread is a full spread if the union of its
elements equals ${\mathbb{F}}_{2}^{n}$.

The $\mathcal{PS}$ class is divided into two disjoint class of functions,
called $\mathcal{PS^{-}}$ and $\mathcal{PS^{+}}$, i.e.,
${\mathcal{P}}{\mathcal{S}}={\mathcal{P}}{\mathcal{S}}^{-}\cup{\mathcal{P}}{\mathcal{S}}^{+}$.
We first define the indicator function of a set $S$ as

$\phi_{S}({\bf x})=\left\\{\begin{array}[]{ll}1&\mbox{ if }{\bf x}\in S;\\\
0&\mbox{ if }{\bf x}\notin S.\end{array}\right.$

Let $U$ and $V$ be two subspaces of ${\mathbb{F}}_{2}^{n}$. We refer to $U$
and $V$ as “disjoint” if $U\cap V=\\{{\bf 0}\\}$, where ${\bf 0}$ is the all-
zero vector of ${\mathbb{F}}_{2}^{n}$. Let $E_{i}$, $i=1,2,\ldots,2^{k-1}$ are
mutually “disjoint” $k$-dimensional subspaces of ${\mathbb{F}}_{2}^{n}$. A
bent function $f\in\mathfrak{B}_{n}$ is said to be in
${\mathcal{P}}{\mathcal{S}}^{-}$ class if it is of the form

$f({\bf x})=\displaystyle\sum_{i=1}^{2^{k-1}}\phi_{E_{i}}({\bf
x})-2^{k-1}\phi_{\\{{\bf 0}\\}}({\bf x}).$

The dual of $f\in{\mathcal{P}}{\mathcal{S}}^{-}$ is of the form
$\widetilde{f}({\bf
x})=\displaystyle\sum_{i=1}^{2^{k-1}}\phi_{E_{i}^{\perp}}({\bf
x})-2^{k-1}\phi_{\\{{\bf 0}\\}}({\bf x})$. A bent function
$f\in\mathfrak{B}_{n}$ is said to be in ${\mathcal{P}}{\mathcal{S}}^{+}$ class
if it is of the form

$f({\bf x})=\displaystyle\sum_{i=1}^{2^{k-1}+1}\phi_{E_{i}}({\bf
x})-2^{k-1}\phi_{\\{{\bf 0}\\}}({\bf x}),$

where $E_{i}$, $i=1,2,\ldots,2^{k-1}+1$ are mutually “disjoint”
$k$-dimensional subspaces of ${\mathbb{F}}_{2}^{n}$. The dual of
$f\in{\mathcal{P}}{\mathcal{S}}^{+}$ is of the form

$\widetilde{f}({\bf
x})=\displaystyle\sum_{i=1}^{2^{k-1}+1}\phi_{E_{i}^{\perp}}({\bf
x})-2^{k-1}\phi_{\\{{\bf 0}\\}}({\bf x}).$

The distance between a bent function and its dual is an interesting research
problem. Danielsen et al. [6] introduced the normalized Rayleigh quotient of a
bent Boolean function that measures the distance of the bent function to its
dual.

###### Definition 5

The Rayleigh quotient $S_{f}$ of a Boolean function $f$ in $n$ variables is

$S_{f}=\displaystyle\sum_{{\bf x},{\bf y}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf
x})\oplus f({\bf y})\oplus{\bf x}\cdot{\bf y}}=\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf x})}W_{f}({\bf x}).$

For bent functions, we use the normalized version of the Rayleigh quotient.
The normalized Rayleigh quotient $N_{f}$ of a bent function $f$ in $n$
variables is

$N_{f}=\displaystyle\sum_{{\bf x}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf
x})\oplus\widetilde{f}({\bf x})}=2^{-\frac{n}{2}}S_{f}.$

For an $n$-variable bent Boolean function $f$, $N_{f}=2^{n}$ is $f$ is self-
dual, and $N_{f}=-2^{n}$ if $f$ is anti-self-dual. The Hamming distance
between a bent function $f$ and its dual $\widetilde{f}$ is

$\displaystyle{\rm dist}(f,\widetilde{f})=|\\{{\bf
x}\in{\mathbb{F}}_{2}^{n}\mathrel{\mathop{\mathchar 58\relax}}f({\bf
x})\neq\widetilde{f}({\bf x})\\}|$ $\displaystyle=2^{n-1}-\frac{N_{f}}{2}$
$\displaystyle=\left\\{\begin{array}[]{ll}0&\mbox{ if }f\mbox{ is self-
dual}\\\ 2^{n}&\mbox{ if }f\mbox{ is anti self-dual}\end{array}\right.$

Now, we are going to discuss some results related to Rayleigh’s quotients of
symmetric bent functions.

###  1.2 Distribution of Rayleigh quotients of symmetric bent functions

A Boolean function $f\in\mathfrak{B}_{n}$ is called a symmetric Boolean
function if its output remains the same for any permutation of its inputs. In
1994, Savický [9] derived the following characterization for symmetric bent
functions.

###### Theorem 1.1

[9, Theorem 3.3] If $f({\bf x})=c_{k}$, ${\rm wt}({\bf x})=k$, is a symmetric
function of an even number of variable $n$, then the following statements are
equivalent:

  1. 1.

The function $f$ is a bent function;

  2. 2.

For all $k=0,1,\dots,n-2$, the identity $c_{k+2}=c_{k}\oplus 1$ is satisfied;

  3. 3.

There exist $\varepsilon_{1},\varepsilon_{2}\in{\mathbb{F}}_{2}$, $f({\bf
x})=\oplus_{1\leq i<j\leq
n}x_{i}x_{j}\oplus\varepsilon_{1}(\oplus_{i=1}^{n}x_{i})\oplus\varepsilon_{2}$,
for all ${\bf x}\in{\mathbb{F}}_{2}^{n}$.

We first derive the dual of symmetric bent functions explicitly. Then the
possible Rayleigh quotient of symmetric bent functions are calculated. It is
observed that the dual of a symmetric bent function is either self-dual or
anti-self-dual or exactly half of the output of dual function is the same as
the output of the function and the other half is different. These cases are
depended on the number of variables and the coefficient related to the
constant and linear terms. The results are given in the following
Propositions.

###### Proposition 1

Let $f\in\mathfrak{B}_{n}$ be a symmetric bent function then the dual of $f$
is

$\displaystyle\tilde{f}({\bf x})=\begin{cases}{\rm wt}({\bf x})\oplus c_{{\rm
wt}({\bf x})}\oplus\frac{n}{4}&\text{if $\frac{n}{2}$ is even}\\\ &\\\
\begin{cases}{\rm wt}({\bf x})\oplus c_{{\rm wt}({\bf
x})+1}\oplus\lfloor\frac{n}{4}\rfloor&\text{if ${\rm wt}({\bf x})\leq n-1$}\\\
n\oplus 1\oplus c_{1}\oplus\lfloor\frac{n}{4}\rfloor&\text{if ${\rm wt}({\bf
x})=n$}\end{cases}&\text{if $\frac{n}{2}$ is odd}\end{cases}.$

###### Proposition 2

Let $f\in\mathfrak{B}_{n}$ be a symmetric bent Boolean function, then the
Rayleigh quotient of $f$ is

$N_{f}=\begin{cases}0&\text{if $\frac{n}{2}$ is even}\\\ &\\\
\begin{cases}2^{n}&\begin{cases}\text{either $\lfloor\frac{n}{4}\rfloor$ is
even and $c_{0}=c_{1}$}\\\ \text{or $\lfloor\frac{n}{4}\rfloor$ is odd and
$c_{0}=c_{1}\oplus 1$}\end{cases}\\\ &\\\ -2^{n}&\begin{cases}\text{either
$\lfloor\frac{n}{4}\rfloor$ is odd and $c_{0}=c_{1}$}\\\ \text{or
$\lfloor\frac{n}{4}\rfloor$ is even and
$c_{0}=c_{1}+1$}\end{cases}\end{cases}&\text{if $\frac{n}{2}$ is
odd}\end{cases},$

where $c_{0}$ and $c_{1}$ are the output value of function for input of weight
$0$ and $1$, respectively, and $\lfloor\cdot\rfloor$ is the floor function.

We refer [12, 9] to get details of these propositions. From above, we have a
complete spectrum of Rayleigh quotients for symmetric bent Boolean functions.
By ease, without doing many calculations, if we are given a symmetric bent
Boolean function we can find out its Rayleigh quotient. But it is not the case
with Dillon’s functions. The method of finding the Rayleigh quotient of
Dillon’s function is given in [2]. We are interested in finding the possible
distance between Dillon’s functions and their duals using another approach.
So, we partition the bent functions into distinct sets based on the distance
between them and their duals. At this point, it is worth noting that Kolomeec
[7] proved that the minimum Hamming distance between two bent functions is
$2^{\frac{n}{2}}$. Therefore, the largest possible Hamming distance between
two bent functions is $2^{n}-2^{\frac{n}{2}}$, except for anti-self-dual bent
functions.

##  2 Properties of bent functions and their duals

In this section, we study some metrical properties of bent functions and their
duals. These expressions can help us characterise the distance between a bent
function and its dual. Let us denote $E_{e}=\\{{\bf
x}\in{\mathbb{F}}_{2}^{n}\mathrel{\mathop{\mathchar 58\relax}}{\rm wt}({\bf
x})\mbox{ is even}\\}$ and $E_{o}=\\{{\bf
x}\in{\mathbb{F}}_{2}^{n}\mathrel{\mathop{\mathchar 58\relax}}{\rm wt}({\bf
x})\mbox{ is odd}\\}$. The restricted Walsh–Hadamard transform over
$A\subset{\mathbb{F}}_{2}^{n}$ of a Boolean function $f\in\mathfrak{B}_{n}$ at
${\bf a}\in{\mathbb{F}}_{2}^{n}$ is denoted by $W_{f}({\bf a})|_{A}$, defined
as $W_{f}({\bf a})|_{A}=\displaystyle\sum_{{\bf x}\in A}(-1)^{f({\bf
x})\oplus{\bf a}\cdot{\bf x}}$.

###### Proposition 3

Let $f\in\mathfrak{B}_{n}$, where $n=2k\geq 4$, be a bent function and its
dual $\widetilde{f}$. The distance between $f$ and $\widetilde{f}$ can be
written as

$\begin{split}{\rm dist}(f,\widetilde{f})&=2^{n-1}-2^{k-1}(-1)^{f({\bf
0})}+\frac{1}{2^{k}}\displaystyle\sum_{{\bf u}\in{\rm supp}(f)}W_{f}({\bf
u})\\\ &=2^{n-1}-\frac{1}{2^{k+1}}\displaystyle\sum_{{\bf
u}\in{\mathbb{F}}_{2}^{n}}W_{D_{{\bf u}}f}({\bf
u})+\frac{1}{2^{k}}\displaystyle\sum_{{\bf
u}\in{\mathbb{F}}_{2}^{n}}W_{D_{{\bf u}}f}({\bf u})|_{E_{o}}.\end{split}$

###### Proof

Let $f\in\mathfrak{B}_{n}$ be a bent function, $n=2k\geq 4$, and $W_{f}({\bf
u})=2^{k}(-1)^{\widetilde{f}({\bf u})}$, for all ${\bf
u}\in{\mathbb{F}}_{2}^{n}$. The Hamming distance between $f$ and
$\widetilde{f}$ is

$\displaystyle{\rm dist}(f,\widetilde{f})$ $\displaystyle=|\\{{\bf
x}\in{\mathbb{F}}_{2}^{n}\mathrel{\mathop{\mathchar 58\relax}}f({\bf
x})\neq\widetilde{f}({\bf x})\\}|=2^{n-1}-\frac{1}{2}\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf x})\oplus\widetilde{f}({\bf x})}$
$\displaystyle=2^{n-1}-\frac{1}{2}\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}(1-2f({\bf x}))(-1)^{\widetilde{f}({\bf x})}$
$\displaystyle=2^{n-1}-\frac{1}{2}\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}(-1)^{\widetilde{f}({\bf
x})}+\displaystyle\sum_{{\bf x}\in{\mathbb{F}}_{2}^{n}}f({\bf
x})(-1)^{\widetilde{f}({\bf x})}$
$\displaystyle=2^{n-1}-\frac{1}{2^{k+1}}\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}W_{f}({\bf
x})+\frac{1}{2^{k}}\displaystyle\sum_{{\bf x}\in{\rm supp}(f)}W_{f}({\bf x})$
$\displaystyle=2^{n-1}-\frac{1}{2^{k+1}}\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}\displaystyle\sum_{{\bf
y}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf y})\oplus{\bf y}\cdot{\bf
x}}+\frac{1}{2^{k}}\displaystyle\sum_{{\bf x}\in{\rm supp}(f)}W_{f}({\bf x})$
$\displaystyle=2^{n-1}-\frac{1}{2^{k+1}}\displaystyle\sum_{{\bf
y}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf y})}\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}(-1)^{{\bf y}\cdot{\bf
x}}+\frac{1}{2^{k}}\displaystyle\sum_{{\bf x}\in{\rm supp}(f)}W_{f}({\bf x})$
$\displaystyle=2^{n-1}-2^{k-1}(-1)^{f({\bf
0})}+\frac{1}{2^{k}}\displaystyle\sum_{{\bf x}\in{\rm supp}(f)}W_{f}({\bf
x}),$

and

$\displaystyle{\rm dist}(f,\widetilde{f})$
$\displaystyle=2^{n-1}-\frac{1}{2}\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf x})\oplus\widetilde{f}({\bf
x})}=2^{n-1}-\frac{1}{2^{k+1}}\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf x})}W_{f}({\bf x})$
$\displaystyle=2^{n-1}-\frac{1}{2^{k+1}}\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}\displaystyle\sum_{{\bf
y}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf x})\oplus f({\bf y})\oplus{\bf
y}\cdot{\bf x}}$
$\displaystyle=2^{n-1}-\frac{1}{2^{k+1}}\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}\displaystyle\sum_{{\bf
y}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf x})\oplus f({\bf y})}(-1)^{{\bf
y}\cdot{\bf x}}$
$\displaystyle=2^{n-1}-\frac{1}{2^{k+1}}\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}\displaystyle\sum_{{\bf
u}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf x})\oplus f({\bf x}\oplus{\bf
u})}(-1)^{({\bf x}\oplus{\bf u})\cdot{\bf x}}$
$\displaystyle=2^{n-1}-\frac{1}{2^{k+1}}\displaystyle\sum_{{\bf
u}\in{\mathbb{F}}_{2}^{n}}\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}(-1)^{D_{{\bf u}}f({\bf x})}(-1)^{{\rm wt}({\bf
x})}(-1)^{{\bf u}\cdot{\bf x}}$
$\displaystyle=2^{n-1}-\frac{1}{2^{k+1}}\displaystyle\sum_{{\bf
u}\in{\mathbb{F}}_{2}^{n}}\bigg{\\{}\displaystyle\sum_{{\bf x}\in
E_{e}}(-1)^{D_{{\bf u}}f({\bf x})\oplus{\bf u}\cdot{\bf
x}}-\displaystyle\sum_{{\bf x}\in E_{o}}(-1)^{D_{{\bf u}}f({\bf x})\oplus{\bf
u}\cdot{\bf x}}\bigg{\\}}$
$\displaystyle=2^{n-1}-\frac{1}{2^{k+1}}\displaystyle\sum_{{\bf
u}\in{\mathbb{F}}_{2}^{n}}\bigg{\\{}\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}(-1)^{D_{{\bf u}}f({\bf x})\oplus{\bf u}\cdot{\bf
x}}-2\displaystyle\sum_{{\bf x}\in E_{o}}(-1)^{D_{{\bf u}}f({\bf x})\oplus{\bf
u}\cdot{\bf x}}\bigg{\\}}$
$\displaystyle=2^{n-1}-\frac{1}{2^{k+1}}\displaystyle\sum_{{\bf
u}\in{\mathbb{F}}_{2}^{n}}W_{D_{{\bf u}}f}({\bf
u})+\frac{1}{2^{k}}\displaystyle\sum_{{\bf
u}\in{\mathbb{F}}_{2}^{n}}W_{D_{{\bf u}}f}({\bf u})|_{E_{o}}.$

###### Corollary 1

For any bent function $f\in\mathfrak{B}_{n}$ where $n\geq 4$ is a positive
even integer, we have

$2\displaystyle\sum_{{\bf u}\in{\rm supp}(f)}W_{f}({\bf
u})+\displaystyle\sum_{{\bf u}\in{\mathbb{F}}_{2}^{n}}W_{D_{{\bf u}}f}({\bf
u})-2\displaystyle\sum_{{\bf u}\in{\mathbb{F}}_{2}^{n}}W_{D_{{\bf u}}f}({\bf
u})|_{E_{o}}-2^{n}(-1)^{f({\bf 0})}=0.$

The set of bent functions can be partitioned using the distance between bent
functions and their duals. Let us define the equivalence classes of bent
functions.

###### Definition 6

Two bent functions $f,g\in\mathfrak{B}_{n}$ are called distance equivalent if
${\rm dist}(f,\widetilde{f})={\rm dist}(g,\widetilde{g})$, and are denoted by
$f\sim g$.

For any bent functions $f,g,h\in\mathfrak{B}_{n}$, $f\sim f$, and if $f\sim g$
then $g\sim f$, and if $f\sim g$ and $g\sim h$ then $f\sim h$. Thus, “$\sim$”
is an equivalence relation on the set of bent functions. Let us define
equivalence classes of bent functions corresponding to this equivalence
relation as

$cl(i)=\\{f\in\mathfrak{B}_{n}\mathrel{\mathop{\mathchar 58\relax}}f\mbox{ is
bent and }{\rm dist}(f,\widetilde{f})=i\\},\text{ for all }0\leq i\leq 2^{n}.$

Equivalence classes of self-dual and anti-self-dual functions are $cl(0)$ and
$cl(2^{n})$, respectively. Except for the anti-self-dual function, ${\rm
dist}(f,\widetilde{f})\leq 2^{n}-2^{\frac{n}{2}}$. For every $0\leq i\neq
j\leq 2^{n},cl(i)\cap cl(j)=\emptyset$. Thus, the set of all bent functions in
$n$ variables is $\cup_{i=0}^{2^{n}}cl(i)$. Here, the two obvious questions
arise, as below:

  * •

Are the bent functions of the same class, i.e., $cl(i)$, for a fixed $0\leq
i\leq 2^{n}$, affine equivalent? Or is it possible to find a non–singular
affine transformation such that both bent functions belong to the same class?

  * •

What are the possible distances for a particular class of bent functions?

We are going to address both questions in this paper. Now, we prove that these
distance classes are, in general, not affine invariant. In the following
section, we determine the specifics of potential classes of a class of bent
functions.

Let $f$ be a bent function in $n=2k$ variables and $g({\bf x})=f({\bf
x}A\oplus{\bf b})$, for all ${\bf x}\in{\mathbb{F}}_{2}^{n}$, where $A$ is a
non–singular binary matrix of order $n$ and ${\bf b}\in{\mathbb{F}}_{2}^{n}$.
Then $g({\bf 0})=f({\bf b})$, ${\rm supp}(g)={\rm supp}(f)B\oplus{\bf
b}B=\\{{\bf x}B\oplus{\bf b}B\mathrel{\mathop{\mathchar 58\relax}}f({\bf
x})=1\\}$, where $B=A^{-1}$, and for any ${\bf u}\in{\mathbb{F}}_{2}^{n}$,

$\begin{split}W_{g}({\bf u})&=\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf x}A\oplus{\bf b})\oplus{\bf u}\cdot{\bf
x}}=\displaystyle\sum_{{\bf y}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf
y})\oplus{\bf u}\cdot({\bf y}B\oplus{\bf b}B)}\\\ &=(-1)^{{\bf
u}B^{T}\cdot{\bf b}}\displaystyle\sum_{{\bf
y}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf y})\oplus{\bf u}B^{T}\cdot{\bf
y}}=(-1)^{{\bf u}B^{T}\cdot{\bf b}}W_{f}({\bf u}B^{T}).\end{split}$

Thus,

$\allowdisplaybreaks\begin{split}{\rm
dist}(g,\widetilde{g})&=2^{n-1}-2^{k-1}(-1)^{g(0)}+\frac{1}{2^{k}}\displaystyle\sum_{{\bf
u}\in{\rm supp}(g)}W_{g}({\bf u})\\\ &=2^{n-1}-2^{k-1}(-1)^{f({\bf
b})}+\frac{1}{2^{k}}\displaystyle\sum_{{\bf u}\in{\rm supp}(f)B+{\bf
b}B}(-1)^{{\bf u}B^{T}\cdot{\bf b}}W_{f}({\bf u}B^{T})\\\
&=2^{n-1}-2^{k-1}(-1)^{f({\bf b})}\\\ &+\frac{1}{2^{k}}\displaystyle\sum_{{\bf
u}^{\prime}\in{\rm supp}(f)}(-1)^{({\bf u}^{\prime}\oplus{\bf
b})BB^{T}\cdot{\bf b}}W_{f}(({\bf u}^{\prime}\oplus{\bf b})BB^{T})\\\
&\neq{\rm dist}(f,\widetilde{f}),\text{ in general}.\end{split}$

Let $A$ be an orthogonal binary matrix. Then $BB^{T}=(A^{T}A)^{-1}=I_{n}$, and

${\rm dist}(g,\widetilde{g})=2^{n-1}-2^{k-1}(-1)^{f({\bf b})}+\frac{(-1)^{{\rm
wt}({\bf b})}}{2^{k}}\displaystyle\sum_{{\bf u}^{\prime}\in{\rm
supp}(f)}(-1)^{{\bf u}^{\prime}\cdot b}W_{f}({\bf u}^{\prime}\oplus{\bf b}).$

In particular if ${\bf b}={\bf 0}$, then ${\rm dist}(g,\widetilde{g})={\rm
dist}(f,\widetilde{f})$. We get the next results directly from the above
expressions.

###### Theorem 2.1

Let $f\in\mathfrak{B}_{n}$ be bent and $g({\bf x})=f({\bf x}A\oplus{\bf b})$,
for all ${\bf x}\in{\mathbb{F}}_{2}^{n}$, where $A$ is a binary orthogonal
matrix of order $n$ and ${\bf b}\in{\mathbb{F}}_{2}^{n}$. If ${\bf b}={\bf
0}$, then it preserves the distance, and if ${\bf b}\neq{\bf 0}$, then ${\rm
dist}(f,\widetilde{f})={\rm dist}(g,\widetilde{g})$ if and only if one of the
following condition holds.

  * 1.

If $f({\bf 0})=f({\bf b})$, then $\displaystyle\sum_{{\bf u}\in{\rm
supp}(f)}W_{f}({\bf u})=(-1)^{{\rm wt}({\bf b})}\displaystyle\sum_{{\bf
u}\in{\rm supp}(f)}(-1)^{{\bf b}\cdot{\bf u}}W_{f}({\bf u}\oplus{\bf b})$.

  * 2.

If $f({\bf 0})\neq f({\bf b})$, then $\displaystyle\sum_{{\bf u}\in{\rm
supp}(f)}W_{f}({\bf u})-(-1)^{{\rm wt}({\bf b})}\displaystyle\sum_{{\bf
u}\in{\rm supp}(f)}(-1)^{{\bf b}\cdot{\bf u}}W_{f}({\bf u}\oplus{\bf
b})=2^{2k}(-1)^{f({\bf 0})}$.

From the above theorem, it is clear that a self-dual bent function may not be
a self-dual bent after a suitable non–singular affine transformation.
Similarly, a suitable non–singular affine transformation can be used to
construct a self-dual bent function from a bent function that is not self-
dual.
For example let us consider $n=4$, $f({\bf x})=x_{1}x_{3}+x_{2}x_{4}$, for all
${\bf x}\in{\mathbb{F}}_{2}^{4}$, and two binary non–singular matrices $A$ and
$A^{\prime}$ of order $4$ as

$A=\begin{bmatrix}1&1&1&0\\\ 1&1&0&1\\\ 1&0&1&1\\\ 0&1&1&1\\\
\end{bmatrix},\quad\;\;A^{\prime}=\begin{bmatrix}1&0&0&0\\\ 1&1&0&0\\\
1&1&1&0\\\ 1&1&1&1\\\ \end{bmatrix}.\quad$

Here $f$ is a self-dual bent function and $A$ is an orthogonal matrix, but
$A^{\prime}$ is not. Suppose $g({\bf x})=f({\bf x}A)$, $g^{\prime}({\bf
x})=f({\bf x}A^{\prime})$, and $h({\bf x})=f({\bf x}A\oplus(0,1,1,1))$ for all
${\bf x}\in{\mathbb{F}}_{2}^{4}$. Then $g$ is also self-dual bent, but
$g^{\prime}$ and $h$ are not self-dual. Here ${\rm
dist}(g^{\prime},\widetilde{g^{\prime}})=8$ and ${\rm
dist}(h,\widetilde{h})=8$.

##  3 Distribution of Rayleigh quotients of Dillon’s functions

Partial spread class of bent functions, denoted by
${\mathcal{P}}{\mathcal{S}}$, was constructed by Dillon [4, 5]. Dillon also
constructed an important subclass of ${\mathcal{P}}{\mathcal{S}}$ referred as
${\mathcal{P}}{\mathcal{S}}_{ap}$, where “$ap$” stands for an affine plane.

###### Definition 7

Let $x,y\in F_{2^{k}}$, where $k=\frac{n}{2}$. The class denoted by
$\mathcal{PS}_{ap}$ in [2] consists function of the type $f(x,y)=g(x/y)$ with
the convention that $x/y=0$ if $y=0$, and where $g$ is balanced Boolean
function and $g(0)=0$.

###### Theorem 3.1

[2, Theorem 4.5] A Boolean function $f$ as defined above is self-dual bent if
$g$ satisfies $g(1)=0$, and, for all $u\neq 0$ the relation $g(u)=g(1/u)$.
There are exactly $\binom{2^{\frac{n}{2}-1}-1}{2^{\frac{n}{2}-2}}$ such
functions.

Danielsen, Parker, and Solé [6] considered the Rayleigh quotient of Dillon’s
functions and obtained an expression in terms of character sums. The character
sum for these functions is defined in [11] as

$K_{g}\mathrel{\mathop{\mathchar
58\relax}}=\displaystyle\sum_{u}(-1)^{g(u)+g(1/u)}.$ (1)

If $g=Tr_{1}^{k}$ then $K_{g}$ is Kloosterman sum.

###### Theorem 3.2

[6, Theorem7] Let $f$ be a bent function constructed from a Dillon $g$ as
above, then its $N_{f}=2^{k}+(2^{k-1})K_{g}.$

In this section, we derive the expression of the distance between partial
spread bent functions and their duals. In the rest of the paper, we consider
$n=2k\geq 4$ and $f\in\mathfrak{B}_{n}$ be a bent function with its dual
denoted by $\widetilde{f}$.

###  3.1 Distances between ${\mathcal{P}}{\mathcal{S}}^{+}$ bents and their
duals

Let $f\in\mathfrak{B}_{n}$ be any ${\mathcal{P}}{\mathcal{S}}^{+}$ class bent
function such that ${\rm supp}(f)=\cup_{i=1}^{2^{k-1}+1}E_{i}$, where
$E_{i}$’s are “disjoint” $k$-dimensional subspaces of ${\mathbb{F}}_{2}^{n}$.
If the dual of $f$ is $\widetilde{f}$, then ${\rm
supp}(\widetilde{f})=\cup_{i=1}^{2^{k-1}+1}E_{i}^{\perp}$. It is also clear
that $f({\bf 0})=\widetilde{f}({\bf 0})=1$.

###### Theorem 3.3

Let $f\in\mathfrak{B}_{n}$, $n=2k\geq 4$, be a
${\mathcal{P}}{\mathcal{S}}^{+}$ class bent function with its dual
$\widetilde{f}$ and ${\rm supp}(f)=\cup_{i=1}^{2^{k-1}+1}E_{i}$, where
$E_{i}$’s are defined as above. Then

${\rm
dist}(f,\widetilde{f})=2^{n}+2^{k}-2-2\displaystyle\sum_{i=1}^{2^{k-1}+1}|\\{{\bf
x}\in E_{i}^{\perp}\setminus\\{{\bf 0}\\}\mathrel{\mathop{\mathchar
58\relax}}f({\bf x})=1\\}|.$

###### Proof

The support of $f$ can be written as ${\rm supp}(f)=({\rm
supp}(f)\setminus\\{{\bf 0}\\})\cup\\{{\bf 0}\\}$, where ${\rm
supp}(f)\setminus\\{{\bf 0}\\}=\cup_{i=1}^{2^{k-1}+1}E_{i}\setminus\\{{\bf
0}\\}=\cup_{i=1}^{2^{k-1}+1}(E_{i}\setminus\\{{\bf 0}\\})$.
It is clear that $W_{f}({\bf 0})=\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf x})}=\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}(1-2f({\bf
x}))=2^{n}-2((2^{k-1}+1)(2^{k}-1)+1)=-2^{k}$. From Proposition 3, we have

$\displaystyle{\rm dist}(f,\widetilde{f})$
$\displaystyle=2^{n-1}-2^{k-1}(-1)^{f({\bf
0})}+\frac{1}{2^{k}}\displaystyle\sum_{{\bf a}\in{\rm supp}(f)}W_{f}({\bf a})$
$\displaystyle=2^{n-1}-2^{k-1}(-1)^{f({\bf
0})}+\frac{1}{2^{k}}\displaystyle\sum_{{\bf a}\in{\rm supp}(f)\setminus\\{{\bf
0}\\}}W_{f}({\bf a})+\frac{1}{2^{k}}W_{f}({\bf 0})$
$\displaystyle=2^{n-1}+2^{k-1}+\frac{1}{2^{k}}\displaystyle\sum_{i=1}^{2^{k-1}+1}\displaystyle\sum_{{\bf
a}\in E_{i}\setminus\\{{\bf 0}\\}}W_{f}({\bf a})+\frac{1}{2^{k}}(-2^{k})$
$\displaystyle=2^{n-1}+2^{k-1}+\frac{1}{2^{k}}\displaystyle\sum_{i=1}^{2^{k-1}+1}\displaystyle\sum_{{\bf
a}\in E_{i}\setminus\\{{\bf 0}\\}}\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf x})\oplus{\bf a}\cdot{\bf x}}-1$
$\displaystyle=2^{n-1}+2^{k-1}+\frac{1}{2^{k}}\displaystyle\sum_{i=1}^{2^{k-1}+1}\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf x})}\displaystyle\sum_{{\bf a}\in
E_{i}\setminus\\{{\bf 0}\\}}(-1)^{{\bf a}\cdot{\bf x}}-1$
$\displaystyle=2^{n-1}+2^{k-1}+\frac{1}{2^{k}}\displaystyle\sum_{i=1}^{2^{k-1}+1}\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf x})}\bigg{(}\displaystyle\sum_{{\bf
a}\in E_{i}}(-1)^{{\bf a}\cdot{\bf x}}-1\bigg{)}-1$
$\displaystyle=2^{n-1}+2^{k-1}+\displaystyle\sum_{i=1}^{2^{k-1}+1}\displaystyle\sum_{{\bf
x}\in E_{i}^{\perp}}(-1)^{f({\bf x})}+2^{k-1}+1-1$
$\displaystyle=2^{n-1}+2^{k}+\displaystyle\sum_{i=1}^{2^{k-1}+1}\displaystyle\sum_{{\bf
x}\in E_{i}^{\perp}}(1-2f({\bf x}))$
$\displaystyle=2^{n-1}+2^{k}+(2^{n-1}+2^{k})-2\displaystyle\sum_{i=1}^{2^{k-1}+1}|\\{{\bf
x}\in E_{i}^{\perp}\mathrel{\mathop{\mathchar 58\relax}}f({\bf x})=1\\}|$
$\displaystyle=2^{n}+2^{k+1}-2\displaystyle\sum_{i=1}^{2^{k-1}+1}|\\{{\bf
x}\in E_{i}^{\perp}\mathrel{\mathop{\mathchar 58\relax}}f({\bf x})=1\\}|$
$\displaystyle=2^{n}+2^{k+1}-2\displaystyle\sum_{i=1}^{2^{k-1}+1}(1+|\\{{\bf
x}\in E_{i}^{\perp}\setminus\\{{\bf 0}\\}\mathrel{\mathop{\mathchar
58\relax}}f({\bf x})=1\\}|)$
$\displaystyle=2^{n}+2^{k}-2-2\displaystyle\sum_{i=1}^{2^{k-1}+1}|\\{{\bf
x}\in E_{i}^{\perp}\setminus\\{{\bf 0}\\}\mathrel{\mathop{\mathchar
58\relax}}f({\bf x})=1\\}|.$

###### Corollary 2

Let $f\in\mathfrak{B}_{n}$, $n=2k\geq 4$, be a $\mathcal{PS}^{+}$ bent
function and $\widetilde{f}$ be dual of $f$. Then ${\rm
dist}(f,\widetilde{f})\leq 2^{n}-2^{k}$.

###### Proof

Let $f\in\mathfrak{B}_{n}$, $n=2k\geq 4$, be a $\mathcal{PS}^{+}$ bent
function such that ${\rm supp}(f)=\cup_{i=1}^{2^{k-1}+1}E_{i}$, where
$E_{i}$’s are “disjoint” $k$-dimensional subspaces of ${\mathbb{F}}_{2}^{n}$.
If $\widetilde{f}$ is the dual of $f$, then $|{\rm
supp}(\widetilde{f})|=2^{n-1}+2^{k-1}=(2^{n-1}-2^{k-1})+2^{k}$. So, there
exist at least $2^{k}-1$ nonzero elements of ${\bf x}\in{\rm
supp}(\widetilde{f})$, such that $f({\bf x})=1$ as $|{\rm
supp}(f)|=2^{n-1}+2^{k-1}$. Thus, $\displaystyle\sum_{i=1}^{2^{k-1}+1}|\\{{\bf
x}\in E_{i}^{\perp}\setminus\\{{\bf 0}\\}\mathrel{\mathop{\mathchar
58\relax}}f({\bf x})=1\\}|\geq 2^{k}-1$, and from Corollary 3.3, we have ${\rm
dist}(f,\widetilde{f})\leq 2^{n}+2^{k}-2-2(2^{k}-1)=2^{n}-2^{k}$.

For example let us consider $n=4$ and the $2$-dimensional “distinct” subspaces
of ${\mathbb{F}}_{2}^{4}$

$\displaystyle E_{1}$
$\displaystyle=\\{0000,0001,0100,0101\\},~{}E_{2}=\\{0000,0010,1000,1010\\}$
$\displaystyle E_{3}$
$\displaystyle=\\{0000,0011,1101,1110\\},~{}E_{4}=\\{0000,0110,1001,1111\\}$
$\displaystyle E_{5}$ $\displaystyle=\\{0000,0111,1011,1100\\}.$

It is clear that $E_{1}^{\perp}=E_{2}$, $E_{3}^{\perp}=E_{5}$ and
$E_{4}^{\perp}=E_{4}$. Suppose $g_{1},g_{2},g_{3}\in\mathfrak{B}_{4}$ are
$\mathcal{PS}^{+}$ bent functions such that ${\rm supp}(g_{1})=E_{1}\cup
E_{2}\cup E_{4}$, ${\rm supp}(g_{2})=E_{1}\cup E_{2}\cup E_{3}$, and ${\rm
supp}(g_{3})=E_{1}\cup E_{3}\cup E_{4}$. Then $g_{1}$ is self-dual bent, i.e.,
${\rm dist}(g_{1},\widetilde{g_{1}})=0$, and

${\rm dist}(g_{2},\widetilde{g_{2}})=6,~{}{\rm
dist}(g_{3},\widetilde{g_{3}})=12.$

###  3.2 Distances between ${\mathcal{P}}{\mathcal{S}}^{-}$ bents and their
duals

Let $f\in\mathfrak{B}_{n}$ be a bent function in
${\mathcal{P}}{\mathcal{S}}^{-}$ and $E_{i}$’s, $i=1,\ldots,2^{k-1}$ are
mutually “disjoint” $k$-dimensional subspaces of ${\mathbb{F}}_{2}^{n}$ such
that ${\rm supp}(f)=\bigcup_{i=1}^{2^{k-1}}E_{i}\setminus\\{{\bf 0}\\}$. It is
straightforward that $f$ is self-dual if and only if

$\bigcup_{i=1}^{2^{k-1}}E_{i}=\bigcup_{i=1}^{2^{k-1}}E_{i}^{\perp}.$ (2)

But it is interesting to identify all possible distances between a bent
function in ${\mathcal{P}}{\mathcal{S}}^{-}$ and its dual. We provide a
technical result below.

###### Theorem 3.4

Let $n=2k\geq 4$ and $f\in\mathfrak{B}_{n}$ be a $\mathcal{PS}^{-}$ bent
function such that ${\rm supp}(f)=\cup_{i=1}^{2^{k-1}}E_{i}\setminus\\{{\bf
0}\\}$, where $E_{i}$’s, $1\leq i\leq 2^{k-1}$, are mutually “disjoint”
$k$-dimensional subspaces of ${\mathbb{F}}_{2}^{n}$. Then

${\rm
dist}(f,\widetilde{f})=2^{n}-2^{k}-2\displaystyle\sum_{i=1}^{2^{k-1}}|\\{{\bf
x}\in E_{i}^{\perp}\mathrel{\mathop{\mathchar 58\relax}}f({\bf x})=1\\}|.$

###### Proof

For any $i\in\\{1,2,\ldots,2^{k-1}\\}$ we have

$\displaystyle\sum_{{\bf x}\in E_{i}^{\perp}}(-1)^{f({\bf x})}=2^{k}-2|\\{{\bf
x}\in E_{i}^{\perp}\mathrel{\mathop{\mathchar 58\relax}}f({\bf x})=1\\}|,$

and ${\rm supp}(f)=\cup_{i=1}^{2^{k-1}}E_{i}\setminus\\{{\bf
0}\\}=\cup_{i=1}^{2^{k-1}}E_{i}^{*}$, where $E_{i}^{*}=E_{i}\setminus\\{{\bf
0}\\}$. From Proposition 3, we have

$\displaystyle{\rm dist}(f,\widetilde{f})$
$\displaystyle=2^{n-1}-2^{k-1}(-1)^{f({\bf
0})}+\frac{1}{2^{k}}\displaystyle\sum_{{\bf u}\in{\rm supp}(f)}W_{f}({\bf u})$
$\displaystyle=2^{n-1}-2^{k-1}+\frac{1}{2^{k}}\displaystyle\sum_{i=1}^{2^{k-1}}\displaystyle\sum_{{\bf
u}\in E_{i}^{*}}\displaystyle\sum_{{\bf x}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf
x})\oplus{\bf u}\cdot{\bf x}}$
$\displaystyle=2^{n-1}-2^{k-1}+\frac{1}{2^{k}}\displaystyle\sum_{i=1}^{2^{k-1}}\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf x})}\displaystyle\sum_{{\bf u}\in
E_{i}^{*}}(-1)^{{\bf u}\cdot{\bf x}}$
$\displaystyle=2^{n-1}-2^{k-1}+\frac{1}{2^{k}}\displaystyle\sum_{i=1}^{2^{k-1}}\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf x})}\left(\displaystyle\sum_{{\bf u}\in
E_{i}}(-1)^{{\bf u}\cdot{\bf x}}-1\right)$
$\displaystyle=2^{n-1}-2^{k-1}+\displaystyle\sum_{i=1}^{2^{k-1}}\displaystyle\sum_{{\bf
x}\in E_{i}^{\perp}}(-1)^{f({\bf
x})}-\frac{1}{2^{k}}\displaystyle\sum_{i=1}^{2^{k-1}}\displaystyle\sum_{{\bf
x}\in{\mathbb{F}}_{2}^{n}}(-1)^{f({\bf x})}$
$\displaystyle=2^{n-1}-2^{k-1}+2^{n-1}-2\displaystyle\sum_{i=1}^{2^{k-1}}|\\{{\bf
x}\in E_{i}^{\perp}\mathrel{\mathop{\mathchar 58\relax}}f({\bf
x})=1\\}|-2^{k-1}$
$\displaystyle=2^{n}-2^{k}-2\displaystyle\sum_{i=1}^{2^{k-1}}|\\{{\bf x}\in
E_{i}^{\perp}\mathrel{\mathop{\mathchar 58\relax}}f({\bf x})=1\\}|.$

###### Corollary 3

Let $f\in\mathfrak{B}_{n}$, $n=2k\geq 4$, be a $\mathcal{PS}^{-}$ bent
function with its dual $\widetilde{f}$. Then ${\rm dist}(f,\widetilde{f})\leq
2^{n}-2^{k}$.

###### Proof

We know that $|\\{{\bf x}\in E_{i}^{\perp}\mathrel{\mathop{\mathchar
58\relax}}f({\bf x})=1\\}|\geq 0$ for all $i=1,2,\ldots,2^{k-1}$. Then from
Theorem 3.4, we get the result.

For example let $E_{i}$, $1\leq i\leq 5$, are subspaces of
${\mathbb{F}}_{2}^{4}$, defined as above. Suppose $f_{1},f_{2},f_{3}$ are
three $\mathcal{PS}^{-}$ bent functions in $4$ variables such that ${\rm
supp}(f_{1})=E_{1}\cup E_{2}\setminus\\{{\bf 0}\\}$, ${\rm
supp}(f_{2})=E_{3}\cup E_{4}\setminus\\{{\bf 0}\\}$ and ${\rm
supp}(f_{3})=E_{1}\cup E_{3}\setminus\\{{\bf 0}\\}$. Then $f_{1}$ is self-dual
bent, i.e., ${\rm dist}(f_{1},\widetilde{f_{1}})=0$, and

${\rm dist}(f_{2},\widetilde{f_{2}})=6,~{}{\rm
dist}(f_{3},\widetilde{f_{3}})=12.$

####  3.2.1 Distance between $\mathcal{PS}_{ap}$ bents and their duals

From corollaries 2 and 3, we have the distance between an $n$–variable, $n\geq
4$, bent function in the $\mathcal{PS}$ class and it’s dual, is even and
bounded above by $2^{n}-2^{\frac{n}{2}}$. Dillon [4, 5] constructed a subclass
of $\mathcal{PS}$ that is known as $\mathcal{PS}_{ap}$ class. The subscript
“$ap$” stands for “affine plane.”

In this section, we obtained an explicit distribution of Rayleigh quotients
for the functions in this class. We first go through the construction of
Dillon’s function by using Desarguessian projective planes.

Let us identify ${\mathbb{F}}_{2}^{n}$ with
${\mathbb{F}}_{2^{k}}\times{\mathbb{F}}_{2^{k}}$ where $n=2k$. For each
$a\in{\mathbb{F}}_{2^{k}}$, define $E_{a}=\\{(x,xa)\mathrel{\mathop{\mathchar
58\relax}}x\in{\mathbb{F}}_{2^{k}}\\}$. It is evident that, for each
$a\in{\mathbb{F}}_{2^{k}}$, $E_{a}$ is a $k$-dimensional subspace of
${\mathbb{F}}_{2^{k}}\times{\mathbb{F}}_{2^{k}}$, and $E_{a}\cap E_{b}=\\{{\bf
0}\\}$ for all $a,b\in{\mathbb{F}}_{2^{k}}$ such that $a\neq b$. Let
$E_{\infty}=\\{(0,y)\mathrel{\mathop{\mathchar
58\relax}}y\in{\mathbb{F}}_{2^{k}}\\}$. Note that $E_{\infty}\cap
E_{a}=\\{{\bf 0}\\}$, for all $a\in{\mathbb{F}}_{2^{k}}$.

The Desarguesian spread in ${\mathbb{F}}_{2^{k}}\times{\mathbb{F}}_{2^{k}}$ is
the collection

$\mathfrak{D}=\\{E_{a}\mathrel{\mathop{\mathchar
58\relax}}a\in{\mathbb{F}}_{2^{k}}\\}\cup\\{E_{\infty}\\}.$ (3)

For any $\mathfrak{C}\subseteq\mathfrak{D}$ and
$\mathinner{\\!\left\lvert\mathfrak{C}\right\rvert}=2^{k-1}$, a function of
the form

$f({\bf x})=\displaystyle\sum_{E\in\mathfrak{C}}{\bf 1}_{E}({\bf
x})-2^{k-1}{\bf 1}_{\\{{\bf 0}\\}}({\bf x}),$ (4)

is a bent function in $\mathcal{PS}^{-}$. All such bent functions form a
subclass denoted by $\mathcal{PS}_{ap}$. The finite field
${\mathbb{F}}_{2^{k}}$, considered as a vector space over ${\mathbb{F}}_{2}$,
is endowed with the inner product $(x,y)\mapsto{\rm Tr}_{1}^{k}(xy)$. This
inner product can be extended to an inner product
$\braket{\cdot,\cdot}\mathrel{\mathop{\mathchar
58\relax}}({\mathbb{F}}_{2^{k}}\times{\mathbb{F}}_{2^{k}})\times({\mathbb{F}}_{2^{k}}\times{\mathbb{F}}_{2^{k}})\rightarrow{\mathbb{F}}_{2}$
defined by

$\displaystyle\braket{(x,y),(x^{\prime},y^{\prime})}={\rm
Tr}_{1}^{k}(xx^{\prime})+{\rm Tr}_{1}^{k}(yy^{\prime}).$

We observe the following result of Desarguesian spread in
${\mathbb{F}}_{2^{k}}\times{\mathbb{F}}_{2^{k}}$. We can partition the
$\mathcal{PS}_{ap}$ bent functions which are constructed by using Desarguesian
spread. Let $\mathcal{PS}_{ap}^{ds}(2k)$ be the set of all bent function in
$2k$ variables in $\mathcal{PS}_{ap}$ constructed by using Desarguesian spread
$\mathfrak{D}$ defined in (3). Let us define

$cl(i)=\\{f\in\mathcal{PS}_{ap}^{ds}(2k)\mathrel{\mathop{\mathchar
58\relax}}{\rm dist}(f,\widetilde{f})=(2^{k+1}-2)(2^{k-1}-i)\\},$

for all $i=0,1,\ldots,2^{k-1}$. Thus, all self-dual bent functions in
$\mathcal{PS}_{ap}^{ds}(2k)$ is $cl(2^{k-1})$. It is clear that $cl(i)\cap
cl(j)=\emptyset$ for all $0\leq i\neq j\leq 2^{k-1}$ and
$\mathcal{PS}_{ap}^{ds}(2k)=\cup_{i=0}^{2^{k-1}}cl(i)$.

###### Lemma 1

For any $E\in\mathfrak{D}$, its dual $E^{\perp}\in\mathfrak{D}$.

###### Proof

First, consider the case when $E=E_{a}$ for some
$a\in{\mathbb{F}}_{2^{k}}^{*}$. Let $(y,z)\in E_{a}^{\perp}$, so that

$\braket{(y,z),(x,xa)}=0,$

for all $x\in{\mathbb{F}}_{2^{k}}$. That is

${\rm Tr}_{1}^{k}(yx)+{\rm Tr}_{1}^{k}(zxa)={\rm Tr}_{1}^{k}((y+za)x)=0,$

for all $x\in{\mathbb{F}}_{2^{k}}$.
This implies $y+za=0$, that is, $z=ya^{-1}$. So

$E_{a}^{\perp}=\\{(y,ya^{-1})\mathrel{\mathop{\mathchar
58\relax}}y\in{\mathbb{F}}_{2^{k}}\\}=E_{a^{-1}}\in\mathfrak{D}.$

We complete the proof by observing that $E_{0},E_{\infty}\in\mathfrak{D}$ are
mutually orthogonal.

The direct count for self-dual $\mathcal{PS}_{ap}$ is given in [2, Theorem
4.5]. But our next theorem characterizes self-dual $\mathcal{PS}_{ap}$ bent
functions along with their count. Our approach to this problem lets us count
the total number of self-dual $\mathcal{PS}_{ap}$ functions as well as obtain
the complete distribution of the Rayleigh quotients for functions in
$\mathcal{PS}_{ap}$.

###### Theorem 3.5

Let $\mathfrak{D}$ be the Desarguesian spread defined in (3). A
$\mathcal{PS}_{ap}$ class of bent function $f\mathrel{\mathop{\mathchar
58\relax}}{\mathbb{F}}_{2^{k}}\times{\mathbb{F}}_{2^{k}}\rightarrow{\mathbb{F}}_{2}$
defined in (4) is self-dual if and only if the following conditions are
satisfied

  1. 1.

$E_{1}\notin\mathfrak{C}$;

  2. 2.

$\\{E_{0},E_{\infty}\\}\cap\mathfrak{C}\in\\{\emptyset,\\{E_{0},E_{\infty}\\}\\}$;

  3. 3.

For all $a\in{\mathbb{F}}_{2^{k}}^{*}\setminus\\{1\\}$, $E_{a}\in\mathfrak{C}$
if and only if $E_{a^{-1}}\in\mathfrak{C}$.

The number of self-dual $\mathcal{PS}_{ap}$-bent functions is
${2^{k-1}-1}\choose 2^{k-2}$.

###### Proof

The dual of $f$ defined in (4) is

$\widetilde{f}({\bf
x})=\displaystyle\sum_{E\in\mathfrak{C}}\phi_{E^{\perp}}({\bf x})-2^{k-1}{\bf
1}_{\\{{\bf 0}\\}}({\bf x}).$

Let $\mathfrak{I}=\\{E_{a}\mathrel{\mathop{\mathchar
58\relax}}a\in{\mathbb{F}}_{2^{k}}\cup\\{\infty\\},a\neq 1\\}$. For $f$ to be
a self-dual bent function
$\mathinner{\\!\left\lvert\mathfrak{C}\cap\mathfrak{I}\right\rvert}$ is even.
This is because $E_{a}\in\mathfrak{C}$ if and only if
$E_{a^{-1}}\in\mathfrak{C}$, where
$a\in{\mathbb{F}}_{2^{k}}^{*}\setminus\\{1\\}$, and $E_{0}\in\mathfrak{C}$ if
and only if $E_{\infty}\in\mathfrak{C}$. So the subspaces in $\mathfrak{I}$
appear or do not appear in pairs. If $E_{1}\in\mathfrak{C}$, then
$\mathinner{\\!\left\lvert\mathfrak{I}\right\rvert}=2^{k-1}-1$. This is not
possible.

If $f$ is self-dual either both $E_{0},E_{\infty}\in\mathfrak{C}$ or
$E_{0},E_{\infty}\notin\mathfrak{C}$. Further, for all
$a\in{\mathbb{F}}_{2^{k}}^{*}\setminus\\{1\\}$, $E_{a}\in\mathfrak{C}$ if and
only if $E_{a^{-1}}\in\mathfrak{C}$. Therefore, the three conditions are
satisfied. It is not difficult to check that these conditions are sufficient
for self-duality.

If $\\{E_{0},E_{\infty}\\}\subseteq\mathfrak{C}$, then the remaining subspaces
appear in pairs from the set
$\mathfrak{D}\setminus\\{E_{0},E_{1},E_{\infty}\\}$. The number of elements
$\mathinner{\\!\left\lvert\mathfrak{D}\setminus\\{E_{0},E_{1},E_{\infty}\\}\right\rvert}=2^{k}-2$.
Therefore, the number of subspace pairs that may be selected from
$\mathfrak{D}\setminus\\{E_{0},E_{1},E_{\infty}\\}$ is $2^{k-1}-1$. To
construct $\mathfrak{C}$ we need $2^{k-2}-1$ pair of subspaces, since
$\\{E_{0},E_{\infty}\\}\subseteq\mathfrak{C}$. This can be done in
${2^{k-1}-1}\choose{2^{k-2}-1}$ ways.

In case $\\{E_{0},E_{\infty}\\}\cap\mathfrak{C}=\\{\emptyset\\}$, we have to
choose all $2^{k-2}$ pairs in $\mathfrak{C}$ from
$\mathfrak{D}\setminus\\{E_{0},E_{1},E_{\infty}\\}$. This can be done in
${2^{k-1}-1}\choose{2^{k-2}}$. Thus, the total number of self-dual
$\mathcal{PS}_{ap}$-bent functions is

${{2^{k-1}-1}\choose{2^{k-2}-1}}+{{2^{k-1}-1}\choose{2^{k-2}}}={{2^{k-1}}\choose{2^{k-2}}}$

We can calculate the distribution of the distance between a
$\mathcal{PS}_{ap}$ bent function and it’s dual when we consider the
Desarguesian spread in ${\mathbb{F}}_{2^{k}}\times{\mathbb{F}}_{2^{k}}$
defined in (3). Let
$\mathfrak{C}^{\perp}=\\{E^{\perp}\mathrel{\mathop{\mathchar
58\relax}}E\in\mathfrak{C}\\}$ where $\mathfrak{C}\subseteq\mathfrak{D}$.

###### Theorem 3.6

Let $\mathfrak{D}$ be the Desarguesian spread defined in (3). A
$\mathcal{PS}_{ap}$ bent function $f\mathrel{\mathop{\mathchar
58\relax}}{\mathbb{F}}_{2^{k}}\times{\mathbb{F}}_{2^{k}}\rightarrow{\mathbb{F}}_{2}$
defined in (4) with its dual $\widetilde{f}$ of the form $\widetilde{f}({\bf
x})=\displaystyle\sum_{E\in\mathfrak{C}^{\perp}}{\bf 1}_{E}({\bf
x})-2^{k-1}{\bf 1}_{\\{{\bf 0}\\}}({\bf x})$.

  1. 1.

If $E_{1}\notin\mathfrak{C}$ and $|\mathfrak{C}\cap\mathfrak{C}^{\perp}|=i$,
$0\leq i\leq 2^{k-1}$, then $N_{f}=2^{n}-4(2^{k-1}-i)(2^{k}-1)$.

  2. 2.

If $E_{1}\in\mathfrak{C}$ and $|\mathfrak{C}\cap\mathfrak{C}^{\perp}|=1+j$,
$0\leq j\leq 2^{k-1}-1$, then $N_{f}=2^{n}-4(2^{k-1}-j-1)(2^{k}-1)$.

###### Proof

Let $E_{1}\notin\mathfrak{C}$ and
$\mathinner{\\!\left\lvert\mathfrak{C}\cap\mathfrak{C}^{\perp}\right\rvert}=i$
where $i\in\\{0,1,\cdots,2^{k-1}\\}$. The Hamming distance between $f$ and
$\widetilde{f}$ is ${\rm dist}(f,\widetilde{f})=2(2^{k-1}-i)(2^{k}-1)$.
Therefore

$N_{f}=2^{n}-4(2^{k-1}-i)(2^{k}-1).$

Let $E_{1}\in\mathfrak{C}$ and
$\mathinner{\\!\left\lvert\mathfrak{C}\cap\mathfrak{C}^{\perp}\right\rvert}=1+j$
where $j\in\\{0,1,\cdots,2^{k-1}-1\\}$. The Hamming distance between $f$ and
$\widetilde{f}$ is ${\rm dist}(f,\widetilde{f})=2(2^{k-1}-j-1)(2^{k}-1)$.
Therefore

$N_{f}=2^{n}-4(2^{k-1}-j-1)(2^{k}-1).$

From the above theorem, we get the explicit expression for $N_{f}$ for the
Dillon function of $\mathcal{PS}_{ap}$ class. The expression of Rayleigh
quotients on $\mathcal{PS}_{ap}$ in Danielsen, Parker, and Solé [6, Theorem7],
also mentioned above is of the form of character sum which is not in explicit
form. From above we have the following observations:

  * •

A function $f$ in $\mathcal{PS}_{ap}$ in $2k$–varibles, the $n_{f}=2^{n}$, if
$i=2^{k-1}$ or $j=2^{k-1}-1$ i.e. for $i=2^{k-1}$ or $j=2^{k-1}-1$, the
function $f$ is self-dual function.

  * •

The distance between a $\mathcal{PS}_{ap}$ bent function and it’s dual in $2k$
variables defined by Desarguesian spread is multiple of $2^{k+1}-2$. For
example, if $k=2$, the only possible such distances are $0,6$ and $12$. For
$k=3$, the only possible such distances are $0,14,28,42$ and $56$.

###### Proposition 4

There is no anti-self-dual bent function in $\mathcal{PS}_{ap}.$

###### Proof

We will prove this by the method of contradiction. Let $n=2k$ and $n\geq 4$.
Let $f\in\mathcal{PS}_{ap}$ be a $n$-variable anti-self-dual bent function
such that $E_{1}\notin\mathfrak{C}$ and
$|\mathfrak{C}\cap\mathfrak{C}^{\perp}|=i$, $0\leq i\leq 2^{k-1}$, then

$N_{f}=2^{n}-4(2^{k-1}-i)(2^{k}-1).$

Thus, $f$ is a anti-self-dual function $\Rightarrow N_{f}=-2^{n}$, for some
$i,~{}0\leq i\leq 2^{k-1}$.

$\displaystyle\Rightarrow$ $\displaystyle 2^{n}-4(2^{k-1}-i)(2^{k}-1)=-2^{n}$
$\displaystyle\Rightarrow$ $\displaystyle 2^{n+1}=4(2^{k-1}-i)(2^{k}-1)$
$\displaystyle\Rightarrow$ $\displaystyle 2^{n-1}=(2^{k-1}-i)(2^{k}-1)$

But this is a contradiction, since $n\geq 4\Rightarrow k\geq
2\Rightarrow(2^{k}-1)>1$, so, the right-hand side product has an odd factor
other than $1$ but the left-hand side has no such factor.
Similarly, we can show that the same when $E_{1}\in\mathfrak{C}$.
Hence, for any function $f\in\mathcal{PS}_{ap},N_{f}\neq-2^{n}$.

For small $n\geq 4$, and $f\in\mathcal{PS}_{ap}$, we have computed the all
possible values of $N_{f}$ and ${\rm dist}(f,\widetilde{f})$ which is
summarized in the following table:

$n$ |  $N_{f}$ |  ${\rm dist}(f,\widetilde{f})$
---|---|---
4 |  $-8$, 4, 16 |  0, 6, 12
6 |  $-48$, $-20$, 8, 36, 64 |  0, 14, 28, 42, 56
8 |  $-224$, $-164$, $-104$, $-44$, 16, 76, 136, 196, 256 |  0, 30, 60, 90, 120, 150, 180, 210, 240
10 |  $-960$, $-836$, $-712$, $-588$, $-464$, $-340$, $-216$, $-92$, 32, 156, 280, 404, 528, 652, 776, 900, 1024 |  0, 62, 124, 186, 248, 310, 372, 434, 496, 558, 620, 682, 744, 806, 868, 930, 992
12 |  $-3968$, $-3716$, $-3464$, $-3212$, $-2960$, $-2708$, $-2456$, $-2204$, $-1952$, $-1700$, $-1448$, $-1196$, $-944$, $-692$, $-440$, $-188$, 64, 316, 568, 820, 1072, 1324, 1576, 1828, 2080, 2332, 2584, 2836, 3088, 3340, 3592, 3844, 4096 |  0, 126, 252, 378, 504, 630, 756, 882, 1008, 1134, 1260, 1386, 1512, 1638, 1764, 1890, 2016, 2142, 2268, 2394, 2520, 2646, 2772, 2898, 3024, 3150, 3276, 3402, 3528, 3654, 3780, 3906, 4032
14 |  $-16128$, $-15620$, $-15112$, $-14604$, $-14096$, $-13588$, $-13080$, $-12572$, $-12064$, $-11556$, $-11048$, $-10540$, $-10032$, $-9524$, $-9016$, $-8508$, $-8000$, $-7492$, $-6984$, $-6476$, $-5968$, $-5460$, $-4952$, $-4444$, $-3936$, $-3428$, $-2920$, $-2412$, $-1904$, $-1396$, $-888$, $-380$, 128, 636, 1144, 1652, 2160, 2668, 3176, 3684, 4192, 4700, 5208, 5716, 6224, 6732, 7240, 7748, 8256, 8764, 9272, 9780, 10288, 10796, 11304, 11812, 12320, 12828, 13336, 13844, 14352, 14860, 15368, 15876, 16384 |  0, 254, 508, 762, 1016, 1270, 1524, 1778, 2032, 2286, 2540, 2794, 3048, 3302, 3556, 3810, 4064, 4318, 4572, 4826, 5080, 5334, 5588, 5842, 6096, 6350, 6604, 6858, 7112, 7366, 7620, 7874, 8128, 8382, 8636, 8890, 9144, 9398, 9652, 9906, 10160, 10414, 10668, 10922, 11176, 11430, 11684, 11938, 12192, 12446, 12700, 12954, 13208, 13462, 13716, 13970, 14224, 14478, 14732, 14986, 15240, 15494, 15748, 16002, 16256

##  4 Conclusion

To the best of our knowledge, it is an open problem to check the distribution
of the Rayleigh quotient of bent functions in $\mathcal{PS}$. Our results
above demonstrate that we could approach this problem by checking different
spreads and partial spreads over finite fields.

Acknowledgments.

The work of Aleksandr Kutsenko is supported by the Mathematical Center in
Akademgorodok under agreement No. 075-15-2022-282 with the Ministry of Science
and Higher Education of the Russian Federation. The work of Mansi is supported
by a fellowship from CSIR, Govt. of India (09/143(1028)/2020-EMR-I).

## References

  * [1] Claude Carlet. Boolean Functions for Cryptography and Coding Theory. Cambridge University Press (2021), https://doi.org/10.1017/9781108606806
  * [2] Claude Carlet, Lars Eirik Danielsen, Matthew G. Parker and Patrick Solé. Self-dual bent functions. International Journal of Information and Coding Theory 1(4) 384–399 (2010).
  * [3] Thomas Cusick and Pantelimon Stănică. Cryptographic Boolean functions and Applications. 2nd Edition. Elsevier, 2017. isbn: 9780128111291.
  * [4] J. F. Dillon. A survey of bent function. NSA Technical Journal Special Issue (1972), 191–217.
  * [5] J. F. Dillon. Elementary Hadamard difference set. PhD Dissertation, University of Maryland, College Park (1974).
  * [6] Lars Eirik Danielsen, Matthew G. Parker and Patrick Solé. The Rayleigh Quotient of Bent Function. IMA International Conference, Cryptography and Coding 2009, LNCS 5921 418–432 (2009).
  * [7] Nikolay Kolomeec. The graph of minimal distances of bent functions and its properties. Designs, Codes and Cryptography 85 395–410 (2017).
  * [8] Sihem Mesnager. Bent Functions: Fundamentals and Results Springer (2016), https://doi.org/10.1007/978-3-319-32595-8
  * [9] Peter Savický. On the Bent Boolean Functions That are Symmetric. European Journal of Combinatorics 15(4) 407–410 (1994).
  * [10] Natalia Tokareva. Bent Functions: Results and Applications to Cryptography. Academic Press (2015), https://doi.org/10.1016/C2014-0-02922-X
  * [11] Hans Dobbertin and Gregor Leander. Bent functions embedded into the recursive framework of Z–bent functions. Designs, Codes and Cryptography 49 3–22 (2008).
  * [12] Josep Rifà and Victor A. Zinoviev. On two families of binary quadratic bent functions. arXiv:1211.5257 [cs.IT], https://doi.org/10.48550/arXiv.1211.5257
  * [13] O. S. Rothaus. On bent functions. Journal of Combinatorial Theory, Series A 20(3) 300–305 (1976).