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

Function kernel

python/tests/analysis/test_dem_from_kernel.py:65–72  ·  view source on GitHub ↗
(n_rounds: int)

Source from the content-addressed store, hash-verified

63
64 @cudaq.kernel
65 def kernel(n_rounds: int):
66 q = cudaq.qubit()
67 m = mz(q)
68 for _ in range(n_rounds):
69 m_new = mz(q)
70 cudaq.detector(m_new, m)
71 m = m_new
72 cudaq.logical_observable(m)
73
74 dem_text = cudaq.dem_from_kernel(kernel, 2)
75 assert _summary(dem_text) == {"errors": 0, "detectors": 2, "observables": 1}

Callers

nothing calls this directly

Calls 9

apply_noiseMethod · 0.80
qvectorMethod · 0.80
mzFunction · 0.50
rangeFunction · 0.50
xFunction · 0.50
ryFunction · 0.50
hFunction · 0.50
detectorMethod · 0.45
logical_observableMethod · 0.45

Tested by

no test coverage detected