Quantum algorithms and the power of forgetting