Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: improvements to TorchForwardSimulator #479

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add trivial __getstate__ and __setstate__ needed for serialization
  • Loading branch information
rileyjmurray committed Jul 16, 2024
commit 62f37ec58e7845f93fd7bda72fb8eef6692ad1c0
6 changes: 6 additions & 0 deletions pygsti/modelmembers/povms/conjugatedeffect.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ def __setitem__(self, key, val):
ret = self.columnvec.__setitem__(key, val)
self._ptr_has_changed()
return ret

def __getstate__(self):
return self.__dict__

def __setstate__(self, d):
self.__dict__.update(d)

def __getattr__(self, attr):
#use __dict__ so no chance for recursive __getattr__
Expand Down
6 changes: 6 additions & 0 deletions pygsti/modelmembers/states/densestate.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ def __setitem__(self, key, val):
ret = self.columnvec.__setitem__(key, val)
self._ptr_has_changed()
return ret

def __getstate__(self):
return self.__dict__

def __setstate__(self, d):
self.__dict__.update(d)

def __getattr__(self, attr):
#use __dict__ so no chance for recursive __getattr__
Expand Down