(n_rounds: int)
| 248 | |
| 249 | @cudaq.kernel |
| 250 | def kernel_rep_code_d3(n_rounds: int): |
| 251 | data = cudaq.qvector(3) |
| 252 | anc0 = cudaq.qubit() |
| 253 | anc1 = cudaq.qubit() |
| 254 | prev_s0 = cudaq.measure_handle() |
| 255 | prev_s1 = cudaq.measure_handle() |
| 256 | |
| 257 | for r in range(n_rounds): |
| 258 | x.ctrl(data[0], anc0) |
| 259 | x.ctrl(data[1], anc0) |
| 260 | x.ctrl(data[1], anc1) |
| 261 | x.ctrl(data[2], anc1) |
| 262 | s0 = mz(anc0) |
| 263 | s1 = mz(anc1) |
| 264 | reset(anc0) |
| 265 | reset(anc1) |
| 266 | if r > 0: |
| 267 | cudaq.detector(prev_s0, s0) |
| 268 | cudaq.detector(prev_s1, s1) |
| 269 | prev_s0 = s0 |
| 270 | prev_s1 = s1 |
| 271 | readout = mz(data) |
| 272 | cudaq.logical_observable(readout) |
| 273 | |
| 274 | print(kernel_rep_code_d3) |
| 275 |
nothing calls this directly
no test coverage detected