QAOABenchmark#

class QAOABenchmark(benchmark_data, optimal_solution, cost_function)[source]#

This class is a wrapper for representing and evaluating the data collected in the .benchmark method.

Attributes
layer_depthlist[int]

The amount of QAOA layers for each run.

circuit_depthlist[int]

The depth of the compiled circuit of each run.

qubit_amountlist[int]

The amount of qubits of the compiled circuit of each run.

shotslist[int]

The amount of shots per backend call of each run.

iterationslist[int]

The amount of backend calls of each run.

countslist[dict]

The measurement results of the optimized circuit of each run.

runtimelist[float]

The amount of time passed (in seconds) of each run.

optimal_solution-

The optimal solution of the problem.

cost_functioncallable

The classical cost function of the benchmarked problem.

Methods#

QAOABenchmark.evaluate([cost_metric, ...])

Evaluates the data in terms of a cost and a gain metric.

QAOABenchmark.visualize([cost_metric, ...])

Plots the results of .evaluate.

QAOABenchmark.rank([metric, print_res, ...])

Ranks the runs of the benchmark according to a given metric.

QAOABenchmark.save(filename)

Saves the data to the harddrive for later use.

QAOABenchmark.load(filename)

Loads benchmark data from the harddrive that has been saved by .save.