Skip to content

ffts#

Includes the FFT-based convolution and correlation functions.

Functions:

fft_convolve #

fft_convolve(a: NDArray, b: NDArray) -> NDArray

Computes the convolution of two arrays using FFT over the first axis (energy axis).

Parameters:

  • a (NDArray) –

    First array.

  • b (NDArray) –

    Second array.

Returns:

  • NDArray

    The convolution of the two arrays.

fft_circular_convolve #

fft_circular_convolve(a: NDArray, b: NDArray, axes: tuple[int]) -> NDArray

Computes the circular convolution of two arrays using the FFT.

Parameters:

  • a (NDArray) –

    First array.

  • b (NDArray) –

    Second array.

  • axes (tuple[int]) –

    The axes over which to perform the convolution.

Returns:

  • NDArray

    The circular convolution of the two arrays.

fft_convolve_kpoints #

fft_convolve_kpoints(a: NDArray, b: NDArray) -> NDArray

Computes the convolution of two arrays using the FFT.

The first axis is assumed to be the energy axis, the other axes are k-points and the last axis is the orbital index.

Over the k-point axes, a circular convolution is performed.

Parameters:

  • a (NDArray) –

    First array.

  • b (NDArray) –

    Second array.

Returns:

  • NDArray

    The convolution of the two arrays.

fft_correlate_kpoints #

fft_correlate_kpoints(a: NDArray, b: NDArray) -> NDArray

Computes the correlation of two arrays using FFT.

The first axis is assumed to be the energy axis, the other axes are k-points and the last axis is the orbital index.

Over the k-point axes, a circular correlation is performed.

Parameters:

  • a (NDArray) –

    First array.

  • b (NDArray) –

    Second array.

Returns:

  • NDArray

    The cross-correlation of the two arrays.