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

The bridge failing to deal with captured globals. #2608

Open
3 of 4 tasks
boschmitt opened this issue Feb 11, 2025 · 0 comments · May be fixed by #2616
Open
3 of 4 tasks

The bridge failing to deal with captured globals. #2608

boschmitt opened this issue Feb 11, 2025 · 0 comments · May be fixed by #2616
Labels
bug Something isn't working python bridge Involves the python bridge to quake

Comments

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

It seems the bridge is getting lost when using captured globals. In the following case, angle, seems to be identified as a float; the symbols table's entry, however, has its type as !cc.ptr<f64>, which is not indeed a f64. Thus the issues seems to be that the user of angle expects a value (register), while the bridge symbol table gets populated with memory.

import cudaq

angle = 3.14

@cudaq.kernel
def kernel():
    qubit = cudaq.qubit()
    rz(angle, qubit)
    mz(qubit)

ret = cudaq.sample(kernel)
print(ret)
cudaq.kernel.ast_bridge.CompilerError: bug_me.py:8: error: rotational parameter must be a float, or int.
	 (offending source -> rz(angle, qubit))

Steps to reproduce the bug

Trying to run the above code.

Expected behavior

The code should run.

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

Not a regression

Environment

Suggestions

No response

@bmhowe23 bmhowe23 linked a pull request Feb 13, 2025 that will close this issue
@schweitzpgi schweitzpgi added bug Something isn't working python bridge Involves the python bridge to quake labels Feb 18, 2025
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 bridge Involves the python bridge to quake
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants