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.1.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.1-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.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (961.2 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

anneal-0.7.1-cp310-abi3-macosx_11_0_arm64.whl (911.4 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

anneal-0.7.1-cp310-abi3-macosx_10_12_x86_64.whl (996.2 kB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for anneal-0.7.1.tar.gz
Algorithm Hash digest
SHA256 666277b79f2ad0b1ee07f74c4ee02844379239fb917216db70bc906d9a4cb8ad
MD5 83b14fd35057ac9dfd8766ee74a7d01b
BLAKE2b-256 7ed00c8a0b889a87592e0e68d23d67b449abb57d79a4591472c04f9c9967ec80

See more details on using hashes here.

Provenance

The following attestation bundles were made for anneal-0.7.1.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.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for anneal-0.7.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3e64cc9904091ddb832c0dfcb782af82d2f50d0817e48a3fa6116da8e6c27ea5
MD5 d11aa0f7ed7e3c1b4d83c8d39450acc0
BLAKE2b-256 8fe5b26eabb2ce1bb7e1fa69a7641a615d27305378dc0887e61271a0ec5f1531

See more details on using hashes here.

Provenance

The following attestation bundles were made for anneal-0.7.1-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.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for anneal-0.7.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d8ab6483cf48c420809c0e4124bdb1626b2cc8b4b5542ed21fe7e60be8c849a6
MD5 963745bbba8f1680d6a7f18cbf106245
BLAKE2b-256 07975cbde141ab36fa96498bd032bbcdf6bd25e76abcfb6d2eafaf697096fe23

See more details on using hashes here.

Provenance

The following attestation bundles were made for anneal-0.7.1-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.1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for anneal-0.7.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9e5606f47ff40ceec96947599484e275ddafa5e0cafbf6ff5453658ed8f8a37a
MD5 6917a9372bec9973d0ba5a6205eea3e7
BLAKE2b-256 f2fa2b392ce2ece80f57fd927424dea2d8a6a5102ecdaff197bb7010443b5830

See more details on using hashes here.

Provenance

The following attestation bundles were made for anneal-0.7.1-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.1-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for anneal-0.7.1-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9d90ada7cbdc936b07ec9668af4661cec03f9a30de596e6b73de3f80fb752b37
MD5 0943e8a5a4f71716ddec744647750884
BLAKE2b-256 d9c7d0d2c8d4c270d1243bb6c82ae9d6a0fc35a60c6a1b2b54311876ccccf485

See more details on using hashes here.

Provenance

The following attestation bundles were made for anneal-0.7.1-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