|
16 | 16 | Introduction |
17 | 17 | ------------ |
18 | 18 |
|
19 | | -The game of surface codes [#Litinski]_ is a high-level framework for designing surface code quantum computing architectures. |
| 19 | +The game of surface codes is a high-level framework for designing surface code quantum computing architectures. |
20 | 20 | The game helps us understand space-time trade-offs, where designs with a higher qubit overhead allow for faster computations and vice versa. |
21 | 21 | For example, a space-efficient design might allow a computation with :math:`10^8` T gates to run in :math:`4` hours using :math:`55k` physical qubits, |
22 | 22 | whereas an intermediate design may run the same computation in :math:`22` minutes using :math:`120k` physical qubits, |
|
34 | 34 | Hence, we mainly care about performing measurements on qubits in arbitrary bases and efficiently distilling and injecting magic states. |
35 | 35 |
|
36 | 36 | We also note that the patches that represent qubits correspond to surface code qubits. |
37 | | -There is a detailed explanation in Appendix A in [#Litinski]_ that describes the surface code realizations of all operations that we are going to see. |
| 37 | +There is a detailed explanation in Appendix A of the paper that describes the surface code realizations of all operations that we are going to see. |
38 | 38 | These are useful to know in order to grasp the full depth of the game, but are not essential to understanding its rules and concluding design principles that we cover in this demo. |
39 | 39 | For further reading on these subjects, we recommend the `blog posts on the surface code and quantum error correction <https://arthurpesah.me/blog/>`__ by Arthur Pesah, our :doc:`demo on the toric code <demos/tutorial_toric_code>`, as well as the three-part series on the `toric code <https://decodoku.blogspot.com/2016/03/6-toric-code.html>`__ by James Wooton. |
40 | 40 |
|
|
57 | 57 |
|
58 | 58 | Qubits are defined as patches of tiles on the board. |
59 | 59 | A single qubit can occupy one tile (a) or multiple tiles (b), where dotted lines correspond to X and solid lines to Z operators. |
60 | | - Image source: [#Litinski]_. |
| 60 | + Image source: Daniel Litinski [1]. |
61 | 61 |
|
62 | 62 | Every operation in the game has an associated time cost that we measure in units of code cycles 🕒. |
63 | 63 | There are some discrepancies to actual surface code cycles, but the correspondance is close enough to weigh out space-time trade-offs in architecture designs. |
|
75 | 75 | :target: javascript:void(0) |
76 | 76 |
|
77 | 77 | Simultaneously measuring the patches of two adjacent patches corresponds to the product of their neighboring edges. Here, we measure :math:`ZZ`. |
78 | | - Image source: [#Litinski]_. |
| 78 | + Image source: Daniel Litinski [1]. |
79 | 79 |
|
80 | 80 | In particular, if the shared edge contains both Z and X edges, we can measure in the Y basis. In the following example, the upper qubit A has both operator edges :math:`Z_A` and :math:`X_A` exposed. |
81 | 81 | Measuring it together with the auxillary qubit B, initialized in the :math:`|0\rangle` state below, we measure :math:`(Z_A X_A) \otimes Z_B \propto Y_A \otimes Z_B` alltogether. |
|
86 | 86 | :target: javascript:void(0) |
87 | 87 |
|
88 | 88 | `Y` operators can be measured by having both X and Z edges be exposed with an adjacent auxiliary qubit. The measurement corresponds to the product of all involved operators, involving :math:`Z_A X_A \propto Y_A`. |
89 | | - Image source: [#Litinski]_. |
| 89 | + Image source: Daniel Litinski [1]. |
90 | 90 |
|
91 | 91 | If we want to measure a single qubit patch in practice, we start off deforming it at the cost of 1🕒, initialize an auxiliary qubit at no cost, and perform the joint measurement as shown above (1🕒). |
92 | 92 | The entire protocol costs 2🕒 and is shown below: |
|
97 | 97 | :target: javascript:void(0) |
98 | 98 |
|
99 | 99 | The protocol for measuring a single qubit in the Y basis involves deforming the patch (Step 2, 1🕒), initializing an auxillary qubit in :math:`|0\rangle` (0🕒), simultaneously measuring both patches (1🕒) and deforming the qubit back again (0🕒). |
100 | | - Image source: [#Litinski]_. |
| 100 | + Image source: Daniel Litinski [1]. |
101 | 101 |
|
102 | 102 | Auxiliary qubits play an important role as they allow measuring products of Pauli operators on different qubits, |
103 | 103 | which is the most crucial operation in this framework, since everything is mapped to `Pauli product measurements <https://pennylane.ai/compilation/pauli-product-measurement>`__. |
|
109 | 109 |
|
110 | 110 | Measuring :math:`Y_1 X_3 Z_4 X_5` via a joint auxiliary qubit in 1🕒. In principle multi-qubit measurements with many qubits come at the same cost as with fewer qubit. |
111 | 111 | However, the requirement of having an auxiliary region connecting all qubits may demand extra deformations. |
112 | | - Image source: [#Litinski]_. |
| 112 | + Image source: Daniel Litinski [1]. |
113 | 113 |
|
114 | 114 | Non-Clifford Pauli rotations |
115 | 115 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
127 | 127 | Performing a non-Clifford :math:`\pi/8` rotation corresponds to performing the joint measurement of the Pauli word and :math:`Z` on the magic state qubit. |
128 | 128 | The measurement of :math:`P \otimes Z_m` costs 1🕒, the subsequent :math:`X` measurement is free. |
129 | 129 | The additional classically controlled Clifford rotations can be merged again with the measurements at the end of the circuit. |
130 | | - Image source: [#Litinski]_. |
| 130 | + Image source: Daniel Litinski [1]. |
131 | 131 |
|
132 | 132 | Take for example the Pauli word :math:`P = Z_1 Y_2 X_4` on the architecture layout below. |
133 | 133 | This design allows one to directly perform :math:`e^{-i \frac{\pi}{8} P}` as we have access to all of :math:`X, Y, Z` on each qubit, as well as the :math:`Z` edge for the magic state qubit. |
|
138 | 138 | :target: javascript:void(0) |
139 | 139 |
|
140 | 140 | Performing :math:`e^{-i \frac{\pi}{8} Z_1 Y_2 X_4}` by measuring :math:`Z_1 Y_2 X_4 Z_m`. The additional measurement :math:`X` on the magic state qubit is not shown and has no additional cost. The remaining Clifford Pauli rotations are merged with the terminal measurements at the end of the circuit via compilation. |
141 | | - Image source: [#Litinski]_. |
| 141 | + Image source: Daniel Litinski [1]. |
142 | 142 |
|
143 | 143 | We are going to see in the next section that one of the biggest problems is performing Y rotations and measurements (same thing, really, in this framework). |
144 | 144 |
|
|
162 | 162 | :target: javascript:void(0) |
163 | 163 |
|
164 | 164 | The compact data block design is efficient in space. However, only one edge is exposed to the auxiliary qubit region in the middle. |
165 | | - Image source: [#Litinski]_. |
| 165 | + Image source: Daniel Litinski [1]. |
166 | 166 |
|
167 | 167 | This design only uses :math:`\frac{3}{2}n + 3` tiles for :math:`n` qubits. |
168 | 168 | The biggest drawback is rather obvious: we can only access :math:`Z` measurements in the auxiliary qubit region. In order to perform joint :math:`X` measurements, |
|
174 | 174 | :target: javascript:void(0) |
175 | 175 |
|
176 | 176 | A patch rotation can be used to expose the :math:`X` edge to the auxiliary qubit region. |
177 | | - Image source: [#Litinski]_. |
| 177 | + Image source: Daniel Litinski [1]. |
178 | 178 |
|
179 | 179 | The worst thing that can happen is to have two opposite qubits require an X measurement, |
180 | 180 | e.g. qubits (3 and 4) or (5 and 6). If either or both occurs, it takes a total of 6🕒 to rotate the patches. |
|
193 | 193 | :target: javascript:void(0) |
194 | 194 |
|
195 | 195 | A Clifford rotation :math:`e^{i \frac{\pi}{4} P}` is performed by measuring :math:`P \otimes Y`. |
196 | | - Image source: [#Litinski]_. |
| 196 | + Image source: Daniel Litinski [1]. |
197 | 197 |
|
198 | 198 | In particular, we still need to be able to perform a :math:`Y` measurement `somewhere`. |
199 | 199 | In this case we just outsourced it to another resource qubit, which we can use for all others and for which we left space in the bottom left corner of the compact data block. |
|
205 | 205 | :target: javascript:void(0) |
206 | 206 |
|
207 | 207 | A Clifford rotation :math:`e^{i \frac{\pi}{4} Z_3 Z_5 Z_6}` is performed by measuring :math:`Z_3 Z_5 Z_6 \otimes Y_\text{resource}` with the additional resource qubit in the bottom left corner of the compact block. |
208 | | - Image source: [#Litinski]_. |
| 208 | + Image source: Daniel Litinski [1]. |
209 | 209 |
|
210 | 210 | The worst case here is having an even number of :math:`Y` operators in the Pauli word, as it requires two distinct :math:`\frac{\pi}{4}` rotations, each costing 2🕒. |
211 | 211 |
|
|
222 | 222 | Step 3 performs the additional :math:`X` measurement on the resource qubit at 0🕒. |
223 | 223 | Same for steps 4 and 5 for performing :math:`e^{i \frac{\pi}{4} Z_3 Z_5 Z_6}` at 1🕒 overall. |
224 | 224 | Steps 6 and 7 perform the patch rotations at 3🕒, each. And the final measurement of :math:`X_1 X_3 Z_4 X_5 X_6 Z_m` at another 1🕒 in step 8 completes the computation. |
225 | | - Image source: [#Litinski]_. |
| 225 | + Image source: Daniel Litinski [1]. |
226 | 226 |
|
227 | 227 |
|
228 | 228 | Intermediate data blocks |
|
237 | 237 | :target: javascript:void(0) |
238 | 238 |
|
239 | 239 | Intermediate data block design. |
240 | | - Image source: [#Litinski]_. |
| 240 | + Image source: Daniel Litinski [1]. |
241 | 241 |
|
242 | 242 | As such, this architecture occupies :math:`2n + 4` tiles. One can get additional savings by having the auxiliary qubit region be flexibly the lower or upper row. |
243 | 243 | This way, one can save on the extra cost of rotating patches back to their original position. |
|
248 | 248 | :target: javascript:void(0) |
249 | 249 |
|
250 | 250 | Performing a :math:`ZXZZX` measurement by performing patch rotations for the appropriate :math:`X` measurements and moving all qubits down into the auxiliary region to save time. |
251 | | - Image source: [#Litinski]_. |
| 251 | + Image source: Daniel Litinski [1]. |
252 | 252 |
|
253 | 253 | Overall we get a maximum of 2🕒 for the rotations. Adding the base cost of 1🕒 for the measurement |
254 | 254 | and the maximum 2🕒 for the additional Clifford :math:`\pi/4` Z rotations as in the compact block design, |
|
267 | 267 | :target: javascript:void(0) |
268 | 268 |
|
269 | 269 | Two qubits can be realized by a patch on two tiles. The patch now has 6 distinct edges, corresponding to the operators as indicated in the figure. |
270 | | - Image source: [#Litinski]_. |
| 270 | + Image source: Daniel Litinski [1]. |
271 | 271 |
|
272 | 272 | With this extra trick up our sleeve, we can construct the fast data block consisting of two-qubit patches with an all-encompassing auxiliary qubit region. |
273 | 273 |
|
|
277 | 277 | :target: javascript:void(0) |
278 | 278 |
|
279 | 279 | Fast data block design. |
280 | | - Image source: [#Litinski]_. |
| 280 | + Image source: Daniel Litinski [1]. |
281 | 281 |
|
282 | 282 | Here, all 15 distinct Pauli operators are readily available. This is because we have |
283 | 283 | :math:`X_1`, :math:`X_1 \otimes X_2`, :math:`Z_2`, :math:`Z_1 \otimes Z_2` and all products thereof available. |
|
304 | 304 | ^^^^^^^^^^^^^^^^^^^^ |
305 | 305 |
|
306 | 306 | This protocol uses 15 imperfect magic states with infidelity :math:`p` and outputs a single magic state with infidelity of :math:`35p^3`. |
307 | | -The distillation circuit is shown below, with the details described in section 3.1 in [#Litinski]_: |
| 307 | +The distillation circuit is shown below, with the details described in section 3.1 of the paper: |
308 | 308 |
|
309 | 309 | .. figure:: ../_static/demonstration_assets/game_of_surface_codes/15-to-1.png |
310 | 310 | :align: center |
|
314 | 314 | 15-to-1 distillation protocol. Each :math:`\frac{\pi}{8}` rotation involves a magic state injection with an error-prone magic state. |
315 | 315 | In total, we have :math:`4+11` magic states, each with infidelity :math:`p` and output a magic state :math:`|m\rangle` on the |
316 | 316 | fifth qubit with infidelity :math:`35p^3`. |
317 | | - Image source: [#Litinski]_. |
| 317 | + Image source: Daniel Litinski [1]. |
318 | 318 |
|
319 | 319 | Because all operations in the protocol are Z measurements, we can use the compact data block design to perform the distillation. |
320 | 320 | Another trick the author of [#Litinski]_ proposes is to use the auto-corrected magic state injection protocol below that avoids the additional Clifford :math:`\frac{\pi}{4}` Pauli rotation (and to note that the :math:`\frac{\pi}{2}` Pauli rotation is just a sign flip that can be tracked classically). |
|
326 | 326 |
|
327 | 327 | The auto-corrected magic state injection protocol avoids the additional Clifford :math:`\frac{\pi}{4}` Pauli rotation from above at the cost of having an additional qubit that is measured. |
328 | 328 | However, note that the first two measurements commute and can be performed simultaneously. |
329 | | - Image source: [#Litinski]_. |
| 329 | + Image source: Daniel Litinski [1]. |
330 | 330 |
|
331 | 331 | Using this injection protocol to perform the non-Clifford :math:`\frac{\pi}{8}` rotations using the error prone magic states, the 15-to-1 protocol on a compact data block is performed in the following way: |
332 | 332 |
|
|
338 | 338 | The 15-to-1 protocol executed on a compact data block using the auto-corrected magic state injection subroutine in each of the repeating steps. |
339 | 339 | Note that both :math:`P \otimes Z_m` and :math:`Z_m \otimes Y_{|0\rangle}` measurements are performed simultaneously. |
340 | 340 | If all :math:`X` measurements on qubits 1-4 in step 23 yield a :math:`+1` result, a magic state is successfully prepared on qubit 5. The probability for failure is roughly :math:`(1-p)^n`. |
341 | | - Image source: [#Litinski]_. |
| 341 | + Image source: Daniel Litinski [1]. |
342 | 342 |
|
343 | 343 | The 15-to-1 distillation protocol produces a magic state in 11🕒 on 11 tiles. |
344 | 344 |
|
|
362 | 362 | :target: javascript:void(0) |
363 | 363 |
|
364 | 364 | Minimal setup with 100 logical qubits on 153 tiles and 11 extra tiles for a compact distillation block. |
365 | | - Image source: [#Litinski]_. |
| 365 | + Image source: Daniel Litinski [1]. |
366 | 366 |
|
367 | 367 | For a code distance of :math:`d=13` we would require :math:`164 \cdot 2 \cdot d^2 \approx 55k` physical qubits. |
368 | 368 | An example computation with :math:`10^8` T gates at a code cycle of :math:`1\mu s` would finish in :math:`d \cdot 11🕒 \cdot 10^8 \approx 4h`. |
|
378 | 378 | :target: javascript:void(0) |
379 | 379 |
|
380 | 380 | Intermediate setup consisting of the intermediate data block and two 15-to-1 distillation blocks on each end. |
381 | | - Image source: [#Litinski]_. |
| 381 | + Image source: Daniel Litinski [1]. |
382 | 382 |
|
383 | 383 | In this case we require 222 tiles, so :math:`222 \cdot 2 \cdot d^2 \approx 75k` physical qubits, and the same computation mentioned before would finish in half the time after about :math:`2h`. |
384 | 384 |
|
|
388 | 388 |
|
389 | 389 | We've been introduced to a high-level description of quantum computing that allows us to reason about space-time trade-offs in FTQC architecture designs. |
390 | 390 | We have seen some basic prototypes that allow computations involving :math:`10^8` T gates in orders of hours using :math:`55k` or :math:`75k` physical qubits. |
391 | | -With this knowledge, we should be able to follow the more involved tricks discussed in sections 4 and 5 in [#Litinski]_, that we have not covered in this demo yet. |
| 391 | +With this knowledge, we should be able to follow the more involved tricks discussed in sections 4 and 5 of the Game of Surface Codes paper, that we have not covered in this demo yet. |
392 | 392 |
|
393 | 393 | """ |
394 | 394 |
|
|
0 commit comments