Expand description
§log-fft
Exact Fourier transforms over the Goldilocks field
F_p, p = 2^64 − 2^32 + 1. The crate also includes executable building
blocks of the construction in “The logarithmic exponent of finite
Fourier transforms” (OpenAI preprint, 2026-11-24,
https://github.com/openai/math).
§Transforms
Ntt: power-of-two NTT (n ≤ 2^32), in place.Dft: DFT of every lengthF_psupports (n | p − 1), using Good–Thomas over the coprime factors2^j, 3, 5, 17, 257, 65537.ChirpZ:y_k = Σ_j x_j q^{jk}for any nonzeroqand any sizes, without needing√q.InverseChirpZ: interpolation at geometric nodesq^0 … q^{n−1}. It uses the paper’s Newton factorisationV = D_H · T · M · Tᵀ · D_H, so it runs inO(n log n).GroupDft: DFT onZ_{a_1} × … × Z_{a_r}.convolve,series_inverse: exact polynomial multiplication and power-series inversion.
Everything is exact modular arithmetic, with no rounding.
use log_fft::{Dft, Fp};
let dft = Dft::new(255); // 255 = 3·5·17
let x: Vec<Fp> = (0..255).map(Fp::new).collect();
let y = dft.forward(&x);
assert_eq!(dft.inverse(&y), x);§About the paper
The paper proves N(log N)^{1/2+o(1)} circuit bounds. Its constants are
non-explicit, and its recursion is defined to use direct transforms for
bounded sizes. From its own cost formulas, any saving needs arrays
beyond about 2^500 entries. So the transforms above are the path the
paper’s algorithm takes at every size a computer can hold. The paper’s
lemmas themselves (predictor, Hermite repair, matrix root, Newton/Toeplitz
reduction) are implemented and tested in paper.
Re-exports§
pub use chirp::ChirpZ;pub use chirp::InverseChirpZ;pub use dft::is_supported_len;pub use dft::Dft;pub use dft::GroupDft;pub use field::Fp;pub use ntt::convolve;pub use ntt::series_inverse;pub use ntt::Ntt;
Modules§
- chirp
- Geometric evaluation (chirp-z) and its inverse.
- dft
- Exact DFTs of every length that
F_psupports, and DFTs on finite abelian groups. - field
- Exact arithmetic in the Goldilocks prime field
F_p,p = 2^64 - 2^32 + 1. - ntt
- Power-of-two number-theoretic transforms over the Goldilocks field.
- paper
- Executable building blocks from “The logarithmic exponent of finite Fourier transforms” (OpenAI preprint, 2026-11-24, https://github.com/openai/math).