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

Function kernel

python/tests/visualization/test_draw.py:36–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34
35 @cudaq.kernel
36 def kernel():
37 q = cudaq.qvector(4)
38 h(q)
39 x.ctrl(q[0], q[1])
40 y.ctrl(q[0], q[1], q[2])
41 y.ctrl(q[2], q[0], q[1])
42 y.ctrl(q[1], q[2], q[0])
43 z(q[2])
44 r1(3.14159, q[0])
45 tdg(q[1])
46 s(q[2])
47 swap(q[0], q[2])
48 swap(q[1], q[2])
49 swap(q[0], q[1])
50 swap(q[0], q[2])
51 swap(q[1], q[2])
52 swap.ctrl(q[3], q[0], q[1])
53 swap.ctrl(q[0], q[3], q[1], q[2])
54 swap.ctrl(q[1], q[0], q[3])
55 swap.ctrl(q[1], q[2], q[0], q[3])
56 bar(q)
57 cudaq.control(zaz, q[1], q[0])
58 cudaq.adjoint(bar, q)
59
60 # fmt: off
61 expected_str = R"""

Callers

nothing calls this directly

Calls 10

qvectorMethod · 0.80
barFunction · 0.70
hFunction · 0.50
zFunction · 0.50
r1Function · 0.50
tdgFunction · 0.50
sFunction · 0.50
swapFunction · 0.50
controlMethod · 0.45
adjointMethod · 0.45

Tested by

no test coverage detected