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.2.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.2.0
File Size Uploaded Provenance Actions
square_rulerpack_native-0.2.0.tar.gz 6.6 kB Without provenance Details for square_rulerpack_native-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 486.3 kB

Release files / square_rulerpack_native-0.2.0.tar.gz

Download URL square_rulerpack_native-0.2.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
637ae461e901c133132d375e1ffbecc73e0d5fe9bdde0deadfe5d4b430899d8c
BLAKE2b-256 checksum
How to use checksums
74a37b1fb731b182f14bc8d128ed8112a343cddde48bff1f46e6db4785216d0f
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.2.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL square_rulerpack_native-0.2.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 479.7 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
e6e1e46516329049b280f9aea1f0c0a8a139f6a3dc9d4271ca8c5e5f80c94282
BLAKE2b-256 checksum
How to use checksums
9a897d7bb8078c5159afdf14b71fa56f6c70a62b49ca9f91d61b7da28fd9d468
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.2.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.2.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