MinimizeProtocol¶
- class MinimizeProtocol¶
ベースクラス:
ProtocolProtocol for classical optimizers used to tune QAOA circuit parameters.
Implement this protocol to provide a custom classical optimizer. Assign an instance to
minimizeto replace the defaultScipyMinimize.Methods
- abstractmethod __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 returnNone.
- 戻り値:
The optimization result, or
Noneif dry_run isTrue.- 戻り値の型:
MinimizeResult | None
- __init__(*args, **kwargs)¶
- __protocol_attrs__ = {'__call__'}¶