Function reference

The following functions are exported by the FourierSeriesEvaluators package

FourierSeriesEvaluators.fourier_contract!Method
fourier_contract!(r::AbstractArray{T,N-1}, C::AbstractArray{T,N}, x, [k=1, a=0, shift=0, dim=Val(N)]) where {T,N}

Contract dimension dim of array C and write it to the array r, whose axes must match C's (excluding dimension dim). This function uses the indices in axes(C,N) to evaluate the phase factors, which makes it compatible with OffsetArrays as inputs. Optionally, a shift can be provided to manually offset the indices. Also, a represents the order of derivative of the series and must be a Number. The formula for what this routine calculates is:

\[r_{i_{1},\dots,i_{N-1}} = \sum_{i_{N}\in\text{axes}(C,N)} C_{i_{1},\dots,i_{N-1},i_{N}+m+1} (ik (i_{N} + \text{shift}))^{a} \exp(ik x (i_{N} + \text{shift}))\]

source
FourierSeriesEvaluators.fourier_evaluateMethod
fourier_evaluate(C::AbstractArray{T,N}, x::NTuple{N}, [k=1, a=0, shift=0]) where {T,N}

Evaluates a N-D Fourier series C. This function uses the indices in axes(C) to evaluate the phase factors, which makes it compatible with OffsetArrays as inputs. Optionally, a shift can be provided to manually offset the indices. Also, a represents the order(s) of derivative of the series. The arguments x, k, a, shift must all be tuples of length N, the same as the array dimension. The 1-D formula for what this routine calculates is:

\[r = \sum_{n\in\text{axes}(C,1)} C_{n} (ik (n + \text{shift}))^{a} \exp(ik x (n + \text{shift}))\]

Multi-dimensional performance hit

This routine is allocation-free, but using it for multidimensional evaluation can be slower than allocating because it always computes the Fourier coefficients on the fly. Thus, it is typically more efficient to compute the outermost dimensions of the series with fourier_contract! and then use this routine for the innermost dimension, which is faster because it doesn't use inplace operations. FourierSeries implements this behavior.

source
FourierSeriesEvaluators.hermitian_fourier_contract!Method
hermitian_fourier_contract!(r::AbstractArray, C::AbstractArray, x, k=inv(oneunit(x)), a=0, ::Val{dim}=Val(ndims(C)))

Contracts a single dimension of a multi-dimensional Fourier series, other than the innermost. Similar to fourier_contract! although this function will maintain the conjugate symmetry of the phase factors in the series.

source
FourierSeriesEvaluators.hermitian_fourier_evaluateFunction
hermitian_fourier_evaluate(C::AbstractVector, x, [k=1, a=0])

Evaluates a 1-D Hermitian Fourier series C, which is a compact representation of a series with coefficients C[i] = C[-i]'. The other arguments are the same as fourier_evaluate. The precise formula of what is evaluated is given by the following, where the initial element $C_{0}$ is equal to C[begin]:

\[r = 0^a C_{0} + \sum_{n=1}^{N-1} C_{n} (ik n)^{a} \exp(ik n x)) + \text{h.c.}\]

source