pqblocks-population-anneal
Quantum-inspired Population Annealing Monte Carlo heuristic solver for Ising and QUBO combinatorial optimization.
What It Is
pqblocks-population-anneal implements Population Annealing (PA), a sequential Monte Carlo optimization algorithm for Ising spin-glass and Quadratic Unconstrained Binary Optimization (QUBO) problems.
Rather than propagating a single thermal walker as in classical Simulated Annealing, Population Annealing maintains an ensemble of $R$ parallel replica configurations. As temperature decreases, replicas undergo thermal Monte Carlo relaxation combined with population resampling proportional to Boltzmann weights $\exp(-\Delta \beta E)$. Replicas in low-energy states replicate, while those in high-energy states are pruned.
This mechanism allows the population to overcome deep local energy barriers and explore rugged, multi-modal energy landscapes on standard classical CPUs.
Key Features
- Ensemble Resampling: Implements residual resampling to replicate low-energy configurations and prune suboptimal states across inverse temperature steps.
- Dynamic Boltzmann Reweighting: Re-weights the population using energy differentials relative to current ground states to prevent floating-point underflow.
- Thermodynamic Free Energy Estimation: Tracks the dimensionless free energy $-\beta F(\beta)$ as an intrinsic property of the thermal trajectory.
- Accelerated Numba JIT Kernels: Optimized inner Metropolis-Hastings sweep kernels with pure-Python fallback.
- Lossless QUBO Mapping: Directly compatible with
pqblocks-qubofor seamless binary-to-spin mapping.
Installation
pip install pqblocks-population-anneal
Quickstart
import numpy as np
from pqblocks_population_anneal import PopulationAnnealingSampler
# Define a 4-spin chain problem
h = np.array([0.5, -0.3, 0.2, -0.1])
J = np.array([
[0.0, 1.0, -1.0, 0.0],
[1.0, 0.0, 1.0, -1.0],
[-1.0, 1.0, 0.0, 1.0],
[0.0, -1.0, 1.0, 0.0]
])
# Initialize sampler with 100 replicas and 10 sweeps per temperature step
sampler = PopulationAnnealingSampler(num_replicas=100, num_sweeps=10)
best_state, best_energy, free_energy = sampler.sample(h, J, seed=42)
print(f"Best Spin State: {best_state}")
print(f"Best Energy: {best_energy:.6f}")
print(f"Estimated Free Energy: {free_energy:.6f}")
Execution output:
Best Spin State: [-1 1 -1 1]
Best Energy: -6.100000
Estimated Free Energy: -6.102126
Functional API: solve_ising()
For concise, one-line evaluations:
from pqblocks_population_anneal import solve_ising
best_state, best_energy, free_energy = solve_ising(
h=h,
J=J,
num_replicas=250,
num_sweeps=10,
seed=42
)
Documentation
- BENCHMARKS.md — Empirical performance comparisons, TTS evaluations, and winning/losing cases
- TESTING.md — Test suite layout, coverage details, and validation procedures
- EVIDENCE.md — Clean-room execution logs and reproducibility artifacts
- VERIFICATION_REPORT.md — Formal release verification gates and checks
- USE_CASES.md — Multi-modal landscape exploration and QUBO integration patterns
- SECURITY_NOTES.md — Numerical safeguards, non-cryptographic scope, and stability bounds
- AGENTS.md — Machine-readable interfaces and guidelines for autonomous agents
- CHANGELOG.md — Version history and release notes
Metadata
Release files for pqblocks-population-anneal 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_population_anneal-0.1.0.tar.gz | 19.6 kB | Without provenance | Details for pqblocks_population_anneal-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pqblocks_population_anneal-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pqblocks_population_anneal-0.1.0-py3-none-any.whl |
Total release size: 35.2 kB
Release files / pqblocks_population_anneal-0.1.0.tar.gz
| Download URL | pqblocks_population_anneal-0.1.0.tar.gz |
|---|---|
| Size | 19.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e4fa4ec146e0033f777b6e3be4782d0e47842ddcc950e3f12ccef64b25042a30
|
|
BLAKE2b-256 checksum How to use checksums |
5edb6da7184c000065460f0afe43975c0075ad791617fc170615cdf784068916
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pqblocks_population_anneal-0.1.0-py3-none-any.whl
| Download URL | pqblocks_population_anneal-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a93e8db5e5cb4e16bafbf113af31d83af07cc328d623b09c31abf31444d1fb0b
|
|
BLAKE2b-256 checksum How to use checksums |
3906ef50a05a22915adf093c2305bc6d7becc7e52967482bfe284e53c6cdbe5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for pqblocks-population-anneal 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.