Skip to main content

pqblocks-anneal-sqa

Simulated Quantum Annealing (Path-Integral Monte Carlo via Suzuki-Trotter decomposition) heuristic solver for Ising and QUBO optimization problems.

CI License Python 3.11+



Overview

pqblocks-anneal-sqa is a classical quantum-inspired optimization solver implementing Simulated Quantum Annealing (SQA).

By mapping a quantum transverse-field Ising Hamiltonian into an equivalent classical $(d+1)$-dimensional system via Suzuki-Trotter decomposition (Path-Integral Monte Carlo), the solver simulates quantum tunneling effects through narrow potential energy barriers. The inner Trotter loop is accelerated with Numba JIT compilation, delivering high-throughput sampling on CPU architectures.

Key Highlights

  • Suzuki-Trotter Mapping: Replaces quantum transverse terms with $P$ classical replicas coupled along an imaginary-time Trotter dimension.
  • Quantum Tunneling Emulation: Enables transitions across tall, narrow barriers where thermal simulated annealing often gets trapped in local minima.
  • Numba JIT Kernel: Optimized inner Monte Carlo sweeps for high throughput.
  • Standard Interface: Exposes a clean sample_ising interface and SQABenchmarkWrapper conforming to the dimod benchmark harness interface.

Installation

pip install pqblocks-anneal-sqa

Dependencies

Requires Python 3.11+, numpy, scipy, dimod, and numba.


Quickstart

from pqblocks_anneal_sqa import SimulatedQuantumAnnealingSampler

# 1. Define 4-spin Ising problem
h = [-1.0, 1.0, 2.0, -2.0]
J = [
    [0.0, 1.0, -1.0, 2.0],
    [0.0, 0.0, 1.0, -1.0],
    [0.0, 0.0, 0.0, -2.0],
    [0.0, 0.0, 0.0, 0.0],
]

# 2. Initialize SQA solver
sampler = SimulatedQuantumAnnealingSampler()

# 3. Sample Ising ground state
samples, energies = sampler.sample_ising(h, J, num_sweeps=1000, beta=5.0, P=32)

print("Best Spin State:", samples[0].tolist())
print(f"Best Energy: {energies[0]:.6f}")

Multi-Replica Trotter Dimensions

Control the Trotter dimension $P$ (the number of classical replicas in imaginary time):

# Evaluate with P=16 Trotter replicas
samples, energies = sampler.sample_ising(h, J, P=16, num_sweeps=500)

Fair Benchmarking Disclaimer

When comparing SQA against classical simulated annealing (like D-Wave Neal) and constraint solvers (CP-SAT):

  • Work Normalization: SQA computes updates across $P$ Trotter replicas simultaneously (e.g. $P=32$), doing $P \times$ more spin updates per sweep than single-replica simulated annealing.
  • Latency vs Barrier Crossing: Single-replica SA exhibits lower per-read latency, while SQA is designed to traverse barriers via simulated quantum tunneling.

Verification & Testing

Tested across Python 3.11, 3.12, 3.13, and 3.14.

pytest

License

Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.

Metadata

Release files for pqblocks-anneal-sqa 0.1.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 pqblocks-anneal-sqa 0.1.0
File Size Uploaded Provenance Actions
pqblocks_anneal_sqa-0.1.0.tar.gz 16.5 kB Without provenance Details for pqblocks_anneal_sqa-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pqblocks-anneal-sqa 0.1.0
File Interpreter ABI Platform Actions
pqblocks_anneal_sqa-0.1.0-py3-none-any.whl Python 3 none any Details for pqblocks_anneal_sqa-0.1.0-py3-none-any.whl

Total release size: 28.7 kB

Release files / pqblocks_anneal_sqa-0.1.0.tar.gz

Download URL pqblocks_anneal_sqa-0.1.0.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c7fc8602fcd615769f690c6a7510d512db0d2c3d59487649a0aac0c5d8a288bd
BLAKE2b-256 checksum
How to use checksums
841dfca2f4d0e024370985e4182cce62cfbca6b179c824e0c79237000a537c93
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_sqa-0.1.0-py3-none-any.whl

Download URL pqblocks_anneal_sqa-0.1.0-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96917200318cdb6b27aa08e7448a358bb690abeb26a8268437c9650480301bfa
BLAKE2b-256 checksum
How to use checksums
ca4bb782e10dc3f67acde1aa44059af0161c0d51dfb51495081f40a1d842ed24
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-sqa 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.

Release history Release notifications | RSS feed

This release

0.1.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