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

Uploaded Python 3Windows x86-64

mixsqpx-0.2.1a3-py3-none-manylinux_2_28_x86_64.whl (268.6 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

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

File metadata

  • Download URL: mixsqpx-0.2.1a3.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.1a3.tar.gz
Algorithm Hash digest
SHA256 3300e3583c2742558ddddc0e50ed7f1e54e1a15d58a3a95d91d51e4abcaf1080
MD5 d0c5cbabf8323dae4a347353683ff625
BLAKE2b-256 a7c2f7171d801bd59b076e179d5b7c7a3341b91dd44cf8c79eec2049ff68ea9a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mixsqpx-0.2.1a3-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.1a3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 7aafd33cf25eddfb316aaf67a74119bb7d616e577fb1716e48d1c6793be8fd00
MD5 0c2f18a800c4dde305ae1bed3d135db7
BLAKE2b-256 e2c3c0c835b6e8b6bca09d2770606579ae20e596465d5fa4c2c1d8699cbb51b5

See more details on using hashes here.

File details

Details for the file mixsqpx-0.2.1a3-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mixsqpx-0.2.1a3-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a2870e2aefa6ddc6a658b705a24152b889ce89e7b4f0cb711803c55cbdf5ef94
MD5 62a54765936560cd54a43b9579b334c8
BLAKE2b-256 c48492feb94f84e8ccc72dfd5319501a13fb2739aefe2882b13ceae3e243d28c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mixsqpx-0.2.1a3-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 be3d65cfa236f632e98cbd6df800d99a0196d50e08dab72d8379b3990bb2286c
MD5 b472ba5c2a3697549444b28d4d4d000d
BLAKE2b-256 e2ece5be74e4ca618746d556ea211cddf218e89b9a1565260d1978eafc346b30

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