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

Compiler doesn't raise an error when using kernel.h(q[0]) #1496

Closed
3 of 4 tasks
poojarao8 opened this issue Apr 11, 2024 · 0 comments · Fixed by #1499
Closed
3 of 4 tasks

Compiler doesn't raise an error when using kernel.h(q[0]) #1496

poojarao8 opened this issue Apr 11, 2024 · 0 comments · Fixed by #1499

Comments

@poojarao8
Copy link
Collaborator

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

In the code snippet below, the compiler doesn't raise an error for kernel.h(q[0]). Even though no error is raised, this operation doesn't seem to be get executed.

Steps to reproduce the bug

import cudaq

cudaq.set_target("nvidia")

@cudaq.kernel
def test_state(N: int):
    q = cudaq.qvector(N)
    kernel.h(q[0])

counts = cudaq.sample(test_state, 10)
counts.dump()

Output is: { 0000000000:1000 }

Expected behavior

It should raise an error.

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

Not a regression

Environment

  • CUDA Quantum version:
  • Python version:
  • 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

Successfully merging a pull request may close this issue.

1 participant