I have the following python code:
if not isinstance(instruction, Instruction.Pulse):
continue
waveform = instruction._0.waveform
waveform.parameters["scale"] = quil.expression.Expression.Number(1.0 + 0.0j)
# cache this waveform
The goal here is to cache all the waveform shapes regardless of the scale. If you throw away the scale, there is a lot of compression potential in my use case. However, the waveform.parameters don't change after the write. Additionally, this doesn't show as an error, the code executes fine.
Edit:
Trying to explore workarounds, I found the following code errors:
waveform2 = quil.waveform.Waveform.from_quil(waveform.to_quil())
with:
TypeError: argument 'invocation': 'str' object cannot be cast as 'WaveformInvocation'
I have the following python code:
The goal here is to cache all the waveform shapes regardless of the scale. If you throw away the scale, there is a lot of compression potential in my use case. However, the waveform.parameters don't change after the write. Additionally, this doesn't show as an error, the code executes fine.
Edit:
Trying to explore workarounds, I found the following code errors:
with: