-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Combining readout circuits for QWC pauli strings in the measure_pauli_strings
method
#7416
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7416 +/- ##
==========================================
- Coverage 98.69% 98.68% -0.01%
==========================================
Files 1112 1112
Lines 97769 97780 +11
==========================================
+ Hits 96491 96499 +8
- Misses 1278 1281 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great! Thanks, @ddddddanni! Tested in this colab.
Thank you!! I will wait for Nour to give a stamp and submit this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @ddddddanni , overall looks good, just a couple of nits + coverage
qubits_to_error: SingleQubitReadoutCalibrationResult, readout_qubits: list[ops.Qid] | ||
) -> SingleQubitReadoutCalibrationResult: | ||
"""Builds a calibration result for the specific readout qubits.""" | ||
return SingleQubitReadoutCalibrationResult( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this should be a SingleQubitReadoutCalibrationResult method
class SingleQubitReadoutCalibrationResult:
...
def readout_result_for_qubits(self, qubits) -> 'SingleQubitReadoutCalibrationResult':
...
@@ -217,6 +217,31 @@ def _normalize_input_paulis( | |||
return cast(dict[circuits.FrozenCircuit, list[list[ops.PauliString]]], circuits_to_pauli) | |||
|
|||
|
|||
def _extract_readout_qubits(pauli_strings: list[ops.PauliString]) -> list[ops.Qid]: | |||
"""Extracts unique qubits from a list of QWC Pauli strings.""" | |||
qubits = set() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
qubits = set() | |
return sorted(set(q for ps in pauli_strings for q in op.qubits)) |
PR #7236 adds the feature to measure groups of qubit-wise-commuting Pauli operators simultaneously.
However, the current implementation generates a separate readout circuit for each individual Pauli operator within a group. This leads to non-simultaneous measurements, which is corrected in this PR.