boofun.core.representations.fourier_expansion
Classes
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