parameters: (
      symmetries,
      features: int = None,
      mode="auto",
      shape=None,
      point_group=None,
      in_features=None,
      **kwargs,
  )
docstring: r"""A group convolution operation that is equivariant over a symmetry group.
  
      Acts on a feature map of symmetry poses of shape [num_samples, in_features, num_symm]
      and returns a feature  map of poses of shape [num_samples, features, num_symm]
  
      G-convolutions are described in ` Cohen et. {\it al} <http://proceedings.mlr.press/v48/cohenc16.pdf>`_
      and applied to quantum many-body problems in ` Roth et. {\it al} <https://arxiv.org/pdf/2104.05085.pdf>`_
  
      The G-convolution generalizes the convolution to non-commuting groups:
  
      .. math ::
  
          C^i_g = \sum_h {\bf W}_{g^{-1} h} \cdot {\bf f}_h
  
      Group elements that differ by the same symmetry operation (i.e. :math:`g = xh`
      and :math:`g' = xh'`) are connected by the same filter.
  
      This layer maps an input of shape `(..., in_features, n_sites)` to an
      output of shape `(..., features, num_symm)`.
  
      Args:
          symmetries: A specification of the symmetry group. Can be given by a
              nk.graph.Graph, an nk.utils.PermuationGroup, a list of irreducible
              representations or a product table.
          point_group: The point group, from which the space group is built.
              If symmetries is a graph the default point group is overwritten.
          mode: string "fft, irreps, matrix, auto" specifying whether to use a fast
              fourier transform over the translation group, a fourier transform using
              the irreducible representations or by constructing the full kernel matrix.
          shape: A tuple specifying the dimensions of the translation group.
          features: The number of output features. The full output shape
              is [n_batch,features,n_symm].
          use_bias: A bool specifying whether to add a bias to the output (default: True).
          mask: An optional array of shape [n_sites] consisting of ones and zeros
              that can be used to give the kernel a particular shape.
          dtype: The datatype of the weights. Defaults to a 64bit float.
          precision: Optional argument specifying numerical precision of the computation.
              see `jax.lax.Precision`for details.
          kernel_init: Optional kernel initialization function. Defaults to variance scaling.
          bias_init: Optional bias initialization function. Defaults to zero initialization.
docstring_summary: r"""A group convolution operation that is equivariant over a symmetry group.
docstring_tokens: r A group convolution operation that is equivariant over a symmetry group .
function: def DenseEquivariant(
      symmetries,
      features: int = None,
      mode="auto",
      shape=None,
      point_group=None,
      in_features=None,
      **kwargs,
  ):
      r"""A group convolution operation that is equivariant over a symmetry group.
  
      Acts on a feature map of symmetry poses of shape [num_samples, in_features, num_symm]
      and returns a feature  map of poses of shape [num_samples, features, num_symm]
  
      G-convolutions are described in ` Cohen et. {\it al} <http://proceedings.mlr.press/v48/cohenc16.pdf>`_
      and applied to quantum many-body problems in ` Roth et. {\it al} <https://arxiv.org/pdf/2104.05085.pdf>`_
  
      The G-convolution generalizes the convolution to non-commuting groups:
  
      .. math ::
  
          C^i_g = \sum_h {\bf W}_{g^{-1} h} \cdot {\bf f}_h
  
      Group elements that differ by the same symmetry operation (i.e. :math:`g = xh`
      and :math:`g' = xh'`) are connected by the same filter.
  
      This layer maps an input of shape `(..., in_features, n_sites)` to an
      output of shape `(..., features, num_symm)`.
  
      Args:
          symmetries: A specification of the symmetry group. Can be given by a
              nk.graph.Graph, an nk.utils.PermuationGroup, a list of irreducible
              representations or a product table.
          point_group: The point group, from which the space group is built.
              If symmetries is a graph the default point group is overwritten.
          mode: string "fft, irreps, matrix, auto" specifying whether to use a fast
              fourier transform over the translation group, a fourier transform using
              the irreducible representations or by constructing the full kernel matrix.
          shape: A tuple specifying the dimensions of the translation group.
          features: The number of output features. The full output shape
              is [n_batch,features,n_symm].
          use_bias: A bool specifying whether to add a bias to the output (default: True).
          mask: An optional array of shape [n_sites] consisting of ones and zeros
              that can be used to give the kernel a particular shape.
          dtype: The datatype of the weights. Defaults to a 64bit float.
          precision: Optional argument specifying numerical precision of the computation.
              see `jax.lax.Precision`for details.
          kernel_init: Optional kernel initialization function. Defaults to variance scaling.
          bias_init: Optional bias initialization function. Defaults to zero initialization.
      """
      # deprecate in_features
      if in_features is not None:
          warn_deprecation(
              (
                  "`in_features` is now automatically detected from the input and deprecated."
                  "Please remove it when calling `DenseEquivariant`."
              )
          )
      if "out_features" in kwargs:
          warn_deprecation(
              "`out_features` has been renamed to `features` and the old name is "
              "now deprecated. Please update your code."
          )
          if features is not None:
              raise ValueError(
                  "You must only specify `features`. `out_features` is deprecated."
              )
          features = kwargs.pop("out_features")
  
      if features is None:
          raise ValueError("`features` not specified (the number of output features).")
  
      kwargs["features"] = features
  
      if isinstance(symmetries, Lattice) and (
          point_group is not None or symmetries._point_group is not None
      ):
          shape = tuple(symmetries.extent)
          # With graph try to find point group, otherwise default to automorphisms
          sg = symmetries.space_group(point_group)
          if mode == "auto":
              mode = "fft"
      elif isinstance(symmetries, Graph):
          sg = symmetries.automorphisms()
          if mode == "auto":
              mode = "irreps"
          elif mode == "fft":
              raise ValueError(
                  "When requesting 'mode=fft' a valid point group must be specified"
                  "in order to construct the space group"
              )
      elif isinstance(symmetries, PermutationGroup):
          # If we get a group and default to irrep projection
          if mode == "auto":
              mode = "irreps"
          sg = symmetries
  
      elif isinstance(symmetries, Sequence):
          if mode not in ["irreps", "auto"]:
              raise ValueError("Specification of symmetries incompatible with mode")
          return DenseEquivariantIrrep(symmetries, **kwargs)
      else:
          if symmetries.ndim == 2 and symmetries.shape[0] == symmetries.shape[1]:
              if mode == "irreps":
                  raise ValueError("Specification of symmetries incompatible with mode")
              elif mode == "matrix":
                  return DenseEquivariantMatrix(symmetries, **kwargs)
              else:
                  if shape is None:
                      raise TypeError(
                          "When requesting `mode=fft`, the shape of the translation group must be specified. "
                          "Either supply the `shape` keyword argument or pass a `netket.graph.Graph` object to "
                          "the symmetries keyword argument."
                      )
                  else:
                      return DenseEquivariantFFT(symmetries, shape=shape, **kwargs)
          return ValueError("Invalid Specification of Symmetries")
  
      if mode == "fft":
          if shape is None:
              raise TypeError(
                  "When requesting `mode=fft`, the shape of the translation group must be specified. "
                  "Either supply the `shape` keyword argument or pass a `netket.graph.Graph` object to "
                  "the symmetries keyword argument."
              )
          else:
              return DenseEquivariantFFT(
                  HashableArray(sg.product_table), shape=shape, **kwargs
              )
      elif mode in ["irreps", "auto"]:
          irreps = tuple(HashableArray(irrep) for irrep in sg.irrep_matrices())
          return DenseEquivariantIrrep(irreps, **kwargs)
      elif mode == "matrix":
          return DenseEquivariantMatrix(HashableArray(sg.product_table), **kwargs)
      else:
          raise ValueError(
              f"Unknown mode={mode}. Valid modes are 'fft', 'matrix', 'irreps' or 'auto'."
          )
function_tokens: def DenseEquivariant ( symmetries , features : int = None , mode = "auto" , shape = None , point_group = None , in_features = None , * * kwargs , ) : # deprecate in_features if in_features is not None : warn_deprecation ( ( "`in_features` is now automatically detected from the input and deprecated." "Please remove it when calling `DenseEquivariant`." ) ) if "out_features" in kwargs : warn_deprecation ( "`out_features` has been renamed to `features` and the old name is " "now deprecated. Please update your code." ) if features is not None : raise ValueError ( "You must only specify `features`. `out_features` is deprecated." ) features = kwargs . pop ( "out_features" ) if features is None : raise ValueError ( "`features` not specified (the number of output features)." ) kwargs [ "features" ] = features if isinstance ( symmetries , Lattice ) and ( point_group is not None or symmetries . _point_group is not None ) : shape = tuple ( symmetries . extent ) # With graph try to find point group, otherwise default to automorphisms sg = symmetries . space_group ( point_group ) if mode == "auto" : mode = "fft" elif isinstance ( symmetries , Graph ) : sg = symmetries . automorphisms ( ) if mode == "auto" : mode = "irreps" elif mode == "fft" : raise ValueError ( "When requesting 'mode=fft' a valid point group must be specified" "in order to construct the space group" ) elif isinstance ( symmetries , PermutationGroup ) : # If we get a group and default to irrep projection if mode == "auto" : mode = "irreps" sg = symmetries elif isinstance ( symmetries , Sequence ) : if mode not in [ "irreps" , "auto" ] : raise ValueError ( "Specification of symmetries incompatible with mode" ) return DenseEquivariantIrrep ( symmetries , * * kwargs ) else : if symmetries . ndim == 2 and symmetries . shape [ 0 ] == symmetries . shape [ 1 ] : if mode == "irreps" : raise ValueError ( "Specification of symmetries incompatible with mode" ) elif mode == "matrix" : return DenseEquivariantMatrix ( symmetries , * * kwargs ) else : if shape is None : raise TypeError ( "When requesting `mode=fft`, the shape of the translation group must be specified. " "Either supply the `shape` keyword argument or pass a `netket.graph.Graph` object to " "the symmetries keyword argument." ) else : return DenseEquivariantFFT ( symmetries , shape = shape , * * kwargs ) return ValueError ( "Invalid Specification of Symmetries" ) if mode == "fft" : if shape is None : raise TypeError ( "When requesting `mode=fft`, the shape of the translation group must be specified. " "Either supply the `shape` keyword argument or pass a `netket.graph.Graph` object to " "the symmetries keyword argument." ) else : return DenseEquivariantFFT ( HashableArray ( sg . product_table ) , shape = shape , * * kwargs ) elif mode in [ "irreps" , "auto" ] : irreps = tuple ( HashableArray ( irrep ) for irrep in sg . irrep_matrices ( ) ) return DenseEquivariantIrrep ( irreps , * * kwargs ) elif mode == "matrix" : return DenseEquivariantMatrix ( HashableArray ( sg . product_table ) , * * kwargs ) else : raise ValueError ( f"Unknown mode={mode}. Valid modes are 'fft', 'matrix', 'irreps' or 'auto'." )