Let me try to give you the answer in just the right amount of generality. A quantum code is just a short way to say a quantum error-correcting code. It is a special embedding of one vector space into another larger one that satisfies some additional properties. If we start with a Hilbert space H, then a code is a decomposition into H=(A⊗B)⊕C. The quantum information is encoded into system A. In the event that B is trivial, then indeed this is just a subspace of H. When B is nontrivial, we say call it a subsystem code. Let's specialize to the case of n qubits, so that H=(C2)⊗n, and it is easiest to imagine that the dimensions of A, B, and C are all powers of 2, though of course this discussion could be generalized.
Let P be the orthogonal projector onto A⊗B, and let E be an arbitrary quantum channel, i.e. a completely positive trace preserving linear map. We say that E is recoverable if there exists another quantum channel R such that for all states ρA⊗ρB, we have
R∘E(ρA⊗ρB)=ρA⊗ρ′B,
where
ρ′B is arbitrary. This says that for any state which is supported on
A⊗B and is initially separable, we can reverse the effects of
E up to a change on system
B.
Fortunately, there are simpler equivalent conditions that one can check instead. For example, an equivalent condition can be stated in terms of the Kraus operators Ej for the channel E. The subsystem A is correctable for E(ρ)=∑jEjρE†j if an only if for all i,j, there exists a gijB on subsystem B such that
PE†iEjP=1lA⊗gijB.
You can interpret this condition as saying that no error process associated to the channel
E can gain any information about subsystem
A.
Consider error channels which consist of Kraus operators that, when expanded in the Pauli basis, only have support on at most d of the n qubits in our Hilbert space. If every such channel is correctable for subsystem A, then we say our code has distance d. The largest such d is called the distance of the code. For the toric code, this is the linear size of the lattice.
This post imported from StackExchange Physics at 2014-04-05 17:30 (UCT), posted by SE-user Steve Flammia