Skip to main content

square-rulerpack-native

Lars Rocha's square-rulerpack factoring engine (self-initialising quadratic sieve with double large primes, AVX2 kernels, rayon threads, in Rust) compiled as a Python extension module with PyO3. It is the fast path of the pure-Python square-rulerpack package, which does the teaching; this module does the factoring.

pip install square-rulerpack[native]      # or: pip install square-rulerpack-native
import square_rulerpack_native as srn
srn.factor_completely(50726044447758565750355444206008211963939957754977146054012847169421070122136537, threads=8)
srn.factor(n, threads=8)                  # one nontrivial factor from the sieve, or None
srn.is_prime(2**61 - 1)                   # strong probable-prime test
srn.factor_completely(n, threads=8, progress=lambda stage, full, need, partials, polys: print(stage, full, need))

Through the pure package it is the default engine once installed:

import square_rulerpack as sq
sq.factor_completely(n, workers=8)        # engine="auto": Rust when installed, Python otherwise

Python ints cross as big integers (no string round trip). The GIL is released while the sieve runs; Ctrl-C does not interrupt it. The engine's switches (SIQS_Q2, SIQS_SMALL, SIQS_EXACT, SIQS_DLP, …) are read from the environment at call time, exactly as the Rust CLI reads them; the pure package sets them from its Settings. Wheels are abi3 (one wheel per platform for every Python ≥ 3.10); building from the sdist needs a Rust toolchain.

MIT, as the crate.

Metadata

Release files for square-rulerpack-native 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for square-rulerpack-native 0.3.0
File Size Uploaded Provenance Actions
square_rulerpack_native-0.3.0.tar.gz 577.3 kB Without provenance Details for square_rulerpack_native-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for square-rulerpack-native 0.3.0
File Interpreter ABI Platform Actions
square_rulerpack_native-0.3.0-cp310-abi3-manylinux_2_34_x86_64.whl CPython 3.10 abi3 Linux glibc 2.34+ x86-64 Details for square_rulerpack_native-0.3.0-cp310-abi3-manylinux_2_34_x86_64.whl

Total release size: 1.1 MB

Release files / square_rulerpack_native-0.3.0.tar.gz

Download URL square_rulerpack_native-0.3.0.tar.gz
Size 577.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7389b7a79e6ab5b3fb60410a3f476b86cd5b9e69e96dc7381037462cdbfdcf57
BLAKE2b-256 checksum
How to use checksums
0be826a9318428dca03902ba0c47e202597a9c218d717314cb5c5e4a962f0f1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / square_rulerpack_native-0.3.0-cp310-abi3-manylinux_2_34_x86_64.whl

Download URL square_rulerpack_native-0.3.0-cp310-abi3-manylinux_2_34_x86_64.whl
Size 499.4 kB
Tags CPython 3.10 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
1724687645f08baf55467e113aeba0e82ec62d099703fab2e14bfb3e168cb20d
BLAKE2b-256 checksum
How to use checksums
26c52751029d08a14c94fc55d776b788cf10b12e0c7c7bd003a5d76d3af2757e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for square-rulerpack-native 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page