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

Return list[complex] fails when returning list[float] #2600

Open
amccaskey opened this issue Feb 7, 2025 · 0 comments
Open

Return list[complex] fails when returning list[float] #2600

amccaskey opened this issue Feb 7, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@amccaskey
Copy link
Collaborator

The following fails

import cudaq 

@cudaq.kernel 
def myop(p0 : float, p1: float) -> list[complex]:
    return [0., p0, p1, 0.] 

print(myop)

with

error: type of return operand 0 ('!cc.stdvec<f64>') doesn't match function result type ('!cc.stdvec<complex<f64>>') in function @__nvqpp__mlirgen__myop
RuntimeError: Failure while executing pass pipeline.

we should do some auto-casting from float to complex if the return type is specified like this.

@amccaskey amccaskey added the bug Something isn't working label Feb 7, 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
Projects
None yet
Development

No branches or pull requests

1 participant