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 the amplify package, 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

Release files for amplify-bbopt 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for amplify-bbopt 1.3.0
File Interpreter ABI Platform
amplify_bbopt-1.3.0-py3-none-any.whl Python 3 none any Details

Release files / amplify_bbopt-1.3.0-py3-none-any.whl

Download URL amplify_bbopt-1.3.0-py3-none-any.whl
Size 41.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a18ae4b0f7eb5bdafcfdfbc0accc82956a3ad5a8f82432f42ee114fce1169d0
BLAKE2b-256 checksum
How to use checksums
1f3ab93b8213ad08cc00bdb5849224e39bc1d28da9f4c417d95e6a053e207c4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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}

Release history Release notifications | RSS feed

This release

1.3.0 This release

1 release file

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release 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