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.1a1.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.1a1-py3-none-win_amd64.whl (150.1 kB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.39+ x86-64

mixsqpx-0.2.1a1-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.1a1.tar.gz.

File metadata

  • Download URL: mixsqpx-0.2.1a1.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.1a1.tar.gz
Algorithm Hash digest
SHA256 dc916ea556d012c1494f5d4e2f04d276aed35242fed9fff46b56820fe0f36d28
MD5 5fd8a70a95a3ab6de75c8ae810a13f8f
BLAKE2b-256 4740f451460ee01d835e274e79bd3f726da4c741948e848bd6a73f221723048a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mixsqpx-0.2.1a1-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.1a1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f2167e473ecfb444be5a60e336785746a6b4e77ed5eb1210ec4e63edb67eaaf8
MD5 22e826e86bfaeb99883b2fee7c591d73
BLAKE2b-256 1dd48b4cdb75bb519b12380bb621969175a31a49a8ff32232b014de78ccdf42b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mixsqpx-0.2.1a1-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 c01c6e4f45be2750a28ac752a069cd029967adb8e18a644877b212376afd4dbd
MD5 d0fd8cfc841ed402eacb8200eb14e5d4
BLAKE2b-256 0878ffea2da0a882e48597b699131cba4dc2a528de4415ba0a1847a15ce8f887

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mixsqpx-0.2.1a1-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d71bb06f89296063671689a04987c18b98df7cb6b351337ddcdd94401838f875
MD5 c111d95d90aadace6c647cd0e0867a2b
BLAKE2b-256 7cdd491f48b5863d532eaf93f3612bce86bc4c99694559eaf70d269a4e47147c

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