We propose a quantum algorithm to compute low-energy expectation values of a quantum Hamiltonian by sampling a partition function associated with the average energy of that Hamiltonian. For any given quantum circuit-Hamiltonian pair, there is an associated average energy. The sampling is done through an accept/reject Metropolis-style algorithm on the quantum gates of the circuit itself. Observables calculated under the canonical ensemble from these samples of circuits are extrapolated from higher energies to the ground state.
We propose a quantum algorithm to compute low-energy expectation values of a quantum Hamiltonian by sampling a partition function associated with the average energy of that Hamiltonian. For any given quantum circuit-Hamiltonian pair, there is an associated average energy. The sampling is done through an accept/reject Metropolis-style algorithm on the quantum gates of the circuit itself. Observables calculated under the canonical ensemble from these samples of circuits are extrapolated from higher energies to the ground state.
We construct a measurement-based quantum extension of a rejection-free classical Metropolis algorithm to sample expectation values of observables for quantum Hamiltonians at thermal equilibrium. Observable measurements are incorporated into a thermalizing quantum Markov chain to avoid disturbing it. Our use of Hamiltonian simulation for Gaussian-filtered quantum phase estimation sets a thermalization timescale inversely proportional to temperature. The rejection-free classical algorithm artificially mimics a quantum limitation of indirect access to stationary states of the Hamiltonian.
Measuring expectation values of observables is an essential ingredient in variational quantum algorithms. A practical obstacle is the necessity of a large number of measurements for statistical convergence to meet requirements of precision, such as chemical accuracy in the application to quantum chemistry computations. Here we propose an algorithm to estimate the expectation value based on its approximate expression as a weighted sum of classically tractable matrix elements with some modulation, where the weight and modulation factors are evaluated by sampling appropriately prepared quantum states in the computational basis on quantum computers. Each of those states is prepared by applying a unitary transformation consisting of at most N CNOT gates, where N is the number of qubits, to a target quantum state whose expectation value is evaluated. Our algorithm is expected to require fewer measurements than conventional methods for a required statistical precision of the expectation value when the target quantum state is concentrated in particular computational basis states. We provide numerical comparisons of our method with existing ones for measuring electronic ground-state energies (expectation values of electronic Hamiltonians for the lowest-energy states) of various small molecules. Numerical results show that our method can reduce the numbers of measurements to obtain the ground-state energies for a targeted precision by several orders of magnitudes for molecules whose ground states are concentrated. Our results provide another route to measure expectation values of observables, which could accelerate the variational quantum algorithms.
Randomized protocols are procedures that incorporate probabilistic choices during their execution and they play a central role in quantum algorithms, spanning Hamiltonian simulation, noise mitigation, and measurement tasks. In practical implementations, the dominant cost of such protocols typically arises from circuit execution and measurement, and depends on hardware-specific resources such as gate counts, circuit depth, runtime, or dissipated energy. We introduce a general framework for applying classical importance sampling to randomized quantum protocols. Given a cost function for running quantum circuits, the proposed approach minimizes a net-cost figure of merit that jointly captures the computational expense per circuit and the estimator variance. We further extend the framework to scenarios where the quantum computation is subject to errors arising either from algorithmic approximations or from physical noise, proving that importance sampling preserves estimator bias despite altering the sampling distribution, and to settings with error-detection schemes, where we characterize the resulting changes in the optimal sampling strategy and achievable net-cost reduction. Representative applications include the Qdrift protocol, dephasing channels, mixed-states simulation, composite observables estimation, classical shadows, and probabilistic error cancellation. Overall, our results establish a principled approach for reducing the computational resources required by randomized quantum protocols through classical sampling optimization.
We describe an algorithm for using a quantum computer to calculate mean values of observables and the partition function of a quantum system. Our algorithm includes two sub-algorithms. The first sub-algorithm is for calculating, with polynomial efficiency, certain diagonal matrix elements of an observable. This sub-algorithm is performed on a quantum computer, using quantum phase estimation and tomography. The second sub-algorithm is for sampling a probability distribution. This sub-algorithm is not polynomially efficient. It can be performed either on a classical or a quantum computer, but a quantum computer can perform it quadratically faster.
Estimating properties of quantum states, such as fidelities, molecular energies, and correlation functions, is a fundamental task in quantum information science. Due to the limitation of practical quantum devices, including limited circuit depth and connectivity, estimating even linear properties encounters high sample complexity. To address this inefficiency, we propose a framework that optimizes sample complexity for estimating the expectation value of any observable using a shallow parameterized quantum circuit. Within this framework, we introduce two decomposition algorithms, a tensor network approach and a greedy projection approach that decompose the target observable into a linear combination of multiple observables, each of which can be diagonalized with the shallow circuit. Using this decomposition, we then apply an importance sampling algorithm to estimate the expectation value of the target observable. We numerically demonstrate the performance of our algorithm by estimating the expectation values of some specific Hamiltonians and inner product of a Slater determinant with a pure state, highlighting advantages compared to some conventional methods. Additionally, we derive the fundamental lower bound for the sample complexity required to estimate a target observable using a given shallow quantum circuit, thereby enhancing our understanding of the capabilities of shallow circuits in quantum learning tasks.
Efficient sampling from ensembles of Hamiltonian cycles is critical for predicting the thermodynamic properties of compact polymers, with applications including modeling protein and RNA folding and designing soft materials. Although classical Monte Carlo methods are widely regarded as the standard approach, their efficiency is strongly limited when applied to compact polymers. In this work, we enable a quadratic speedup in the estimation of thermodynamic properties of maximally compact polymers and heteropolymers by quantum computation. To this end, we encode the target thermodynamic ensemble into the amplitudes of a quantum state, i.e., a quantum sample, which can be processed via amplitude amplification. Using quantum equational reasoning, we construct a local parent Hamiltonian whose unique ground state realizes a quantum sample of all Hamiltonian cycles. This state can be prepared on quantum hardware using ground-state preparation methods, such as quantum annealing, and subsequently manipulated to generate quantum samples of polymers and heteropolymers at a target temperature. Finally, we approximate the quantum sample as a tensor network, revealing an entanglement area law. For fixed-width rectangular lattices, we obtain a time-efficient and compact encoding of the full ensemble of Hamiltonian cycles, enabling the efficient evaluation of expectation values, partition functions, and configuration probabilities via tensor contractions, without resorting to sampling.