rigetti / pyquil

A Python library for quantum programming using Quil.
http://docs.rigetti.com
Apache License 2.0
1.39k stars 341 forks source link

Waveforms cannot be pickled #1753

Open bramathon opened 3 months ago

bramathon commented 3 months ago
from pyquil.quiltwaveforms import DragGaussianWaveform
import pickle

waveform = DragGaussianWaveform(duration=100e-9, fwhm=20e-9, t0=50e-9, anh=100e3, alpha=0.5, scale=1.0, phase=0.0, detuning=0.0)
pickle.dumps(waveform)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[30], line 5
      2 import pickle
      4 waveform = DragGaussianWaveform(duration=100e-9, fwhm=20e-9, t0=50e-9, anh=100e3, alpha=0.5, scale=1.0, phase=0.0, detuning=0.0)
----> 5 pickle.dumps(waveform)

TypeError: cannot pickle 'DragGaussianWaveform' object