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

Uploaded Python 3

File details

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

File metadata

  • Download URL: bispectrum-0.3.5.tar.gz
  • Upload date:
  • Size: 102.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bispectrum-0.3.5.tar.gz
Algorithm Hash digest
SHA256 8094499a156152f342c96454af2fc9bf9a88b666979a2b816d4229b206e12a89
MD5 49b3ee9c7b9866562d75a66ee8cc8eb4
BLAKE2b-256 26b21b4151eaa02c1bbc4a752fb2b89f066a2165010370e9bbd746cfa5d06c80

See more details on using hashes here.

Provenance

The following attestation bundles were made for bispectrum-0.3.5.tar.gz:

Publisher: publish.yml on geometric-intelligence/bispectrum

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: bispectrum-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 111.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bispectrum-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1fb2747eed49ed97d6f8bf2884632955857861d27c74e547ee1758fa4e628d4e
MD5 60da9ac969e20e45bc104b4e78786cef
BLAKE2b-256 00f99fc4b18123846f0744ae73f77eefd68a3336d63fd3e0044879257bbd6f7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for bispectrum-0.3.5-py3-none-any.whl:

Publisher: publish.yml on geometric-intelligence/bispectrum

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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