Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[custom op] Support nested kernels #2485

Open
3 of 4 tasks
Squirtle007 opened this issue Dec 19, 2024 · 0 comments
Open
3 of 4 tasks

[custom op] Support nested kernels #2485

Squirtle007 opened this issue Dec 19, 2024 · 0 comments

Comments

@Squirtle007
Copy link

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

Calling a kernel involving custom op within another kernel causes an error.

Steps to reproduce the bug

cudaq.register_operation("custom_op", [1, 0, 0, 1])

@cudaq.kernel
def custom_kernel(qubit: cudaq.qubit):
    custom_op(qubit)

@cudaq.kernel
def kernel():
    qubit= cudaq.qubit()
    custom_kernel(qubit)

Error builder failed to JIT compile the Quake representation occurs when the code above is executed with cudaq.draw, cudaq.sample, etc.
Also, for cudaq.qvector:

@cudaq.kernel
def custom_kernel(qubits: cudaq.qview):
    x(qubits)

@cudaq.kernel
def kernel():
    qubits= cudaq.qvector(1)
    custom_kernel(qubits)

causes error broadcasting is not supported on custom operations.

Expected behavior

Support custom op for nested kernels.

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

Not a regression

Environment

  • CUDA-Q version: 0.9.1
  • Python version: 3.10.12
  • C++ compiler:
  • Operating system:

Suggestions

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant