Skip to main content

Anneal

Anneal

Start here. Bound-constrained global optimization with a single budget knob, or classical simulated-annealing presets you can swap without rewriting a driver.

Simulated-annealing components on the eindir typed primitives. One surface, many drivers: classical presets, Bayesian pilot+mixer, generalized Langevin equation (GLE) colored noise, rank-1 additive independence, quasi-Monte Carlo (QMC) polish, device/ensemble scale. All obey the same five-component algebra (Obj / Cool / Neigh / Move / Accept) and four composition laws checked at construction.

Docs https://anneal.rgoswami.me
License MIT
Software DOI https://zenodo.org/doi/10.5281/zenodo.10672746
Paper reproducibility https://github.com/HaoZeke/anneal_repro — Zenodo 10.5281/zenodo.20672621
History Continuous development since 2023-02 (see git log); multi-author CITATION.cff

Install

pip install anneal

Full stack (pinned Rust + Python + docs):

pixi install

Start here (budget-only portfolio)

The intended stand-alone tool for most users: pass an objective, box bounds, and a work-unit budget (objective and gradient evaluations share the counter).

import numpy as np
from anneal import global_optimize

def rastrigin(x):
    return 10.0 * len(x) + np.sum(x * x - 10.0 * np.cos(2.0 * np.pi * x))

low, high = np.full(5, -5.0), np.full(5, 5.0)
out = global_optimize(rastrigin, low, high, budget=4000, seed=0)
print(out["best_val"], out["best_pos"])

Runnable copies:

Classical presets (same driver, different slots)

from anneal import Boltzmann, Fast, Gsa, run

h = run(rastrigin, low, high, Boltzmann(t_init=5.0, sigma=0.5),
        n_epochs=40, steps_per_epoch=50, seed=1)
print(h.best_val)

Optional arms (additive independence + QMC polish)

import numpy as np
from anneal import additive_independence, qmc_polish

def rastrigin(x):
    return 10.0 * len(x) + np.sum(x*x - 10.0 * np.cos(2.0 * np.pi * x))

def grad_rastrigin(x):
    return 2.0 * x + 20.0 * np.pi * np.sin(2.0 * np.pi * x)

low = np.full(5, -5.0)
high = np.full(5, 5.0)

# Values-only rank-1 independence (no gradient)
res = additive_independence(rastrigin, low, high, max_fevals=3000, seed=7)

# Polish with gradient
refined = qmc_polish(rastrigin, grad_rastrigin, low, high,
                     n_starts=32, max_fevals_per_start=50, seed=0, top_k=1)
print(refined["best_val"])

Full docs, tutorials (classical, Bayesian pilot+mixer, GLE, polish+device), algebra, how-tos, and reference at https://anneal.rgoswami.me .

Development

pixi install
pixi run -e python python-test
pixi run -e docs docs-export
pixi run -e docs docs-build

See pixi.toml and docs/export.el (modeled on rgpycrumbs/rsx-rs patterns).

License and citation

MIT (see LICENSE.txt). Citation: CITATION.cff or the software Zenodo DOI. Multi-author software citation lists six authors. Project history since February 2023. Reproducibility package for paper tables and figures: HaoZeke/anneal_repro (Zenodo 10.5281/zenodo.20672621).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anneal-0.7.2.tar.gz (3.5 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

anneal-0.7.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

anneal-0.7.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (962.6 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

anneal-0.7.2-cp310-abi3-macosx_11_0_arm64.whl (910.8 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

anneal-0.7.2-cp310-abi3-macosx_10_12_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file anneal-0.7.2.tar.gz.

File metadata

  • Download URL: anneal-0.7.2.tar.gz
  • Upload date:
  • Size: 3.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for anneal-0.7.2.tar.gz
Algorithm Hash digest
SHA256 ce56879b4135df9c5eed1f85a6d0d86ad0379b9ab6c2b9e4ecc45c49c231348e
MD5 f4857d5512a808815b8b90d81308b59c
BLAKE2b-256 0a3ef6873302492ff28bdbf8baa51e34d6466c8cda5a5f13e30f5c4821d9458a

See more details on using hashes here.

Provenance

The following attestation bundles were made for anneal-0.7.2.tar.gz:

Publisher: release.yml on HaoZeke/anneal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anneal-0.7.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for anneal-0.7.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c738b327ef870fcacdda11e9aac6e5a4051ade2e8417dc2ff1623fd9d0fe6fbb
MD5 ee449611df507359b7fd6f64f81dae66
BLAKE2b-256 d409a5ce3021c0133fa2a81954c8ab31ecc8bf2f9f7e569393bd880f5154242e

See more details on using hashes here.

Provenance

The following attestation bundles were made for anneal-0.7.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on HaoZeke/anneal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anneal-0.7.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for anneal-0.7.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ab7ef967605c9508fd4baf33129944f9e2f09f494d36eef5369141e5b9922141
MD5 7a81e269bc4db0f279672e40fd6ca6dd
BLAKE2b-256 89c7babe8b49fb8d117729f1dbbeb6fd0939ddf7b2ad1e4c36a3032ff2d96b6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for anneal-0.7.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on HaoZeke/anneal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anneal-0.7.2-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for anneal-0.7.2-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5c6d76c6e29c050361ef746eace9b33c0d06e8a92840172e57a04ec79417978f
MD5 4f9e08c9cb86386c8bcfb03e04c181b4
BLAKE2b-256 7732f8303541602f5097d15d7134b5ef03bc3da9afe5db3825dd6ee27865e3da

See more details on using hashes here.

Provenance

The following attestation bundles were made for anneal-0.7.2-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on HaoZeke/anneal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anneal-0.7.2-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for anneal-0.7.2-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 87216b9dad8a9787468a57476039f5341a71561dd3d4c38a852723005a711e80
MD5 870f1ac483969ba5102080a98058776b
BLAKE2b-256 da3f6d61d5858e0809976d7ff0d18d0078c994122bb053c362bca480b7b703f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for anneal-0.7.2-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on HaoZeke/anneal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page