Skip to main content

emlint

emlint logo

PyPI

stim simulates. sinter samples. emlint verifies.

emlint is a static linter for Stim Detector Error Models (DEMs). It finds structural problems before simulation.

v0.2 is preliminary. The user-facing behavior is usable, but internal APIs and implementation details may change before v1.0.

Quick start

Install emlint:

pip install emlint

Lint a DEM file or raw DEM text:

emlint check circuit.dem
emlint check 'error(0.01) D0 L0
detector D0'

A failing result includes a counter-example identifying the relevant mechanism, detector, or observable. For command options and exit codes, see the CLI reference.

Python

import emlint
import stim

circuit = stim.Circuit.generated(
    "surface_code:rotated_memory_z",
    distance=3,
    rounds=3,
    after_clifford_depolarization=0.001,
)
report = emlint.check(circuit.detector_error_model())
print(emlint.format_text(report))

emlint.check() also accepts a raw DEM string or an explicit pathlib.Path.

Documentation

Guide Use it for
CLI reference Commands, options, output, and exit codes
Check catalog What the six checks detect and how to interpret findings
Debugging guide Check-specific causes and investigation steps
Formal grounding DEM vocabulary and formal properties
v0.2 limitations Scope, warnings, repeat blocks, and provisional behavior

CI

For a minimal GitHub Actions setup, install emlint and run it on changed DEM files:

- name: Install emlint
  run: pip install emlint
- name: Lint DEM files
  run: find . -name "*.dem" -print0 | xargs -0 -r -n1 emlint check

Contributing

See CONTRIBUTING.md for development setup, how to add a check, test requirements, and quality gates.

License

Apache 2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

emlint-0.2.0.tar.gz (49.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

emlint-0.2.0-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file emlint-0.2.0.tar.gz.

File metadata

  • Download URL: emlint-0.2.0.tar.gz
  • Upload date:
  • Size: 49.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for emlint-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4c93d70c7a32ae1c6ee02d83905549c4416a2f8ff2d2365e6bb22dc71bb65b18
MD5 04620b180cb2a2b61691c8b6d54b6606
BLAKE2b-256 1d5764d1be9b8457dc3a1d07e40c3bacb4765b30264fb49783af624c77b5c0e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for emlint-0.2.0.tar.gz:

Publisher: publish.yml on MathysRennela/emlint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file emlint-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: emlint-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for emlint-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 af5dabb171b4efcce9af9b4b8da4d70212493654871766d963ee5f0be707f637
MD5 ab4aee7189e39f2405566af5d73287cc
BLAKE2b-256 ea0b0d095cd172be80c7ad4fd5c529956582509bb37e3ee9edf7c0f15918c023

See more details on using hashes here.

Provenance

The following attestation bundles were made for emlint-0.2.0-py3-none-any.whl:

Publisher: publish.yml on MathysRennela/emlint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.2

2 files

0.2.1

2 files

This release

0.2.0 This release

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page