Skip to main content

Bispectrum analysis for machine learning

Project description

bispectrum

Tests Pre-commit codecov

Bispectrum analysis for machine learning.

Installation

pip install bispectrum

Or with uv:

uv pip install bispectrum

Development

git clone https://github.com/geometric-intelligence/bispectrum.git
cd bispectrum
uv pip install -e ".[dev]"
pre-commit install

Pre-commit Hooks

This project uses pre-commit for code quality checks. After installing dev dependencies, the hooks run automatically on each commit.

# Run hooks on all files (useful for first-time setup or CI)
pre-commit run --all-files

# Run a specific hook
pre-commit run ruff --all-files

# Update hooks to latest versions
pre-commit autoupdate

Usage

Cyclic group on itself

from bispectrum import CnonCn

bsp = CnonCn(n=8)
f = torch.randn(4, 8)       # signal on Z/8Z
beta = bsp(f)                # shape (4, 8), complex64
f_rec = bsp.invert(beta)     # reconstructed up to cyclic shift

SO(3) on the 2-sphere

from bispectrum import SO3onS2

# Selective bispectrum: O(L²) entries with generic completeness
bsp = SO3onS2(lmax=5, nlat=64, nlon=128, selective=True)
f = torch.randn(1, 64, 128)  # signal on S²
beta = bsp(f)                 # shape (1, 35), complex64

# Full bispectrum: O(L³) entries
bsp_full = SO3onS2(lmax=5, nlat=64, nlon=128, selective=False)
beta_full = bsp_full(f)       # shape (1, 69), complex64

Octahedral group

from bispectrum import OctaonOcta

bsp = OctaonOcta()
f = torch.randn(4, 24)       # signal on O (|O| = 24)
beta = bsp(f)                 # shape (4, 172), complex64
f_rec = bsp.invert(beta)      # reconstructed up to group action

See DESIGN.md for the full API and all supported groups.

License

MIT

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

bispectrum-0.3.2.tar.gz (102.2 kB view details)

Uploaded Source

Built Distribution

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

bispectrum-0.3.2-py3-none-any.whl (111.0 kB view details)

Uploaded Python 3

File details

Details for the file bispectrum-0.3.2.tar.gz.

File metadata

  • Download URL: bispectrum-0.3.2.tar.gz
  • Upload date:
  • Size: 102.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for bispectrum-0.3.2.tar.gz
Algorithm Hash digest
SHA256 794f2e580d29971aec9848053397834ff1a6fbf7987b5fe1bc035014322059a1
MD5 93400ee81e586c60ef0a9b9b2744065f
BLAKE2b-256 ce5ce1108f52e22df959a2f1b7ddacc9c229c0b86d4c6c0ad7d730473f2900e4

See more details on using hashes here.

File details

Details for the file bispectrum-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: bispectrum-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 111.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for bispectrum-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 be2b4e8f7d4ae533599232126808cc03218b16bcd410a9a6d4ed2cc5965d05a3
MD5 f26cfe4564920653860050077f41b5ae
BLAKE2b-256 bb48ecaff18376a4ec2ee1035721746d5974ac4bfc945ccc28b3bd4c5f95e9b3

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