MCPcopy Create free account
hub / github.com/NVIDIA/cuda-quantum / kernel_rep_code_d3

Function kernel_rep_code_d3

python/tests/mlir/qec_ops.py:250–272  ·  view source on GitHub ↗
(n_rounds: int)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 7

qvectorMethod · 0.80
measure_handleMethod · 0.80
rangeFunction · 0.50
mzFunction · 0.50
resetFunction · 0.50
detectorMethod · 0.45
logical_observableMethod · 0.45

Tested by

no test coverage detected