qrisp.vqe.VQEBenchmark.save#

VQEBenchmark.save(filename)[source]#

Saves the data to the harddrive for later use.

Parameters:
filenamestring

The filename where to save the data.

Examples

We create a Heisenberg problem and benchmark several parameters:

from networkx import Graph
G =Graph()
G.add_edges_from([(0,1),(1,2),(2,3),(3,4)])

from qrisp.vqe.problems.heisenberg import *

vqe = heisenberg_problem(G,1,0)
H = create_heisenberg_hamiltonian(G,1,0)

benchmark_data = vqe.benchmark(qarg = QuantumVariable(5),
                    depth_range = [1,2,3],
                    shot_range = [5000,10000],
                    iter_range = [25,50],
                    optimal_energy = H.ground_state_energy(),
                    repetitions = 2
                    )

To save the results, we call the according method.

benchmark_data.save("example.vqe")