supermarq.benchmarks.vqe_proxy ============================== .. py:module:: supermarq.benchmarks.vqe_proxy Classes ------- .. autoapisummary:: supermarq.benchmarks.vqe_proxy.VQEProxy Module Contents --------------- .. py:class:: VQEProxy(num_qubits: int, num_layers: int = 1) Bases: :py:obj:`supermarq.benchmark.Benchmark` Proxy 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. .. py:method:: 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. :rtype: A list of circuits for the VQE benchmark .. py:method:: 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. :param counts: A dictionary containing the measurement counts from circuit execution. :returns: The VQE proxy benchmark score. .. py:attribute:: hamiltonian :value: [] .. py:attribute:: num_layers :value: 1 .. py:attribute:: num_qubits