Skip to content

Commit

Permalink
Revert "Update test_kernel_features.py"
Browse files Browse the repository at this point in the history
This reverts commit f9c7023.
  • Loading branch information
khalatepradnya committed Jul 23, 2024
1 parent f9c7023 commit c72877d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions python/tests/kernel/test_kernel_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -1697,6 +1697,30 @@ def kernel(theta: float):
cudaq.sample(kernel, theta).dump()


def test_control_on_adjoint():

@cudaq.kernel
def my_func(q: cudaq.qubit, theta: float):
ry(theta, q)
rz(theta, q)

@cudaq.kernel
def adj_func(q: cudaq.qubit, theta: float):
cudaq.adjoint(my_func, q, theta)

@cudaq.kernel
def kernel(theta: float):
ancilla = cudaq.qubit()
q = cudaq.qubit()

h(ancilla)
cudaq.control(my_func, ancilla, q, theta)
cudaq.control(adj_func, ancilla, q, theta)

theta = 1.5
# test here is that this compiles and runs
cudaq.sample(kernel, theta).dump()


# leave for gdb debugging
if __name__ == "__main__":
Expand Down

0 comments on commit c72877d

Please sign in to comment.