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

Method adjoint

python/cudaq/kernel/kernel_builder.py:1324–1349  ·  view source on GitHub ↗

Apply the adjoint of the `target` kernel in-place to `self`. Args: target (:class:`Kernel`): The kernel to take the adjoint of. *target_arguments (Optional[:class:`QuakeValue`]): The arguments to the `target` kernel. Leave empty if the `target` kernel d

(self, otherKernel, *target_arguments)

Source from the content-addressed store, hash-verified

1322 qec.DetectorsOp(prevV, currV)
1323
1324 def adjoint(self, otherKernel, *target_arguments):
1325 """
1326 Apply the adjoint of the `target` kernel in-place to `self`.
1327
1328 Args:
1329 target (:class:`Kernel`): The kernel to take the adjoint of.
1330 *target_arguments (Optional[:class:`QuakeValue`]): The arguments to the
1331 `target` kernel. Leave empty if the `target` kernel doesn't accept
1332 any arguments.
1333
1334 Raises:
1335 RuntimeError: if the `*target_arguments` passed to the adjoint call
1336 don't match the argument signature of `target`.
1337
1338 ```python
1339 # Example:
1340 target_kernel = cudaq.make_kernel()
1341 qubit = target_kernel.qalloc()
1342 target_kernel.x(qubit)
1343 # Apply the adjoint of `target_kernel` to `kernel`.
1344 kernel = cudaq.make_kernel()
1345 kernel.adjoint(target_kernel))
1346 ```
1347 """
1348 self.__applyControlOrAdjoint(otherKernel, True, [], *target_arguments)
1349 return
1350
1351 def control(self, target, control, *target_arguments):
1352 """

Callers 15

kernelFunction · 0.45
test_sample_adjoint_qregFunction · 0.45
adj_funcFunction · 0.45
callQftAndAnotherFunction · 0.45
test_drawFunction · 0.45

Calls 1

Tested by 15

kernelFunction · 0.36
test_sample_adjoint_qregFunction · 0.36
callQftAndAnotherFunction · 0.36
test_drawFunction · 0.36
_adjoint_openqasmFunction · 0.36