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

Infinite loop when looping through kernel builder qubits #1679

Open
3 of 4 tasks
anthony-santana opened this issue May 14, 2024 · 0 comments
Open
3 of 4 tasks

Infinite loop when looping through kernel builder qubits #1679

anthony-santana opened this issue May 14, 2024 · 0 comments
Labels
python-lang Anything related to the Python CUDA Quantum language implementation
Milestone

Comments

@anthony-santana
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

The following will run an infinite loop:

import cudaq

kernel = cudaq.make_kernel()
qubits = kernel.qalloc(2)

for qubit in qubits:
    print(qubit)

which prints

.
.
.
Value(%1060 = quake.extract_ref %0[%c1059_i64] : (!quake.veq<2>, i64) -> !quake.ref)
Value(%1061 = quake.extract_ref %0[%c1060_i64] : (!quake.veq<2>, i64) -> !quake.ref)
Value(%1062 = quake.extract_ref %0[%c1061_i64] : (!quake.veq<2>, i64) -> !quake.ref)
Value(%1063 = quake.extract_ref %0[%c1062_i64] : (!quake.veq<2>, i64) -> !quake.ref)
Value(%1064 = quake.extract_ref %0[%c1063_i64] : (!quake.veq<2>, i64) -> !quake.ref)
Value(%1065 = quake.extract_ref %0[%c1064_i64] : (!quake.veq<2>, i64) -> !quake.ref)
Value(%1066 = quake.extract_ref %0[%c1065_i64] : (!quake.veq<2>, i64) -> !quake.ref)
Value(%1067 = quake.extract_ref %0[%c1066_i64] : (!quake.veq<2>, i64) -> !quake.ref)
Value(%1068 = quake.extract_ref %0[%c1067_i64] : (!quake.veq<2>, i64) -> !quake.ref)
Value(%1069 = quake.extract_ref %0[%c1068_i64] : (!quake.veq<2>, i64) -> !quake.ref)
Value(%1070 = quake.extract_ref %0[%c1069_i64] : (!quake.veq<2>, i64) -> !quake.ref)
Value(%1071 = quake.extract_ref %0[%c1070_i64] : (!quake.veq<2>, i64) -> !quake.ref)
Value(%1072 = quake.extract_ref %0[%c1071_i64] : (!quake.veq<2>, i64) -> !quake.ref)
Value(%1073 = quake.extract_ref %0[%c1072_i64] : (!quake.veq<2>, i64) -> !quake.ref)
.
.
.

Steps to reproduce the bug

See attached code

Expected behavior

We expect an error or for the loop to terminate properly.

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:

All latest

Suggestions

No response

@schweitzpgi schweitzpgi added the python-lang Anything related to the Python CUDA Quantum language implementation label Jun 10, 2024
@bettinaheim bettinaheim added this to the release 0.8.0 milestone Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python-lang Anything related to the Python CUDA Quantum language implementation
Projects
None yet
Development

No branches or pull requests

3 participants