Algorithmic quantum simulation of memory effects