boofun.core.representations.fourier_expansion

Classes

FourierExpansionRepresentation()

Fourier expansion representation of Boolean functions

class boofun.core.representations.fourier_expansion.FourierExpansionRepresentation[source]

Fourier expansion representation of Boolean functions

evaluate(inputs: ndarray, data: ndarray, space: Space, n_vars: int) ndarray[source]

Evaluate the Fourier expansion at given inputs.

Parameters:
  • inputs – Binary input vectors (shape: (m, n) or (n,))

  • data – Fourier coefficients (1D array of length 2**n)

Returns:

Fourier expansion values (real numbers)

dump(data: ndarray, space=None, **kwargs) Dict[str, Any][source]

Export Fourier coefficients in serializable format

convert_from(source_repr: BooleanFunctionRepresentation, source_data: Any, space: Space, n_vars: int, **kwargs) ndarray[source]

Compute Fourier coefficients from any evaluable Boolean representation. Fourier basis: {(-1)^{x·s}} for s ⊆ [n]

convert_to(target_repr: BooleanFunctionRepresentation, source_data: Any, space: Space, n_vars: int, **kwargs) ndarray[source]

Convert to another representation from Fourier expansion

create_empty(n_vars: int, **kwargs) ndarray[source]

Create zero-initialized Fourier coefficients array

is_complete(data: ndarray) bool[source]

Check if representation contains non-zero coefficients

time_complexity_rank(n_vars: int) Dict[str, int][source]

Return time complexity estimates for Fourier operations.

get_storage_requirements(n_vars: int) Dict[str, int][source]

Return memory requirements for n variables