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

Function iqft

python/tests/kernel/test_sample_kernel.py:44–55  ·  view source on GitHub ↗
(qubits: cudaq.qview)

Source from the content-addressed store, hash-verified

42
43 @cudaq.kernel
44 def iqft(qubits: cudaq.qview):
45 N = qubits.size()
46 for i in range(N // 2):
47 swap(qubits[i], qubits[N - i - 1])
48
49 for i in range(N - 1):
50 h(qubits[i])
51 j = i + 1
52 for y in range(i, -1, -1):
53 r1.ctrl(-np.pi / 2**(j - y), qubits[j], qubits[y])
54
55 h(qubits[N - 1])
56
57 @cudaq.kernel
58 def tGate(qubit: cudaq.qubit):

Callers 1

qpeFunction · 0.70

Calls 4

swapFunction · 0.70
rangeFunction · 0.50
hFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected