Change how pauli_keys are represented in CummulativeObservableAnnotation#982
Open
AlexBourassa wants to merge 18 commits intomainfrom
Open
Change how pauli_keys are represented in CummulativeObservableAnnotation#982AlexBourassa wants to merge 18 commits intomainfrom
AlexBourassa wants to merge 18 commits intomainfrom
Conversation
Strilanc
reviewed
Aug 1, 2025
Strilanc
reviewed
Aug 1, 2025
…Stim into u/ab/fix_qubit_id_pauli_keys
Strilanc
approved these changes
Apr 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I don't love it, but the previous representation is insufficient because if we modify the cirq circuit the "stim qubit id" of these pauli keys gets out of sync. Therefore, we need to convert the qubit representation to the actual coordinates to keep track of this.
Let me know what you think! Or if you have suggestions on how to achieve this in another way.
Also regarding the backward compatibility, I added some ugly logic in the init to support
Iterable[str]to make sure thattest_json_backwards_compat_exactstill passes, but alternatively we could also just avoid that logic and not be backward compatible here. I don't think we have many (or any?) serialized cirq_circuit with non-deterministic observables yet (certainly none that we care about!). But anyway let me know what you prefer.