You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The two vector arguments of :code:`stabilizer_round` are the flattened X and
87
+
Z stabilizer *schedule* matrices, which can encode an optimized gate order
88
+
on top of the parity-check support. See
89
+
:cpp:func:`cudaq::qec::code::get_stabilizer_schedule_x` for the encoding
90
+
and the default (the plain parity matrices).
91
+
86
92
4. **Protected Members**:
87
93
88
94
- :code:`operation_encodings`: Maps operations to their quantum kernel implementations. The key is the ``operation`` enum and the value is a variant on the above kernel type aliases.
@@ -136,6 +142,20 @@ To implement a new quantum error correcting code:
136
142
// Implement stabilizer measurements
137
143
}
138
144
145
+
.. note::
146
+
147
+
The two vector arguments passed to the :code:`stabilizer_round` kernel
148
+
are the flattened X and Z stabilizer *schedule* matrices returned by
149
+
:cpp:func:`cudaq::qec::code::get_stabilizer_schedule_x` and
150
+
:cpp:func:`cudaq::qec::code::get_stabilizer_schedule_z`. By default
151
+
these equal the plain parity-check matrices (every entry 0 or 1), but a
152
+
code can override the :code:`get_stabilizer_schedule_*` methods to
153
+
encode a gate order, in which case entry :code:`k >= 1` means the
154
+
interaction executes at timestep :code:`k` (the built-in
155
+
:code:`surface_code` does this to avoid hook errors). A kernel that only
156
+
needs the support pattern should therefore test entries for
157
+
:code:`!= 0` rather than :code:`== 1`.
158
+
139
159
4. **Register Operations**:
140
160
141
161
In the constructor, register quantum kernels for each operation:
@@ -267,7 +287,18 @@ to prototype and develop new codes.
267
287
.. note::
268
288
269
289
The kernel registered for :code:`stabilizer_round` must be annotated to
270
-
return :code:`list[cudaq.measure_handle]`.
290
+
return :code:`list[cudaq.measure_handle]`.
291
+
292
+
.. note::
293
+
294
+
As in C++, the two list arguments passed to the
295
+
:code:`stabilizer_round` kernel are the flattened X and Z stabilizer
296
+
schedule matrices, which default to the parity-check matrices. A Python
297
+
code can optionally define :code:`get_stabilizer_schedule_x` /
298
+
:code:`get_stabilizer_schedule_z` methods returning a 2D array with the
299
+
same shape and support pattern as the corresponding parity-check
300
+
matrix, where entry :code:`k >= 1` schedules that interaction at
301
+
timestep :code:`k`.
271
302
272
303
3. **Implement the Code Class**:
273
304
@@ -482,6 +513,26 @@ print the layout. **Python:** :class:`cudaq_qec.stabilizer_grid` — see
482
513
:ref:`qec_stabilizer_grid_cpp`. The header :file:`cudaq/qec/codes/surface_code.h`
483
514
contains the full declaration.
484
515
516
+
**Stabilizer measurement schedule**
517
+
518
+
The surface code's :code:`stabilizer_round` kernel executes one depth-4
519
+
extraction round: the X- and Z-check CNOTs are interleaved over four shared
520
+
timesteps. Within each plaquette the CNOT order follows the standard zigzag
521
+
schedule for the rotated surface code (`Tomita & Svore
522
+
<https://arxiv.org/abs/1404.3747>`__): the X and Z plaquettes traverse their
523
+
corners in transposed orders, selected per orientation so that mid-round
0 commit comments