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

Function test_kernel_adjoint_float_args

python/tests/mlir/adjoint.py:116–129  ·  view source on GitHub ↗

Tests the adjoint of a kernel that is parameterized by a float.

()

Source from the content-addressed store, hash-verified

114
115
116def test_kernel_adjoint_float_args():
117 """
118 Tests the adjoint of a kernel that is parameterized
119 by a float.
120 """
121 other_kernel, other_value = cudaq.make_kernel(float)
122 other_qubit = other_kernel.qalloc()
123 other_kernel.x(other_qubit)
124 other_kernel.rx(other_value, other_qubit)
125
126 kernel, _float = cudaq.make_kernel(float)
127 kernel.adjoint(other_kernel, _float)
128
129 print(kernel)
130
131
132# CHECK-LABEL: func.func @__nvqpp__mlirgen__PythonKernelBuilderInstance

Callers

nothing calls this directly

Calls 4

printFunction · 0.50
qallocMethod · 0.45
xMethod · 0.45
adjointMethod · 0.45

Tested by

no test coverage detected