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

Function test_kernel_adjoint_qubit_args

python/tests/mlir/adjoint.py:46–56  ·  view source on GitHub ↗

Tests the adjoint of a kernel that takes a qubit as an argument.

()

Source from the content-addressed store, hash-verified

44
45
46def test_kernel_adjoint_qubit_args():
47 """
48 Tests the adjoint of a kernel that takes a qubit as an argument.
49 """
50 other_kernel, other_qubit = cudaq.make_kernel(cudaq.qubit)
51 other_kernel.h(other_qubit)
52
53 kernel = cudaq.make_kernel()
54 qubit = kernel.qalloc()
55 kernel.adjoint(other_kernel, qubit)
56 print(kernel)
57
58
59# CHECK-LABEL: func.func @__nvqpp__mlirgen__PythonKernelBuilderInstance

Callers

nothing calls this directly

Calls 3

printFunction · 0.50
qallocMethod · 0.45
adjointMethod · 0.45

Tested by

no test coverage detected