[x] 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.
[x] Make sure you've read the documentation. Your issue may be addressed there.
[x] Search the issue tracker to verify that this hasn't already been reported. +1 or comment there if it has.
[x] If possible, make a PR with a failing test to give us a starting point to work on!
Describe the bug
This executes fine:
import cudaq
from cudaq import spin
from typing import List
vector = [1.0]
@cudaq.kernel
def kernel(vector: List[float]):
q = cudaq.qvector(1)
if vector[0] == 1:
x(q[0])
cudaq.observe(kernel, spin.z(0), vector).expectation()
If I change if vector[0] == 1 to if vector[0] == 1.0 which is what it should be given that my input type is a List[float], I get the following error:
ValueError: Cannot cast type to IntegerType (from Type(f64))
Steps to reproduce the bug
NA
Expected behavior
NA
Is this a regression? If it is, put the last known working version (or commit) here.
Required prerequisites
Describe the bug
This executes fine:
If I change
if vector[0] == 1
toif vector[0] == 1.0
which is what it should be given that my input type is aList[float]
, I get the following error:Steps to reproduce the bug
NA
Expected behavior
NA
Is this a regression? If it is, put the last known working version (or commit) here.
Not a regression
Environment
Suggestions
NA