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

cannot use @cudaq.kernel in the interpreter: OSError: could not get source code #2593

Open
3 of 4 tasks
jeffhammond opened this issue Feb 6, 2025 · 0 comments
Open
3 of 4 tasks

Comments

@jeffhammond
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

I tried to run the demo on https://nvidia.github.io/cuda-quantum/latest/applications/python/vqe_advanced.html directly in the interpreter. It fails with the following:

>>> import cudaq
>>> @cudaq.kernel
... def kernel(qubit_num: int, electron_num: int, thetas: list[float]):
...     qubits = cudaq.qvector(qubit_num)
...
OSError: could not get source code

Steps to reproduce the bug

Type this into the interpreter and press return:

>>> import cudaq
>>> @cudaq.kernel
... def kernel(qubit_num: int, electron_num: int, thetas: list[float]):
...     qubits = cudaq.qvector(qubit_num)
...
OSError: could not get source code

Expected behavior

What the documentation describes on the aforementioned page.

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

Not a regression

Environment

  • CUDA-Q version: latest. I ran pip install --upgrade cudaq today.
  • Python version: 3.10.12
  • C++ compiler: GCC 11.4
  • Operating system: Ubuntu 22.04.5 LTS

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