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

Function test_kernel_apply_call_qubit_args

python/tests/mlir/call.py:46–57  ·  view source on GitHub ↗

Tests that we can call another kernel that's parameterized by a qubit (`other_kernel`), from a :class:`Kernel`.

()

Source from the content-addressed store, hash-verified

44
45
46def test_kernel_apply_call_qubit_args():
47 """
48 Tests that we can call another kernel that's parameterized
49 by a qubit (`other_kernel`), from a :class:`Kernel`.
50 """
51 other_kernel, other_qubit = cudaq.make_kernel(cudaq.qubit)
52 other_kernel.h(other_qubit)
53
54 kernel = cudaq.make_kernel()
55 qubit = kernel.qalloc()
56 kernel.apply_call(other_kernel, qubit)
57 print(kernel)
58
59
60# CHECK-LABEL: func.func @__nvqpp__mlirgen__PythonKernelBuilderInstance

Callers

nothing calls this directly

Calls 3

apply_callMethod · 0.80
printFunction · 0.50
qallocMethod · 0.45

Tested by

no test coverage detected