Open jon-wurtz opened 9 months ago
And yes, I understand that "in principle" I could bloqade-ify values_func but at this moment that is too deep in the IR to be functional...
I don't understand what this means, decorators are just python functions so you should be able to do this pretty easily with the current API:
from bloqade import waveform
duration = 4
time_step = 0.05
my_waveform = waveform(duration)(lambda time: ...)
sampled_waveform = my_waveform.sample(time_step, "linear")
program = (
...apply(sampled_waveform)
)
Yes, you can just decorate your function as a waveform, but a user might just put an iterable for durations and values, which is completely reasonable and has an unambiguous interpretation. My example was that iterable is being constructed from a map
from some function, but it could possibly be some other user method (or even them just putting in some list). In any case, an iterable is the fundamental object to be put into durations and values.
just wrap the map
with list
? We're trying to provide clear API not ambiguous ones.
Describe the bug One of those feature/bug things; the type requirements when specifying durations and values for a piecewise_linear waveform are too strict.
Minimal broken example
Expected behavior The function accepts and interprets the inputs correctly
And yes, I understand that "in principle" I could bloqade-ify
values_func
but at this moment that is too deep in the IR to be functional...