  We address the question of a quantum memory storage of quantum dynamics. In
particular, we design an optimal protocol for $N\to 1$ probabilistic
storage-and-retrieval of unitary channels on $d$-dimensional quantum systems.
If we may access the unknown unitary gate only $N$-times, the optimal success
probability of perfect retrieval of its single use is $N/(N-1+d^2)$. The
derived size of the memory system exponentially improves the known upper bound
on the size of the program register needed for probabilistic programmable
quantum processors. Our results are closely related to probabilistic perfect
alignment of reference frames and probabilistic port-based teleportation.
