|
14 | 14 | "\n", |
15 | 15 | "## Background\n", |
16 | 16 | "\n", |
17 | | - "To enable real-time quantum error correction (QEC), we require the capability to dynamically control quantum program flow during execution so that quantum gates may be conditioned on measurement results. In this tutorial, we will run the bit-flip code, which is a very simple form of QEC. We will demonstrate a dynamic quantum circuit that can protect an encoded qubit from a single bit-flip error, and then evaluate the performance of the bit-flip code. \n", |
| 17 | + "To enable real-time quantum error correction (QEC), we require the capability to dynamically control quantum program flow during execution so that quantum gates may be conditioned on measurement results. In this tutorial, we will run the bit-flip code, which is a very simple form of QEC. We will demonstrate a dynamic quantum circuit that can protect an encoded qubit from a single bit-flip error, and then evaluate the performance of the bit-flip code.\n", |
18 | 18 | "\n", |
19 | 19 | "We can exploit additional ancilla qubits and entanglement to measure what are known as *stabilizers* that do not transform our encoded quantum information, while still informing us of some classes of errors that may have occurred. A quantum stabilizer code encodes $k$ logical qubits into $n$ physical qubits. Stabilizer codes critically focus on correcting a discrete error set with support from the Pauli group $\\Pi^n$. Assume the set of possible errors are $ \\epsilon \\subset \\Pi^n$. For example, in a bit-flip code with three qubits encoding the quantum state, we will have $\\epsilon = \\{IIX, IXI, XII\\}$. We can measure the stabilizers and observing their eigenvalues to dete" |
20 | 20 | ] |
|
115 | 115 | "\n", |
116 | 116 | "def measure_syndrome_bit(circuit, qreg_data, qreg_measure, creg_measure):\n", |
117 | 117 | " \"\"\"\n", |
118 | | - " Measure the syndrome by measuring the parity. \n", |
| 118 | + " Measure the syndrome by measuring the parity.\n", |
119 | 119 | " We reset our ancilla qubits after measuring the stabilizer\n", |
120 | | - " so we can reuse them for repeated stabilizer measurements. \n", |
121 | | - " Because we have already observed the state of the qubit, \n", |
122 | | - " we can write the conditional reset protocol directly to \n", |
123 | | - " avoid another round of qubit measurement if we used \n", |
| 120 | + " so we can reuse them for repeated stabilizer measurements.\n", |
| 121 | + " Because we have already observed the state of the qubit,\n", |
| 122 | + " we can write the conditional reset protocol directly to\n", |
| 123 | + " avoid another round of qubit measurement if we used\n", |
124 | 124 | " the `reset` instruction.\n", |
125 | | - " \"\"\" \n", |
| 125 | + " \"\"\"\n", |
126 | 126 | " circuit.cx(qreg_data[0], qreg_measure[0])\n", |
127 | 127 | " circuit.cx(qreg_data[1], qreg_measure[0])\n", |
128 | 128 | " circuit.cx(qreg_data[0], qreg_measure[1])\n", |
|
179 | 179 | " circuit = initialize_qubits(circuit)\n", |
180 | 180 | " circuit = encode_bit_flip(circuit, state_data, ancillas_data)\n", |
181 | 181 | " circuit = measure_syndrome_bit(circuit, qreg_data, qreg_measure, creg_syndrome)\n", |
182 | | - " \n", |
| 182 | + "\n", |
183 | 183 | " if apply_correction:\n", |
184 | 184 | " circuit = apply_correction_bit(circuit, qreg_data, creg_syndrome)\n", |
185 | | - " \n", |
| 185 | + "\n", |
186 | 186 | " circuit = apply_final_readout(circuit, qreg_data, creg_data)\n", |
187 | 187 | " return circuit\n", |
188 | 188 | "\n", |
|
423 | 423 | "metadata": { |
424 | 424 | "celltoolbar": "Slideshow", |
425 | 425 | "kernelspec": { |
426 | | - "display_name": "Python 3 (ipykernel)", |
| 426 | + "display_name": "Python 3", |
427 | 427 | "language": "python", |
428 | 428 | "name": "python3" |
429 | 429 | }, |
|
437 | 437 | "name": "python", |
438 | 438 | "nbconvert_exporter": "python", |
439 | 439 | "pygments_lexer": "ipython3", |
440 | | - "version": "3.9.6" |
| 440 | + "version": "3" |
441 | 441 | }, |
442 | 442 | "vscode": { |
443 | 443 | "interpreter": { |
|
0 commit comments