You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running the latest versions of pyQuil and the Forest SDK
I checked to make sure that this bug has not already been reported
Issue Description
A Program containing Frames cannot be pickled if the frames member has been accessed.
For example, in the example below:
a pyQuil program with calibrations can be pickled
a pyQuil program's frames member cannot be pickled (but other individual members can be pickled, such as waveforms.
a pyQuil program with calibrations cannot be pickled if the frames have been accessed, for example, if the copy_everything_except_instructions() method has been called.
Code Snippet
importpicklefromtypingimportcastfrompyquilimportget_qcfrompyquil.apiimportQPUCompilerqc=get_qc("Ankaa-9Q-1")
compiler=cast(QPUCompiler, qc.compiler)
cals=compiler.get_calibration_program()
# Workswithopen('/tmp/test', 'wb') asfile:
pickle.dump(cals, file)
# Works i.e. some individual members can be pickledwithopen('/tmp/test', 'wb') asfile:
pickle.dump(cals.waveforms, file)
# Fails i.e. the frames member cannot be pickledwithopen('/tmp/test', 'wb') asfile:
pickle.dump(cals.frames, file)
# Failstmp=cals.copy_everything_except_instructions()
withopen('/tmp/test', 'wb') asfile:
pickle.dump(cals, file)
Error Output
Traceback (most recent call last):
File "test.py", line 28, in <module>
pickle.dump(cals, file)
TypeError: cannot pickle 'Frame' object
Pre-Report Checklist
Issue Description
A
Program
containingFrame
s cannot be pickled if theframes
member has been accessed.For example, in the example below:
pickle
dframes
member cannot bepickle
d (but other individual members can be pickled, such aswaveforms
.pickle
d if theframes
have been accessed, for example, if thecopy_everything_except_instructions()
method has been called.Code Snippet
Error Output
Environment Context
Operating System: Fedora 39
Python: 3.10
PyQuil: 4.7.0
The text was updated successfully, but these errors were encountered: