qrisp.qaoa.QAOAProblem.run#

QAOAProblem.run(qarg, depth, mes_kwargs={}, max_iter=50, init_type='random')[source]#

Run the specific QAOA problem instance with given quantum arguments, depth of QAOA circuit, measurement keyword arguments (mes_kwargs) and maximum iterations for optimization (max_iter).

Parameters:
qargQuantumVariable

The quantum variable to which the QAOA circuit is applied.

depthint

The depth of the QAOA circuit.

mes_kwargsdict, optional

The keyword arguments for the measurement function. Default is an empty dictionary.

max_iterint, optional

The maximum number of iterations for the optimization method. Default is 50.

init_typestring, optional

Specifies the way the initial optimization parameters are chosen. Available are random and TQA. The default is random.

Returns:
opt_resdict

The optimal result after running QAOA problem for a specific problem instance. It contains the measurement results after applying the optimal QAOA circuit to the quantum variable.