VQEBenchmark#

class VQEBenchmark(benchmark_data, optimal_energy, hamiltonian)[source]#

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

Attributes:
layer_depthlist[int]

The amount of VQE 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.

energylist[dict]

The energy of the problem Hamiltonian for the optimized ciruits for each run.

runtimelist[float]

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

optimal_energyfloat

The exact ground state energy of the problem Hamiltonian.

hamiltonianQubitOperator

The problem Hamiltonian.

Methods#

VQEBenchmark.evaluate([cost_metric, gain_metric])

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

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

Plots the results of .evaluate.

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

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

VQEBenchmark.save(filename)

Saves the data to the harddrive for later use.

VQEBenchmark.load(filename)

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