Algorithms and Spectral Gaps for Quantum Problems