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.6.0.tar.gz (3.4 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.6.0-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.6.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (948.7 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

anneal-0.6.0-cp310-abi3-macosx_11_0_arm64.whl (886.2 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

anneal-0.6.0-cp310-abi3-macosx_10_12_x86_64.whl (960.5 kB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for anneal-0.6.0.tar.gz
Algorithm Hash digest
SHA256 52b3d74b06e8ecc90a40f93e36178c1905b0082efd893554c096f69d93614b5f
MD5 a5eb8016563042c3774266b4796c689a
BLAKE2b-256 411e4550c2d441a2007ba2088779350f0e5c430142b7c073b10230ea4f9dd29f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for anneal-0.6.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 da8e3fc4c41f10130012877c8d9c27db54098a45c845d244694a6d5d914781ca
MD5 1e5af0d7bf89d4bdff42b99e4727c5e4
BLAKE2b-256 885272b8c9ea06d0b4d6bfb117c5cc2ab3c14f34ac7245894606d21959e28408

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for anneal-0.6.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8dda0f2d27b0cdc1b696304fa0458ce2dd921d29a845297dde28a2648af61e5a
MD5 be0612579b5b169e67e7d0623414405f
BLAKE2b-256 bbadb1e33f452a4fc3bcfb7b2d542fe110edf3630a9970685f68ed4cbe3523db

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for anneal-0.6.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4395290f39541e3c56d3fa3d17f74e3d42d436dabd4d46006b0bf469ec16e4f5
MD5 672fc8c8a3dcb5524d27c24c9f1d8701
BLAKE2b-256 1604aa768b8579fa2f3a30dcf60818dcd81d4468f9cdbe4fd0739d702d34c74c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for anneal-0.6.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 df5b58a4de1539d24a7c7d8d72a62d37482b2b2cf4d225103b798c4af3be1bee
MD5 2904c274255729b95f504a28a52a058c
BLAKE2b-256 5eea6563e8c1a878ae97e4593e9752e187b589c994f0d753f421da6b91420ccb

See more details on using hashes here.

Provenance

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