Quantum channels with memory (19 pages)