WarmStartQAOAFactory#

class WarmStartQAOAFactory(epsilon)[source]#

Bases: object

A factory that produces quantum circuits for the QAOA implementation. The methods of this factory can be overridden to modify behavior of QAOA. This implementation generates quantum circuits for initial state and mixer to warm start QAOA.

Parameters:

epsilon (float) – the regularization parameter that changes the initial variables according to xi = epsilon if xi < epsilon xi = 1-epsilon if xi > epsilon. The regularization parameter epsilon should be between 0 and 0.5. When it is 0.5 then warm start corresponds to standard QAOA.

Raises:

QiskitOptimizationError – if epsilon is not in the range [0, 0.5].

Methods

create_initial_state(initial_variables)[source]#

Creates an initial state quantum circuit to warm start QAOA.

Parameters:

initial_variables (List[float]) – Already created initial variables.

Returns:

A quantum circuit that represents initial state.

Return type:

QuantumCircuit

create_initial_variables(solution)[source]#

Creates initial variable values to warm start QAOA.

Parameters:

solution (ndarray) – a solution obtained for the relaxed problem.

Returns:

A list of initial variables constructed from a relaxed solution.

Return type:

List[float]

create_mixer(initial_variables)[source]#

Creates an evolved mixer circuit as Ry(theta)Rz(-2beta)Ry(-theta).

Parameters:

initial_variables (List[float]) – Already created initial variables.

Returns:

A quantum circuit to be used as a mixer in QAOA.

Return type:

QuantumCircuit