MinimizeProtocol

class MinimizeProtocol

ベースクラス: Protocol

Protocol for classical optimizers used to tune QAOA circuit parameters.

Implement this protocol to provide a custom classical optimizer. Assign an instance to minimize to replace the default ScipyMinimize.

Methods

abstract __call__(func: Callable[[list[float]], float], num_parameters: int, *, dry_run: bool = False) MinimizeResult | None

Run the classical optimization.

パラメータ:
  • func (Callable[[list[float]], float]) -- Objective function that maps a list of circuit parameters to a scalar cost.

  • num_parameters (int) -- Number of variational parameters to optimize.

  • dry_run (bool) -- If True, validate inputs without running the optimizer and return None.

戻り値:

The optimization result, or None if dry_run is True.

戻り値の型:

MinimizeResult | None

__init__(*args, **kwargs)