Skip to content
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

[WIP] Allow OBSERVABLE_INCLUDE to target Pauli terms #853

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Strilanc
Copy link
Collaborator

TODO: add crumble support

TODO: add diagram support

There are two use cases driving this change:

  1. Magic state injection needing requiring partially deterministic observables
  2. Simulating all observables of a code without needing to add noiseless ancilla qubits to the circuit

This change allows observables to be split into pieces (e.g. obs 1 for the first half of the circuit and obs 2 for the second half, with the "true" observable their xor). The flip of each individual piece can even be recovered when using flip simulation, if stabilizer randomization is disabled.

This change allows finer control over the logical labels that appear in the detector error model. For example:

import stim
assert stim.Circuit("""
    OBSERVABLE_INCLUDE(0) X0
    OBSERVABLE_INCLUDE(1) Y0
    OBSERVABLE_INCLUDE(2) Z0
    X_ERROR(0.125) 0
    Y_ERROR(0.25) 0
    Z_ERROR(0.375) 0
    OBSERVABLE_INCLUDE(0) X0
    OBSERVABLE_INCLUDE(1) Y0
    OBSERVABLE_INCLUDE(2) Z0
""").detector_error_model() == stim.DetectorErrorModel("""
    error(0.375) L0 L1
    error(0.25) L0 L2
    error(0.125) L1 L2
""")

There are two use cases driving this change:

1. Magic state injection needing requiring partially deterministic observables
2. Simulating all observables of a code without needing to add noiseless ancilla qubits to the circuit

This change allows observables to be split into pieces (e.g. obs 1 for the first half of the circuit and obs 2 for the second half, with the "true" observable their xor). The flip of each individual piece can even be recovered when using flip simulation, if stabilizer randomization is disabled.

This change allows finer control over the logical labels that appear in the detector error model. For example:

```
import stim
assert stim.Circuit("""
    OBSERVABLE_INCLUDE(0) X0
    OBSERVABLE_INCLUDE(1) Y0
    OBSERVABLE_INCLUDE(2) Z0
    X_ERROR(0.125) 0
    Y_ERROR(0.25) 0
    Z_ERROR(0.375) 0
    OBSERVABLE_INCLUDE(0) X0
    OBSERVABLE_INCLUDE(1) Y0
    OBSERVABLE_INCLUDE(2) Z0
""").detector_error_model() == stim.DetectorErrorModel("""
    error(0.375) L0 L1
    error(0.25) L0 L2
    error(0.125) L1 L2
""")
```
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.

1 participant