# qiskit.optimization.algorithms.MultiStartOptimizer¶

class MultiStartOptimizer(trials=1, clip=100.0)[código fonte]

An abstract class that implements multi start optimization and should be sub-classed by other optimizers.

Constructs an instance of this optimizer.

Parâmetros
• 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 or clip values correspondingly for the initial guesses.

__init__(trials=1, clip=100.0)[código fonte]

Constructs an instance of this optimizer.

Parâmetros
• 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 or clip values correspondingly for the initial guesses.

Methods

 __init__([trials, clip]) Constructs an instance of this optimizer. get_compatibility_msg(problem) Checks whether a given problem can be solved with the optimizer implementing this method. is_compatible(problem) Checks whether a given problem can be solved with the optimizer implementing this method. multi_start_solve(minimize, problem) Applies a multi start method given a local optimizer. solve(problem) Tries to solves the given problem using the optimizer.

Attributes

 clip Returns the clip value for this optimizer. trials Returns the number of trials for this optimizer.
property clip

Returns the clip value for this optimizer.

Tipo de retorno

float

Retorna

The clip value.

abstract get_compatibility_msg(problem)

Checks whether a given problem can be solved with the optimizer implementing this method.

Parâmetros

problem (QuadraticProgram) – The optimization problem to check compatibility.

Tipo de retorno

str

Retorna

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.

Parâmetros

problem (QuadraticProgram) – The optimization problem to check compatibility.

Tipo de retorno

bool

Retorna

Returns True if the problem is compatible, False otherwise.

multi_start_solve(minimize, problem)[código fonte]

Applies a multi start method given a local optimizer.

Parâmetros
• minimize (Callable[[ndarray], Tuple[ndarray, Any]]) – A callable object that minimizes the problem specified

• problem (QuadraticProgram) – A problem to solve

Tipo de retorno

OptimizationResult

Retorna

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.

Parâmetros

problem (QuadraticProgram) – The problem to be solved.

Tipo de retorno

OptimizationResult

Retorna

The result of the optimizer applied to the problem.

Levanta

QiskitOptimizationError – If the problem is incompatible with the optimizer.

property trials

Returns the number of trials for this optimizer.

Tipo de retorno

int

Retorna

The number of trials.