Skip to main content

Amplify-BBOpt

Amplify-BBOpt is a powerful Python package by Fixstars Amplify, designed to streamline the implementation and execution of black-box optimization algorithms.

Features

Amplify-BBOpt is built upon the powerful Amplify SDK, bridging the gap between black-box optimization and specialized hardware. It uniquely offers annealing-based optimization methods, including Factorization Machine Quantum Annealing (FMQA) and Kernel-QA, which are designed to run on quantum annealers and various Ising machine backends.

  • Intuitive API: A clean, straightforward interface enables rapid experimentation and allows users to easily swap between different optimization methods.
  • High-Dimensional Scalability: Engineered to effectively solve complex optimization problems, even those with a high-dimensional parameter space.
  • Built-in Constraint Handling: Natively supports both unconstrained and constrained optimization problems, providing a versatile framework for real-world applications.

Basic Usage

from amplify import AmplifyAEClient

from amplify_bbopt import FMTrainer, Optimizer, RealVariable, blackbox


# Define a test function
# (This represents a simulation or experiment)
def spherical_func(a: float, b: float) -> float:
    return (a + 1) ** 2 + (b - 1) ** 2


# Make a black-box function and define relevant decision variables
@blackbox
def bb_func(
    a: float = RealVariable((-5, 5)),  # type: ignore
    b: float = RealVariable((-5, 5)),  # type: ignore
) -> float:
    return spherical_func(a, b)


# Prepare solver client
client = AmplifyAEClient()
client.parameters.time_limit_ms = 1000

# Execute optimization
opt = Optimizer(bb_func, FMTrainer(), client)
opt.add_random_training_data(num_data=5)
opt.optimize(num_iterations=10)

# View results
print(opt.best.objective)
print(opt.best.values)

For Developers

Amplify-BBOpt requires Python 3.10 or later. Also, it depends on amplify and torch packages, which can be installed via pip. After installing the dependencies, you can install Amplify-BBOpt in editable mode.

$ pip install -e amplify-bbopt

Instead, we recommend using uv for managing the development environment and running tests.

$ uv sync

Testing:

$ uv run pytest

Download files

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

Source Distribution

amplify_bbopt-1.2.1.tar.gz (30.1 kB view details)

Uploaded Source

Built Distribution

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

amplify_bbopt-1.2.1-py3-none-any.whl (33.8 kB view details)

Uploaded Python 3

File details

Details for the file amplify_bbopt-1.2.1.tar.gz.

File metadata

  • Download URL: amplify_bbopt-1.2.1.tar.gz
  • Upload date:
  • Size: 30.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for amplify_bbopt-1.2.1.tar.gz
Algorithm Hash digest
SHA256 f32491565b77757105c4ffd115b7bac311a60c0a9eb800a52e1c537ba60b4316
MD5 0e438a583cba026fe20cc0472613c8e0
BLAKE2b-256 9cc015cecf640ccebd736150cc8cdd9a6c21c7ffd53100f1bcaf247dc4dc351c

See more details on using hashes here.

File details

Details for the file amplify_bbopt-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: amplify_bbopt-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 33.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for amplify_bbopt-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2c7f227640dc58547668b0f0c787b41b86b873e3c901ffb5879f8d6316ef4a75
MD5 2ddf78ff6341761b8485a379b035d1ec
BLAKE2b-256 b74a48319dd50fa072228c0e39bb4a02f303e78a9d4d1fe54bbdd48202026e53

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 files

1.2.0

2 files

1.1.0

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

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