solve_qaoa
fireopal.solve_qaoa(problem, credentials, problem_type=None, backend_name=None, run_options=None)
Solve a QAOA problem.
Parameters
- problem (Expr or nx.Graph) – The QAOA problem definition, represented as either an nx.Graph or sympy.Expr.
- credentials (Credentials) – The credentials for running circuits on an IBM backend. Use the make_credentials_for_ibmq function from the credentials module to generate properly formatted credentials.
- problem_type (str , optional) – The class of QAOA problem to solve. Required for graph problem definitions, which currently only includes support for “maxcut”.
- backend_name (str , optional) – The backend device that should be used to run circuits. Defaults to None.
- run_options (RunOptions or None , optional) – Additional options for circuit execution. See the run_options module for classes to store run options for your desired provider. Defaults to None.
Returns
FireOpalJob – A job object containing results and warnings from the execution. The results have the following keys:
solution_bitstring (str)
: The solution bitstring with the bset cost found, across all iterations.
solution_bitstring_cost (float)
: The cost of the solution bitstring.
final_bitstring_distribution (dict[str, int])
: The bitstring counts dictionary associated with the minimum cost
across all iterations.
iteration_count (int)
: The total number of QAOA iterations performed by the optimizer.
variables_to_bitstring_index_map (dict[str, int])
: The mapping from the variables to the equivalent bit in the bitstring.
best_parameters (list[float])
: The optimized beta and gamma parameters across all iterations.
warnings (list[str])
: The warnings produced while compiling or running QAOA.