The $XXXX$ and $ZZZZ$ are some stabilizers in the surface code. But how can we implement this in the circuit using qiskit?
The $XXXX$ and $ZZZZ$ are some stabilizers in the surface code. But how can we implement this in the circuit using qiskit?
In reality we cannot just directly apply a $XXXX$ or $ZZZZ$ stabilizers, so we have to implement them using single and two-qubit gates. This fig shows a simple example for a 4 qubit stablizer.
Here the $|abcd>$ state is your data qubits and you need to do the measurement on the ancilla qubit.
The idea behind it is that when the control qubit (now is the ancilla) is in a superposition state $|+\rangle=\frac{1}{2}(|0\rangle+|1\rangle)$, the phase from target qubits will be kickbacked to the target qubit. In the context of error correction/detection, if there is a bit flip error in any of the $|abcd\rangle$ qubits, the final measurement for the ancilla qubit will feel it.
This is the circuit for $XXXX$:
qc = QuantumCircuit(5,1)
# initial data qubits
qc.x(range(1,5))
qc.h(range(1,5))
qc.barrier()
# XXXX code
qc.h(0)
qc.cx(0,1)
qc.cx(0,2)
qc.cx(0,3)
qc.cx(0,4)
qc.h(0)
qc.measure(0,0)
qc.draw()
You can follow this implementation base on the paper arxiv.org/pdf/1404.3747.pdf