Skip to content

Commit

Permalink
fix: add check before dumping the mitigation matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
Edoardo-Pedicillo committed Nov 21, 2024
1 parent a5f5dd0 commit 4c0013a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/qibocal/protocols/two_qubit_interaction/chsh/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,16 @@ class CHSHData(Data):

def save(self, path: Path):
"""Saving data including mitigation matrix."""

np.savez(
path / f"{MITIGATION_MATRIX_FILE}.npz",
**{
json.dumps((control, target)): self.mitigation_matrix[control, target]
for control, target, _, _, _ in self.data
},
)
if self.mitigation_matrix:
np.savez(
path / f"{MITIGATION_MATRIX_FILE}.npz",
**{
json.dumps((control, target)): self.mitigation_matrix[
control, target
]
for control, target, _, _, _ in self.data
},
)
super().save(path=path)

@classmethod
Expand Down

0 comments on commit 4c0013a

Please sign in to comment.