La terminologia di "codice di superficie" è leggermente variabile. Potrebbe riferirsi a un'intera classe di cose, varianti del codice Toric su diversi reticoli, oppure potrebbe riferirsi al codice Planare, la variante specifica su un reticolo quadrato con condizioni al contorno aperte.
Il codice torico
Riassumo alcune delle proprietà di base del codice Toric. Immagina un reticolo quadrato con condizioni al contorno periodiche, ovvero il bordo superiore è unito al bordo inferiore e il bordo sinistro è unito al bordo destro. Se lo provi con un foglio di carta, troverai una forma a ciambella o toro. Su questo reticolo, posizioniamo un qubit su ciascun bordo di un quadrato.
stabilizzatori
Successivamente, definiamo un intero gruppo di operatori. Per ogni quadrato sul reticolo (comprendente 4 qubit al centro di ciascun bordo), scriviamo
agendo una rotazione di Pauli- X su ciascuno dei 4 qubit. L'etichetta p si riferisce a "plaquette", ed è solo un indice in modo da poter contare in seguito sull'intero set di placche. Su ogni vertice del traliccio (circondato da 4 qubits), definiamo
A s = Z Z Z Z .
Bp=XXXX,
XpAs=ZZZZ.
riferisce alla forma a stella e, di nuovo, ci farà riassumere su tutti questi termini.
s
Osserviamo che tutti questi termini si spostano reciprocamente. È banale per perché gli operatori di Pauli viaggiano con se stessi e io . È necessaria maggiore attenzione con [ A s , B p ] = 0 , nota bot che questi due termini hanno 0 o 2 siti in comune e coppie di operatori Pauli diversi commutano, [ X X , Z Z ] = 0[As,As′]=[Bp,Bp′]=0I[As,Bp]=0[XX,ZZ]=0.
Codespace
|ψ⟩
∀s:As|ψ⟩=|ψ⟩∀p:Bp|ψ⟩=|ψ⟩.
Questo definisce lo spazio del codice del codice. Dovremmo determinare quanto è grande.
N×NN22N2N2AsBp±1A2s=B2p=I che questo definisca in modo univoco un stato.
∏sAs=∏pBp=I: each qubit is included in two stars and two plaquettes. This means that one of the As and one of the Bp is linearly dependent on all the others, and does not further reduce the size of the Hilbert space. In other words, the stabilizer relations define a Hilbert space of dimension 4; the code can encode two qubits.
Logical Operators
How do we encode a quantum state in the Toric code? We need to know the logical operators: X1,L, Z1,L, X2,L and Z2,L. All four must commute with all the stabilizers, and be linearly independent from them, and must generate the algebra of two qubits. Commutation of operators on the two different logical qubits:
[X1,L,X2,L]=0[X1,L,Z2,L]=0[Z1,L,Z2,L]=0[Z1,L,X2,L]=0
and anti-commutation of the two on each qubit:
{X1,L,Z1,L}=0{X2,L,Z2,L}=0
There's a couple of different conventions for how to label the different operators. I'll go with my favourite (which is probably the less popular):
Take a horizontal line on the lattice. On every qubit, apply Z. This is Z1,L. In fact, any horizontal line is just as good.
Take a vertical line on the lattice. On every qubit, apply Z. This is X2,L (the other convention would label it as Z2,L)
Take a horizontal strip of qubits, each of which is in the middle of a vertical edge. On every qubit, apply X. This is Z2,L.
Take a vertical strip of qubits, each of which is in the middle of a horizontal edge. On every qubit, apply X. This is X1,L.
You'll see that the operators that are supposed to anti-commute meet at exactly one site, with an X and a Z.
Ultimately, we define the logical basis states of the code by
|ψx,y⟩:Z1,L|ψx,y⟩=(−1)x|ψx,y⟩,Z2,L|ψx,y⟩=(−1)y|ψx,y⟩
The distance of the code is N because the shortest sequence of single-qubit operators that converts between two logical states constitutes N Pauli operators on a loop around the torus.
Error Detection and Correction
Once you have a code, with some qubits stored in the codespace, you want to keep it there. To achieve this, we need error correction. Each round of error correction comprises measuring the value of every stabilizer. Each As and Bp gives an answer ±1. This is your error syndrome. It is then up to you, depending on what error model you think applies to your system, to determine where you think the errors have occurred, and try to fix them. There's a lot of work going on into fast decoders that can perform this classical computation as efficiently as possible.
One crucial feature of the Toric code is that you do not have to identify exactly where an error has occurred to perfectly correct it; the code is degenerate. The only relevant thing is that you get rid of the errors without implementing a logical gate. For example, the green line in the figure is one of the basic errors in the system, called an anyone pair. If the sequence of X rotations depicted had been enacted, than the stabilizers on the two squares with the green blobs in would have given a −1 answer, while all others give +1. To correct for this, we could apply X along exactly the path where the errors happened, although our error syndrome certainly doesn't give us the path information. There are many other paths of X errors that would give the same syndrome. We can implement any of these, and there are two options. Either, the overall sequence of X rotations forms a trivial path, or one that loops around the torus in at least on direction. If it's a trivial path (i.e. one that forms a closed path that does not loop around the torus), then we have successfully corrected the error. This is at the heart of the topological nature of the code; many paths are equivalent, and it all comes down to whether or not these loops around the torus have been completed.
Error Correcting Threshold
While the distance of the code is N, it is not the case that every combination of N errors causes a logical error. Indeed, the vast majority of N errors can be corrected. It is only once the errors become of much higher density that error correction fails. There are interesting proofs that make connections to phase transitions or the random bond Ising model, that are very good at pinning down when that is. For example, if you take an error model where X and Z errors occur independently at random on each qubit with probability p, the threshold is about p=0.11, i.e. 11%. It also has a finite fault-tolerant threshold (where you allow for faulty measurements and corrections with some per-qubit error rate)
The Planar Code
Details are largerly identical to the Toric code, except that the boundary conditions of the lattice are open instead of periodic. This mens that, at the edges, the stabilizers get defined slightly differently. In this case, there is only one logical qubit in the code instead of two.