Add support for confusion map to PauliMeasurementGate - #8181
Conversation
The methods of PauliMeasurementGate have been updated to account for the inclusion of a confusion map. Tests are added to ensure these updated methods work with a confusion map. The measure_single_paulistring function and test are also updated.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8181 +/- ##
==========================================
- Coverage 99.60% 99.59% -0.01%
==========================================
Files 1118 1118
Lines 101356 101657 +301
==========================================
+ Hits 100952 101250 +298
- Misses 404 407 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
I agree we should use an optional confusion_matrix argument/property instead of confusion_map with a known mandatory index.
Otherwise LGTM with a few inline suggestions.
I am adding @mhucka as a reviewer since I'll be OOO.
PS: If there is no rush, feel free to hold on until I am back.
In a PauliMeasurementGate, the actual measurement is only performed on a single qubit so there is no need to pass in confusion matrices for multiple qubits. The confusion matrix is now handled as a 2x2 numpy matrix.
Adds new tests covering two-qubit gates as well as a confusion matrix that mixes 0 an 1 measurements.
Removed the json serialization test in pauli_measurement_gate_test.py. Instead, another test case is added to PauliMeasurementGate.json
|
Fixed the comments. I'm happy to wait until Pavol is back - this issue has been open 3 years so I think another couple weeks won't hurt :) |
pavoljuhas
left a comment
There was a problem hiding this comment.
LGTM after addressing a few minor cleanups.
Fixes some minor problems caught in code review.
pavoljuhas
left a comment
There was a problem hiding this comment.
Thanks for taking care of this! Before merging please update the PR description so it is suitable as a git commit message.
Closes #5571, building off a previous PR #7373.
This adds support for a confusion matrix to
PauliMeasurementGate.It also updates
measure_single_paulistring()to accept a confusion matrix.