Stim for VS CodeSyntax highlighting and interactive circuit visualization for Stim and Tsim circuits in Diagrams are produced by Stim's C++ core compiled to WebAssembly and run entirely inside the editor with no Python or native dependencies. Non-Clifford gates are drawn natively; see Tsim support for view-specific limits. Features
InstallInstall Stim by QuEra Computing Inc. from the VS Code Marketplace, or run:
For manual installation, download the VSIX from GitHub Releases and use Extensions: Install from VSIX in VS Code or Cursor. Quick StartOpen a Toggle between different visualization types in the visualization panel.
SVG navigationBy default, hold Ctrl (or Cmd on macOS) while scrolling to zoom. Plain scrolling pans, except in single-layer slice views where it changes layers. Left-button dragging pans in either mode. To zoom with plain scrolling instead, open VS Code Settings and set Stim: Svg Zoom Mode to scroll, or add this to your user or workspace settings:
This applies immediately to open SVG viewers, including Tsim supportThe The grammar highlights all additional instructions currently documented by Tsim: All of these instructions render directly in 2D timeline and time-slice views, including controlled gates and Pauli-product rotations. Rotation angles are in half-turns (multiply by π for radians). Older circuits that encode Tsim gates in Stim tags are still supported. Autocomplete, hover documentation, and signature help cover the complete gate table, including non-Clifford instructions and aliases such as Detector slices and matching graphs require Clifford circuits and report errors for native non-Clifford gates. Gates written in the older tagged form (for example Install from source
Then press Building the WebAssembly engineThe compiled engine ( Requirements: the Emscripten SDK on your
The build compiles Stim plus a small Embind shim ( Development
UI testsThe UI suite uses VS Code Extension Tester and Mocha to drive a real VS Code window with Selenium. It packages and installs the extension into an isolated test profile, then exercises With Node.js 22+ and a graphical desktop, run:
On headless Linux, use The suite intentionally excludes CDN-dependent 3D views and OS clipboard integration. Failures produce screenshots, DOM snapshots, and VS Code/WebDriver logs under ReleaseGitHub Actions tests and packages the extension, attaches the VSIX to a GitHub release, and publishes the same package to Open VSX and the VS Code Marketplace. Complete the one-time publisher setup first. Update
The workflow rejects tags that do not match the package version. Registry publishing runs in independent jobs; rerun failed jobs after resolving any authentication errors. Already published versions are skipped. A manual run on a branch only builds a VSIX unless the Marketplace setup check is selected; that check authenticates without publishing. VSIX files must not be committed. NotesThe interactive 3D viewer loads three.js from a CDN at runtime, so it needs network access. The 2D SVG views work fully offline. LicenseThe extension's own code is MIT-licensed; see LICENSE. The bundled Stim engine is licensed under Apache License 2.0; see LICENSE-Stim.txt. Third-party components retain their respective licenses. See NOTICE and the included |

