Open anthony-santana opened 7 months ago
We need a spec update regarding the use of strings within quantum kernels more generally.
+1
Allow passing string arguments to kernels.
cudaq.kernel.ast_bridge.CompilerError: custom.py:34: error: str is not a supported type.
+1 Being able to pass strings to kernels would greatly enhance readability when passing options. For example:
@cudaq.kernel
def data_encoding_example(encoding_type: str):
qubit = cudaq.qubit()
if encoding_type == "rx":
rx(3.14, qubit)
elif encoding_type == "ry":
ry(3.14, qubit)
elif encoding_type == "rz":
h(qubit)
rz(3.14, qubit)
would be very helpful.
Required prerequisites
Describe the feature
Support a string initialization through multiplication by int in python bridge. This may fall under the larger umbrella of strings in kernels, but in python you can initialize strings as follows:
As is, we don't support multiplication of these types in the bridge
This should be considered at some point in the future.