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

Function test_kernel_apply_call_qreg_args

python/tests/mlir/call.py:74–85  ·  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

72
73
74def test_kernel_apply_call_qreg_args():
75 """
76 Tests that we can call another kernel that's parameterized
77 by a qubit (`other_kernel`), from a :class:`Kernel`.
78 """
79 other_kernel, other_qreg = cudaq.make_kernel(cudaq.qreg)
80 other_kernel.h(other_qreg)
81
82 kernel = cudaq.make_kernel()
83 qreg = kernel.qalloc(5)
84 kernel.apply_call(other_kernel, qreg)
85 print(kernel)
86
87
88# 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