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

Add run-length-encoded option to reference sample method #768

Open
Strilanc opened this issue May 9, 2024 · 0 comments
Open

Add run-length-encoded option to reference sample method #768

Strilanc opened this issue May 9, 2024 · 0 comments

Comments

@Strilanc
Copy link
Collaborator

Strilanc commented May 9, 2024

No description provided.

Strilanc added a commit that referenced this issue May 21, 2024
…ling (#772)

Get a compressed tree representation of the reference sample by using
`stim::ReferenceSampleTree::from_circuit_reference_sample(circuit)`.

The reason for a tree, instead of raw run length encoding, is to support
nested loops (e.g. physical surface code rounds repeating within
repeated logical operations).

Example test:

```
    CircuitGenParameters params(10000, 3, "rotated_memory_x");
    auto circuit = generate_surface_code_circuit(params).circuit;
    circuit.blocks[0].append_from_text("X 10 11 12 13");
    auto ref = ReferenceSampleTree::from_circuit_reference_sample(circuit);
    ASSERT_EQ(ref.str(), "1*(''+2*('00000000')+4999*('0110000000110000')+1*('000000000'))");
```

Example benchmark (25 milliseconds to do a distance 31 surface code with
a billion rounds):

```
    CircuitGenParameters params(1000000000, 31, "rotated_memory_x");
    auto circuit = generate_surface_code_circuit(params).circuit;
    simd_bits<MAX_BITWORD_WIDTH> ref(0);
    auto total = 0;
    benchmark_go([&]() {
        auto result = ReferenceSampleTree::from_circuit_reference_sample(circuit);
        total += result.empty();
    })
        .goal_millis(25);
```

Part of #768
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

No branches or pull requests

1 participant