pqblocks-anneal-schedule
Quantum-inspired instance-adaptive simulated annealing with statistics-driven schedule generation for Ising and QUBO optimization problems.
What It Is
pqblocks-anneal-schedule implements an instance-adaptive simulated annealing optimizer that dynamically constructs annealing schedules based on structural graph statistics extracted from the problem instance.
Traditional simulated annealing typically relies on static geometric or linear cooling schedules (e.g., $T_{k+1} = \alpha T_k$) that do not account for instance-specific topology, coupling variance, or frustration. pqblocks-anneal-schedule analyzes the problem's coupling matrix $J$ and local field vector $h$ to derive three fundamental instance characteristics:
- Coupling Dispersion ($\sigma_c$): Standard deviation of non-zero coupling weights, governing initial temperature $T_0$.
- Degree Distribution Entropy ($H_d$): Shannon entropy of vertex degrees, determining the quench exponent.
- Frustration Density ($f_r$): Proportion of frustrated edges, informing transverse field $\Gamma_0$ scaling.
Using these statistics, the package generates adaptive temperature trajectories $T(t) = T_0 \exp(-t^{\text{quench}})$ and transverse field schedules $\Gamma(t) = \Gamma_0 (1 - t)$ optimized for structured sparse instances.
When It Wins / When It Loses
- Wins on structured sparse instances: Excels on heterogeneous, sparse graphs (such as MaxCut and planted partition problems) where coupling variance and degree irregularity allow the adaptive schedule to navigate energy barriers effectively, achieving up to 2.04x faster Time-To-Solution (TTS) compared to naive geometric schedules.
- Loses on dense, uniform instances: On large, dense, uniform random graphs (e.g., $n=512, p=0.5$), the overhead of graph statistics extraction and schedule generation makes it slower than highly optimized C++ solvers (such as
neal, which is up to 49.6x faster on $n=512$ dense MaxCut).
Key Features
- Automated Statistics Extraction: Computes $(\sigma_c, H_d, f_r)$ directly from problem matrices in $O(|E|)$ time.
- Adaptive Schedule Synthesis: Generates step-by-step temperature and transverse field schedules tailored to problem structure.
- Dual-Kernel Architecture: High-speed JIT-accelerated kernel via Numba with a bit-identical pure-Python reference implementation.
- Schedule Serialization: Fast binary serialization and deserialization via MessagePack (
schedule_to_msgpack,schedule_from_msgpack). - Deterministic Reproducibility: Exact seed control ensuring bit-identical trajectory replication across runs.
Installation
pip install pqblocks-anneal-schedule
Quickstart
import numpy as np
from pqblocks_anneal_schedule import (
compute_instance_stats,
generate_schedule,
simulated_annealing,
)
# Define a 4-spin Ising ring
J = np.array([
[0.0, -1.0, 0.0, 1.0],
[-1.0, 0.0, -1.0, 0.0],
[0.0, -1.0, 0.0, -1.0],
[1.0, 0.0, -1.0, 0.0]
], dtype=float)
h = np.zeros(4, dtype=float)
# Extract graph statistics and synthesize adaptive schedule
stats = compute_instance_stats(J, h)
schedule = generate_schedule(stats, n=4, max_degree=2, budget_steps=64)
# Execute simulated annealing
result = simulated_annealing(J, h, schedule, seed=42, num_steps=64, num_runs=1)
print(f"Best Energy: {result.best_energy:.6f}")
print("Best Config:", result.best_config)
Execution output:
Best Energy: -2.000000
Best Config: [-1 -1 -1 -1]
Documentation
- BENCHMARKS.md: Empirical runtime measurements and comparative MaxCut evaluation against reference baselines.
- TESTING.md: Test suite architecture, coverage metrics, and validation procedures.
- EVIDENCE.md: Execution logs and reproducibility artifacts.
- VERIFICATION_REPORT.md: Correctness, determinism, and serialization checks.
- USE_CASES.md: Practical applications and schedule caching patterns.
- SECURITY_NOTES.md: Non-cryptographic scope disclosure and numerical bounds.
- AGENTS.md: Machine-readable interfaces and automated pipeline integration.
- CHANGELOG.md: Version history and updates.
License
MIT License. See LICENSE for details.
Metadata
Release files for pqblocks-anneal-schedule 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pqblocks_anneal_schedule-0.1.0.tar.gz | 27.2 kB | Without provenance | Details for pqblocks_anneal_schedule-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pqblocks_anneal_schedule-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pqblocks_anneal_schedule-0.1.0-py3-none-any.whl |
Total release size: 45.8 kB
Release files / pqblocks_anneal_schedule-0.1.0.tar.gz
| Download URL | pqblocks_anneal_schedule-0.1.0.tar.gz |
|---|---|
| Size | 27.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
feb36707f6e703b378068b27b05804817a3fe4832b3f4f408140c027a6d7d2f2
|
|
BLAKE2b-256 checksum How to use checksums |
2be95ca1c778ded6aeef00fe3a81413ec1112a6b98144662432f0df49851425a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pqblocks_anneal_schedule-0.1.0-py3-none-any.whl
| Download URL | pqblocks_anneal_schedule-0.1.0-py3-none-any.whl |
|---|---|
| Size | 18.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d0a2402b753e50f97219226cf3735d7bd87b51d15dc2f0d5a54ff357327c8541
|
|
BLAKE2b-256 checksum How to use checksums |
78ca37fdd2833235fd466c6ed41f663e7b55c32a3d75b1297e2c869090a8de9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for pqblocks-anneal-schedule 0.1.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.