Skip to content

Commit

Permalink
Raising error when incompatible inputs are passed to mitigation (qisk…
Browse files Browse the repository at this point in the history
  • Loading branch information
gadial authored and chriseclectic committed Jun 17, 2020
1 parent 53b3dc6 commit cca221c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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.

0 comments on commit cca221c

Please sign in to comment.