Python wrappers
Public Python APIs implemented by this engine symbol.N-dimensional real-to-complex DFT.
Computes the DFT of a real signal and stores only the non-redundant
half along the last transformed axis (the Hermitian half). The
remaining frequencies can be reconstructed by complex conjugation;
this storage convention matches numpy.fft.rfftn.
Math
For real input ,
stored over only (the last axis is trimmed by Hermitian symmetry; all other axes are stored in full).
Shape
Let L = axes.back(). Then out.shape[L] == n.back() / 2 + 1
when n is supplied, else a.shape[L] / 2 + 1. All other
transformed axes follow n (or the input shape).
See Also
irfftn_op : Inverse real DFT. fftn_op : Full complex-to-complex DFT.
Parameters
aTensorImplPtrnvector<int64_t>len(n) == len(axes) is required, and the last transformed axis is stored at n.back() / 2 + 1.axesvector<int>Returns
TensorImplPtrC64 tensor. Shape matches the input except for the last entry of axes, which becomes (n_last) / 2 + 1 where n_last is n.back() (or a.shape[axes.back()] when n is empty).
Raises
LucidErrora is null, has a non-real dtype, axes is empty, or len(n) != len(axes) when n is non-empty.Notes
FFT bypasses IBackend dispatch and calls MLX directly (see
_Detail.h). The Python wrapper must remember the original last
axis size to disambiguate the inverse.