  We propose a variational quantum algorithm for estimating microcanonical
expectation values in models obeying the eigenstate thermalization hypothesis.
Using a relaxed criterion for convergence of the variational optimization loop,
the algorithm generates weakly entangled superpositions of eigenstates at a
given target energy density. An ensemble of these variational states is then
used to estimate microcanonical averages of local operators, with an error
whose dominant contribution decreases initially as a power law in the size of
the ensemble and is ultimately limited by a small bias. We apply the algorithm
to the one-dimensional mixed-field Ising model, where it converges for ansatz
circuits of depth roughly linear in system size. The most accurate thermal
estimates are produced for intermediate energy densities. In our error
analysis, we find connections with recent works investigating the underpinnings
of the eigenstate thermalization hypothesis. In particular, the failure of
energy-basis matrix elements of local operators to behave as
\textit{independent} random variables is a potential source of error that the
algorithm can overcome by averaging over an ensemble of variational states.
