Skip to content

Fix incompatibility with Pulsar #993

@JamesBasham

Description

@JamesBasham

Description

When pulsar and stim are both imported, RuntimeError is raised when iterating through a circuit

Steps to Reproduce

# This line somehow corrupts stim
import _pulsar  # The C++ module of pulsar

import stim
print(list(stim.Circuit()))  # RuntimeError: Index 0 not in range for sequence of length 0.

It does not seem to matter whether stim or pulsar is imported first.

Environment

ARM Mac
Python 3.10.18
Fresh pip env containing:

certifi==2025.8.3
numpy==2.2.6
pulsar-client==3.8.0
stim==1.15.0

Affected Versions

stim>1.5.0 (1.5.0 and earlier work)
All pulsar versions 3.0 and greater do not work (less than 3.0 not tested)

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