MultiStartOptimizer#
- class MultiStartOptimizer(trials=1, clip=100.0)[ソース]#
ベースクラス:
OptimizationAlgorithm
,ABC
An abstract class that implements multi start optimization and should be sub-classed by other optimizers.
Constructs an instance of this optimizer.
- パラメータ:
trials (int) – The number of trials for multi-start method. The first trial is solved with the initial guess of zero. If more than one trial is specified then initial guesses are uniformly drawn from
[lowerbound, upperbound]
with potential clipping.clip (float) – Clipping parameter for the initial guesses in the multi-start method. If a variable is unbounded then the lower bound and/or upper bound are replaced with the
-clip
orclip
values correspondingly for the initial guesses.
- 例外:
ValueError – if the variable trials has a value smaller than 1.
Attributes
- clip#
Returns the clip value for this optimizer.
- 戻り値:
The clip value.
- trials#
Returns the number of trials for this optimizer.
- 戻り値:
The number of trials.
Methods
- abstract get_compatibility_msg(problem)#
Checks whether a given problem can be solved with the optimizer implementing this method.
- パラメータ:
problem (QuadraticProgram) – The optimization problem to check compatibility.
- 戻り値:
Returns the incompatibility message. If the message is empty no issues were found.
- 戻り値の型:
- is_compatible(problem)#
Checks whether a given problem can be solved with the optimizer implementing this method.
- パラメータ:
problem (QuadraticProgram) – The optimization problem to check compatibility.
- 戻り値:
Returns True if the problem is compatible, False otherwise.
- 戻り値の型:
- multi_start_solve(minimize, problem)[ソース]#
Applies a multi start method given a local optimizer.
- パラメータ:
- 戻り値:
The result of the multi start algorithm applied to the problem.
- 戻り値の型:
- abstract solve(problem)#
Tries to solves the given problem using the optimizer.
Runs the optimizer to try to solve the optimization problem.
- パラメータ:
problem (QuadraticProgram) – The problem to be solved.
- 戻り値:
The result of the optimizer applied to the problem.
- 例外:
QiskitOptimizationError – If the problem is incompatible with the optimizer.
- 戻り値の型: