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

Function kernel_to_draw

python/tests/kernel/test_kernel_features.py:1532–1550  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1530
1531 @cudaq.kernel
1532 def kernel_to_draw():
1533 q = cudaq.qvector(4)
1534 h(q)
1535 # Broadcast
1536 cx(q[0], q[1])
1537 cy([q[0], q[1]], q[2])
1538 cy([q[2], q[0]], q[1])
1539 cy([q[1], q[2]], q[0])
1540 z(q[2])
1541
1542 swap(q[0], q[2])
1543 swap(q[1], q[2])
1544 swap(q[0], q[1])
1545 swap(q[0], q[2])
1546 swap(q[1], q[2])
1547
1548 r1(3.14159, q[0])
1549 tdg(q[1])
1550 s(q[2])
1551
1552 circuit = cudaq.draw(kernel_to_draw)
1553 print(circuit)

Callers

nothing calls this directly

Calls 9

qvectorMethod · 0.80
swapFunction · 0.70
hFunction · 0.50
cxFunction · 0.50
cyFunction · 0.50
zFunction · 0.50
r1Function · 0.50
tdgFunction · 0.50
sFunction · 0.50

Tested by

no test coverage detected