NVIDIA / cuda-quantum

C++ and Python support for the CUDA Quantum programming model for heterogeneous quantum-classical workflows
https://nvidia.github.io/cuda-quantum/
Other
423 stars 147 forks source link

clarifying scope of ctrl and adj operations #1783

Open mmvandieren opened 3 weeks ago

mmvandieren commented 3 weeks ago

Required prerequisites

Describe the bug

The text and example code for the section titled "Adjoint and Controlled Operations" of the documentation on the page https://nvidia.github.io/cuda-quantum/latest/api/default_ops.html doesn't fully clarify the scope of these operations. In particular, both can be applied to kernels in addition to the built in gates.

Steps to reproduce the bug

N/A

Expected behavior

N/A

Is this a regression? If it is, put the last known working version (or commit) here.

Not a regression

Environment

Suggestions

Suggested edits to the text:

Suggested edits to the code: Demonstrate the operations applied to both a built-in gate (as is currently demonstrated) and a user-defined kernel

mmvandieren commented 1 week ago

Adding to this issue, there is a lack of clarity (or potential source of confusion) in the documentation that the adj and ctrl only work for the kernel-builder construction of kernels and not with the decorator function kernels. That said, there is no documentation (or it's difficult to locate) where to find the control and adjoint syntax for kernels built as decorated functions in Python.