Skip to main content

Fast Fourier transforms for symmetric groups over prime finite fields

Project description

fft-symmetric-py

FFT (fast Fourier transform) of the symmetric group over finite fields in Python.

This package implements the semisimple case: for S_n over F_p, the constructor enforces p > n. Fourier blocks use Young's seminormal representations and the subgroup chain

S_1 <= S_2 <= ... <= S_n

Input coefficients are ordered by lexicographic permutation image order.

from fft_symmetric import SymmetricFFT

fft = SymmetricFFT(4, 101)
values = [1] * fft.input_len

transform = fft.fft(values)
recovered = fft.ifft(transform)
assert recovered == values

identity = [1] + [0] * (fft.input_len - 1)

product = fft.multiply(values, values)
assert len(product) == fft.input_len

inverse = fft.invert(identity)
assert fft.multiply(identity, inverse) == identity

for shape, block in transform.blocks.items():
    print(shape, block.rows, block.cols)

The package also exposes naive_dft and naive_multiply as small-rank correctness or timing baselines.

Group Algebra Inversion

For the semisimple case p > n, the Fourier transform decomposes F_p[S_n] into matrix blocks indexed by partitions of n. Multiplication is blockwise:

widehat(fg)_lambda = widehat(f)_lambda widehat(g)_lambda

So a group-algebra element is invertible exactly when every Fourier block is an invertible matrix, and inversion is:

widehat(f^{-1})_lambda = widehat(f)_lambda^{-1}

Use SymmetricFFT.invert(values) for coefficient-space inversion, or SymmetricFFT.invert_transform(transform) if you already have the Fourier blocks and want to avoid recomputing the transform.

Run tests with:

PYTHONPATH=src python3 -m unittest discover -s tests

Run the opt-in timing-sensitive multiplication test with:

PYTHONPATH=src FFT_SYMMETRIC_RUN_TIMING=1 python3 -m unittest \
    tests.test_core.CoreTests.test_multiplication_is_faster_than_naive

Run the timing example with:

PYTHONPATH=src python3 -m examples.timing

Set FFT_SYMMETRIC_TIMING_MAX_N=7 or higher if you want a longer run.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fft_symmetric-0.2.0.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fft_symmetric-0.2.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file fft_symmetric-0.2.0.tar.gz.

File metadata

  • Download URL: fft_symmetric-0.2.0.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for fft_symmetric-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d0ed17454b04f47d2dd90c2f7226fbb4a4693814cdd4a9de2b6073d184ef5cdf
MD5 cc3f2b4172626c5ed3ea5fdc46fb7514
BLAKE2b-256 0e8fdcd92a66df14a642bbf10f8f17a50e7be365a3ad966297a63fe880832565

See more details on using hashes here.

File details

Details for the file fft_symmetric-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fft_symmetric-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for fft_symmetric-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00415f8f1115e7a615996d5440a2a2c18139d460119483f0c5606d9aabdf9e09
MD5 f7fd044c86474fca21564c2af16818ea
BLAKE2b-256 ceda9a52cf9c808a3960cb8bd57e853a73e608a8bde6238f3104b6821011c55a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page