Skip to content

Conversation

@Strilanc
Copy link
Collaborator

@Strilanc Strilanc commented Nov 11, 2024

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
""")
```
@Strilanc Strilanc changed the title [WIP] Allow OBSERVABLE_INCLUDE to target Pauli terms Allow OBSERVABLE_INCLUDE to target Pauli terms Jan 22, 2025
@Strilanc Strilanc merged commit 3751bef into main Jan 23, 2025
57 checks passed
@Strilanc Strilanc deleted the obstargetpaulis branch January 23, 2025 03:39
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