Skip to content

Change how pauli_keys are represented in CummulativeObservableAnnotation#982

Open
AlexBourassa wants to merge 18 commits intomainfrom
u/ab/fix_qubit_id_pauli_keys
Open

Change how pauli_keys are represented in CummulativeObservableAnnotation#982
AlexBourassa wants to merge 18 commits intomainfrom
u/ab/fix_qubit_id_pauli_keys

Conversation

@AlexBourassa
Copy link
Copy Markdown
Collaborator

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 that test_json_backwards_compat_exact still 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.

@AlexBourassa AlexBourassa requested a review from Strilanc July 31, 2025 23:30
Comment thread glue/cirq/stimcirq/_obs_annotation.py
Comment thread glue/cirq/stimcirq/_obs_annotation.py Outdated
@AlexBourassa AlexBourassa requested a review from Strilanc April 13, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants