supermarq.benchmarks.vqe_proxy
Classes
Proxy benchmark of a full VQE application that targets a single iteration |
Module Contents
- class supermarq.benchmarks.vqe_proxy.VQEProxy(num_qubits: int, num_layers: int = 1)
Bases:
supermarq.benchmark.BenchmarkProxy benchmark of a full VQE application that targets a single iteration of the whole variational optimization.
The benchmark is parameterized by the number of qubits, n. For each value of n, we classically optimize the ansatz, sample 3 iterations near convergence, and use the sampled parameters to execute the corresponding circuits on the QPU. We take the measured energies from these experiments and average their values and compute a score based on how closely the experimental results are to the noiseless values.
- circuit() list[cirq.Circuit]
Construct a parameterized ansatz.
The counts obtained from evaluating these two circuits should be passed to score in the same order they are returned here.
- Returns:
the ansatz measured in the Z basis, and the ansatz measured in the X basis.
- Return type:
A list of circuits for the VQE benchmark
- score(counts: list[dict[str, float]]) float
Compare the average energy measured by the experiments to the ideal value.
The ideal value is obtained via noiseless simulation. In principle the ideal value can be obtained through efficient classical means since the 1D TFIM is analytically solvable.
- Parameters:
counts – A dictionary containing the measurement counts from circuit execution.
- Returns:
The VQE proxy benchmark score.
- hamiltonian
- num_layers
- num_qubits