-
Notifications
You must be signed in to change notification settings - Fork 345
Open
Description
Required prerequisites
- Consult the security policy. If reporting a security vulnerability, do not report the bug using this form. Use the process described in the policy to report the issue.
- Make sure you've read the documentation. Your issue may be addressed there.
- Search the issue tracker to verify that this hasn't already been reported. +1 or comment there if it has.
- If possible, make a PR with a failing test to give us a starting point to work on!
Describe the bug
The following tests fail with the error "error: unhandled function call - builder_kernel".
def test_call_builder_kernel_from_decorator_kernel():
"""Tests that a kernel built with make_kernel can be called
from within a @cudaq.kernel decorated function."""
builder_kernel, qubit = cudaq.make_kernel(cudaq.qubit)
builder_kernel.x(qubit)
@cudaq.kernel
def caller():
q = cudaq.qubit()
builder_kernel(q)
counts = cudaq.sample(caller, shots_count=10)
assert counts["1"] == 10
def test_call_builder_kernel_from_decorator_kernel_2():
"""Tests that a parameterized builder kernel can be called
from within a @cudaq.kernel decorated function."""
builder_kernel, angle = cudaq.make_kernel(float)
qubits = builder_kernel.qalloc(1)
builder_kernel.ry(angle, qubits[0])
@cudaq.kernel
def caller():
builder_kernel(np.pi)
counts = cudaq.sample(caller, shots_count=10)
assert counts["1"] == 10Steps to reproduce the bug
run the above test
Expected behavior
tests pass, or a better error is raised
Is this a regression? If it is, put the last known working version (or commit) here.
Not a regression
Environment
- CUDA-Q version:
- Python version:
- C++ compiler:
- Operating system:
Suggestions
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels