  We introduce a quantum algorithm to efficiently prepare states with a small
energy variance at the target energy. We achieve it by filtering a product
state at the given energy with a Lorentzian filter of width $\delta$. Given a
local Hamiltonian on $N$ qubits, we construct a parent Hamiltonian whose ground
state corresponds to the filtered product state with variable energy variance
proportional to $\delta\sqrt{N}$. We prove that the parent Hamiltonian is
gapped and its ground state can be efficiently implemented in
$\mathrm{poly}(N,1/\delta)$ time via adiabatic evolution. We numerically
benchmark the algorithm for a particular non-integrable model and find that the
adiabatic evolution time to prepare the filtered state with a width $\delta$ is
independent of the system size $N$. Furthermore, the adiabatic evolution can be
implemented with circuit depth $\mathcal{O}(N^2\delta^{-4})$. Our algorithm
provides a way to study the finite energy regime of many body systems in
quantum simulators by directly preparing a finite energy state, providing
access to an approximation of the microcanonical properties at an arbitrary
energy.
