Skip to content

Stim 1.15.0 lacks sample(), causing Sinter 1.15.0 to break with AssertionError #977

@Pritesh402

Description

@Pritesh402

I am encountering an issue when using Stim 1.15.0 (latest from PyPI) together with Sinter 1.15.0 (also from PyPI). Even a minimal test circuit causes Sinter to crash with an AssertionError.

Here’s the environment I’m using:

  • Linux, Red Hat 9, supercomputer cluster
  • Python 3.11.13 (conda-forge)
  • stim 1.15.0
  • sinter 1.15.0
  • pymatching 2.2.2

Minimal test using Stim (Python):

import stim

circuit = stim.Circuit('H 0\nCNOT 0 1\nM 0 1\n')
try:
    samples = circuit.sample(10)
    print('sample() works, shape:', samples.shape)
except Exception as e:
    print('sample() failed:', e)

Result:

sample() failed: 'stim._stim_sse2.Circuit' object has no attribute 'sample'

Minimal test using Sinter (CLI):

sinter collect --circuits test_circuit.stim --decoders pymatching --max_batch_size 1 --processes 1 --max_shots 10

Result:

AssertionError: assert isinstance(self.errors, int)

Additional context:

I have tried:

Downgrading to stim 1.15.0 + sinter 1.15.0 → breaks as above.

Upgrading to stim 1.16.dev (from GitHub) → gives .sample() in Stim, but then mismatches Sinter (no public dev version available).

As far as I can tell, the latest public releases of Stim and Sinter are not currently compatible. It seems sinter 1.15.0 still depends on stim’s .sample() method, which only exists in the dev branch, and there’s no way to get a matching sinter dev build.

Questions:

  1. What versions of Stim and Sinter are expected to work together?
  2. Is there any way to install a matching Sinter dev version to go with stim 1.16.dev?
  3. For Stim standalone, should we switch to .compile_sampler().sample() when .sample() is missing?

Thank you very much for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions