• Members 4 posts
    Oct. 8, 2021, 1:29 a.m.

    The $XXXX$ and $ZZZZ$ are some stabilizers in the surface code. But how can we implement this in the circuit using qiskit?

  • Members 22 posts
    Oct. 8, 2021, 1:41 a.m.

    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.
    2021-10-08 01.41.40.jpg

    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()
    
    

    2021-10-08 01.45.31.jpg

    You can follow this implementation base on the paper arxiv.org/pdf/1404.3747.pdf

    2021-10-08 01.45.31.jpg

    JPG, 31.5 KB, uploaded by Meng on Oct. 8, 2021.

    2021-10-08 01.41.40.jpg

    JPG, 64.4 KB, uploaded by Meng on Oct. 8, 2021.