  We present families of quantum error-correcting codes which are optimal in
the sense that the minimum distance is maximal. These maximum distance
separable (MDS) codes are defined over q-dimensional quantum systems, where q
is an arbitrary prime power. It is shown that codes with parameters
[[n,n-2d+2,d]]_q exist for all 3 <= n <= q and 1 <= d <= n/2+1. We also present
quantum MDS codes with parameters [[q^2,q^2-2d+2,d]]_q for 1 <= d <= q which
additionally give rise to shortened codes [[q^2-s,q^2-2d+2-s,d]]_q for some s.
