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

Function test_kernel_apply_call_float_args

python/tests/mlir/call.py:118–129  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

116
117
118def test_kernel_apply_call_float_args():
119 """
120 Tests that we can call another kernel that's parameterized
121 by a float (`other_kernel`), from a :class:`Kernel`.
122 """
123 other_kernel, other_float = cudaq.make_kernel(float)
124 other_qubit = other_kernel.qalloc()
125 other_kernel.rx(other_float, other_qubit)
126
127 kernel, _float = cudaq.make_kernel(float)
128 kernel.apply_call(other_kernel, _float)
129 print(kernel)
130
131
132# 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