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.0.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.0-py3-none-any.whl (111.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bispectrum-0.3.0.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.0.tar.gz
Algorithm Hash digest
SHA256 a49d3d96b45bde8cec0d70d3d10d2f0f761bbb013a7738c86fa0703aa0f4f08a
MD5 507a964e42adc2a9d03428e0db665aa8
BLAKE2b-256 e883651640efec5b702ee874bce16aefa9a2216074b585116d6dfe2d865cc446

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bispectrum-0.3.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d05df80a07a3e515435d5623312852a247e9b5bb07f3369e80775ddc0af88f5
MD5 e1720e3ecacc5c186cd58344706b14af
BLAKE2b-256 8ca4ef334bd14a3933e4a5fef4d3307b019104bcd58aa5083ebc72433f13055b

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