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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mixsqpx-0.2.1a2.tar.gz.
File metadata
- Download URL: mixsqpx-0.2.1a2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
874f80c4c6ad4379696dbbba282ae6f20e4d86d079690d23f57f42ffbdb3c4a3
|
|
| MD5 |
b31bbecc42440a8a54af0ed8c5ece069
|
|
| BLAKE2b-256 |
af50f749cea1f44297d08bf48befda06ba5af7f560bb70ccb3d3450570e8291e
|
File details
Details for the file mixsqpx-0.2.1a2-py3-none-win_amd64.whl.
File metadata
- Download URL: mixsqpx-0.2.1a2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
594e06eec3b57dc474b0ef6dc4c2da4651802e8f67a06c67039efe907fc129dc
|
|
| MD5 |
0815814e890caf5773ab6a1d650d9893
|
|
| BLAKE2b-256 |
4cd0bf800e14b1b25578b1620a9da45589b24ca5f681fe41dfbd017c6c830ed3
|
File details
Details for the file mixsqpx-0.2.1a2-py3-none-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: mixsqpx-0.2.1a2-py3-none-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 268.2 kB
- Tags: Python 3, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcdc2b58dd620fc91b4d9cddc00843de17d1d4496c21000af89d5a105b25196c
|
|
| MD5 |
74b56fe09d755bf7c3bf8be95aa155ea
|
|
| BLAKE2b-256 |
f0217eb1b1ab2838613e0cbd91a10224b427160ce527214d7759dc09c754813d
|
File details
Details for the file mixsqpx-0.2.1a2-py3-none-macosx_15_0_arm64.whl.
File metadata
- Download URL: mixsqpx-0.2.1a2-py3-none-macosx_15_0_arm64.whl
- Upload date:
- Size: 224.1 kB
- Tags: Python 3, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf460f814f69b24ae08acc84b28cd033c0ce76aefc0244939a8eea724fdbcde9
|
|
| MD5 |
83cfa420a91b23f89968bc2fc88155de
|
|
| BLAKE2b-256 |
2c6f270c441740c9dba8aa6b350017417f0bd0f95dacfeba2ce02ec6766de4e5
|