Skip to main content

JAX interface to the Rust implementation of the mixSQP algorithm

Project description

MIXSQPX: A JAX-compatible interface to the mixSQP algorithm

This package provides a jax-compatible interface to the mixSQP algorithm described in,

Kim, Y., Carbonetto, P., Stephens, M., & Anitescu, M. (2020). A Fast Algorithm for Maximum Likelihood Estimation of Mixture Proportions Using Sequential Quadratic Programming. Journal of Computational and Graphical Statistics, 29(2), 261–273.

The implementation of the mixSQP algorithm in this package was ported from the R implementation by the authors of this paper which uses the Rarmadillo package as an interface to the Armadillo C++ library.

This package provides a function mixsolve, which can be transformed with JAX transformations such as jit.

Installation

This branch uses uv as the project frontend and hatchling as the build backend. Building the package requires a working Rust toolchain because the default backend is a bundled Rust shared library.

Local Development

# Install uv if you don't have it already.
curl -LsSf https://astral.sh/uv/install.sh | sh

# Clone the repository.
git clone https://github.com/pdiegert/mixsqpx.git
cd mixsqpx

# Install Rust if you don't have it already.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Sync the development environment and install the package editable.
uv sync --group test --group examples

uv sync builds the Rust library through the Hatch build hook and installs the package in editable mode.

Verification

Run the test suite to verify your installation:

uv run --group test pytest tests

Build a wheel locally with:

uv build

Benchmark the Rust backend explicitly with:

uv run --group test python scripts/benchmark_mixsolve.py

Legacy C++ Reference Path

This branch is intended to merge as a Rust-first package. The legacy C++/Armadillo backend is kept only as an archival benchmark/reference path.

  • Keep the legacy implementation in a separate checkout or worktree.
  • Use a separate environment for the legacy package.
  • Do not treat the legacy C++ build as part of the default developer install on this branch.

A recommended setup is:

git worktree add ../mixsqpx-legacy legacy-cpp-final

Additional details for benchmarking and the opt-in exact legacy reference test are documented in LEGACY_CPP_REFERENCE.md.

License

This project is licensed under the MIT License - see the LICENCE file for details.

Acknowledgements

This project includes code adapted from the mixSQP project, which is available under the MIT license. We thank the original authors (Youngseok Kim, Peter Carbonetto, Matthew Stephens and Mihai Anitescu) for their work.

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

mixsqpx-0.2.0a1.tar.gz (9.5 MB view details)

Uploaded Source

Built Distributions

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

mixsqpx-0.2.0a1-py3-none-win_amd64.whl (150.1 kB view details)

Uploaded Python 3Windows x86-64

mixsqpx-0.2.0a1-py3-none-manylinux_2_39_x86_64.whl (268.2 kB view details)

Uploaded Python 3manylinux: glibc 2.39+ x86-64

mixsqpx-0.2.0a1-py3-none-macosx_15_0_arm64.whl (224.1 kB view details)

Uploaded Python 3macOS 15.0+ ARM64

File details

Details for the file mixsqpx-0.2.0a1.tar.gz.

File metadata

  • Download URL: mixsqpx-0.2.0a1.tar.gz
  • Upload date:
  • Size: 9.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mixsqpx-0.2.0a1.tar.gz
Algorithm Hash digest
SHA256 7bf0b9a2888bb6fb95fda0cc184b45a5e5ff334148ec47e145f56af5fee5e98f
MD5 2b71592082bf8a91d2f7325722dab05b
BLAKE2b-256 009fb3d27c8b6be713718c9f8f43546bdb85418ef5838bc977865ae4dac4f8e3

See more details on using hashes here.

File details

Details for the file mixsqpx-0.2.0a1-py3-none-win_amd64.whl.

File metadata

  • Download URL: mixsqpx-0.2.0a1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 150.1 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mixsqpx-0.2.0a1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 eedf88eee56ca8b434bb230e6cdc812cc652c1a95a0dc404c8c8d81f9071c02d
MD5 5105acd35cb8bbd2610b0ebef48ac801
BLAKE2b-256 0d5dbfd0918f450d9b38db1ebcf1d57c0b380ae83e3b313c3646ffa67002a3ef

See more details on using hashes here.

File details

Details for the file mixsqpx-0.2.0a1-py3-none-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for mixsqpx-0.2.0a1-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 ad69201d3e4b5b459d931d23f01c3fb018024ceb2fa49f2241afcf80a9a19769
MD5 dcc3f17624c9a119ae5526b6d66ed86d
BLAKE2b-256 67bb66a7509f6621fed03df03d6a802fa2d1ae16b0d29b55b56071e1016c524f

See more details on using hashes here.

File details

Details for the file mixsqpx-0.2.0a1-py3-none-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mixsqpx-0.2.0a1-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 0c9ee79b118978859998e529df6afff06c80a46628b4bdd6ba121e20cb5665a0
MD5 c0204970afb1ede659264935dce88444
BLAKE2b-256 6d6dbff513d0441e37affe51021c684b69c178a6d0f4d12d959de3ed03d0ac9d

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