Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

Raising error when incompatible inputs are passed to mitigation #420

Merged
merged 2 commits into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions qiskit/ignis/mitigation/measurement/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ def apply(self,
# check forms of raw_data
if isinstance(raw_data, dict):
# counts dictionary
for data_label in raw_data.keys():
if data_label not in self._state_labels:
raise QiskitError("Unexpected state label '" + data_label +
"', verify the fitter's state labels "
"correpsond to the input data")
data_format = 0
# convert to form2
raw_data2 = [np.zeros(len(self._state_labels), dtype=float)]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
fixes:
- |
Raises `QiskitError` when using incorrect labels in measurement mitigation.