hofa.norm
=========

.. py:module:: hofa.norm

.. autoapi-nested-parse::

   This module contains the Numpy implementation for computing Gowers norms 
   on NumPy ndarrays

   Conventions
   -----------
   The following conventions are used for functions and data structures in this file:

   - Any finite abelian group :math:`Z` is isomorphic to :math:`Z/n_1Z \times Z/n_2Z \times ... \times Z/n_kZ`. Therefore, a function :math:`f: Z \to \mathbb{C}` is represented as a ``numpy.ndarray`` tensor with shape ``(n_1, n_2, ..., n_k)``.
     
   - A :math:`Z`-matrix, where :math:`Z = Z/n_1Z \times ... \times Z/n_kZ`, is represented as a ``numpy.ndarray`` tensor with shape 
     ``(n_1, ..., n_k, n_1, ..., n_k)``.



Functions
---------

.. autoapisummary::

   hofa.norm.u_pow
   hofa.norm.u


Module Contents
---------------

.. py:function:: u_pow(f: numpy.ndarray, k: int)

   The :math:`2^k` power of the Gowers :math:`U^k` norm of ``f``.

   :param f: a function.
   :type f: np.ndarray

   :param k: an integer representing the order of the Gowers norm.
   :type k: int

   :return: the :math:`2^k` power of the :math:`U^k` norm of ``f``.
   :rtype: float



.. py:function:: u(f: numpy.ndarray, k: int)

   The Gowers :math:`U^k` norm of ``f``.

   :param f: a function.
   :type f: np.ndarray

   :param k: an integer representing the order of the Gowers norm.
   :type k: int

   :return: the :math:`2^k` power of the :math:`U^k` norm of ``f``.
   :rtype: float


