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

Kernels do not take as input a list[list[int]] type object #1809

Open
4 tasks done
matteobarbieri00 opened this issue Jun 13, 2024 · 1 comment
Open
4 tasks done

Kernels do not take as input a list[list[int]] type object #1809

matteobarbieri00 opened this issue Jun 13, 2024 · 1 comment
Assignees
Labels
bug Something isn't working python-lang Anything related to the Python CUDA Quantum language implementation
Milestone

Comments

@matteobarbieri00
Copy link

matteobarbieri00 commented Jun 13, 2024

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

When I pass a list[list[int]] to a cudaq kernel, I get the following error:
RuntimeError: error: Cannot infer CUDA-Q type from provided Python type (!cc.stdvec<!cc.stdvec>)
I didn't expect this, since in the documentation there are examples where this type is passed to a kernel.

Steps to reproduce the bug

import cudaq
@cudaq.kernel
def test_list_list(a: list[list[int]]):
    qc = cudaq.qvector(3)
    j = 0
    for i in a:
        if i[0] == 1:
            x(qc[j])
        j += 1
    mz(qc)
 
print(cudaq.sample(test_list_list,[[0,1],[1,0],[1,0]]))

Expected behavior

I expect to get the output {'011' : 1000}.

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

Not a regression

Environment

  • CUDA Quantum version: 0.7.1
  • Python version: 3.10.14
  • C++ compiler:
  • Operating system: RHEL 9.3

Suggestions

No response

@bettinaheim bettinaheim added the bug Something isn't working label Jul 1, 2024
@bettinaheim bettinaheim added this to the release 0.8.0 milestone Jul 1, 2024
@schweitzpgi schweitzpgi added the python-lang Anything related to the Python CUDA Quantum language implementation label Jul 5, 2024
@amccaskey
Copy link
Collaborator

@schweitzpgi @annagrin We need to figure out how to pack the data for recursive stdvec types in OpaqueArguments.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working python-lang Anything related to the Python CUDA Quantum language implementation
Projects
None yet
Development

No branches or pull requests

5 participants