Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.2] - 2026-04-07

### Fixed
- Exact scalar reduction during sum/product operations to prevent underflows/overflows of int32 on large diagrams. Unfortunately, this change comes with a 2x performance overhead, but results in more stable numerical results (#93)
- Normalization issues for circuits with arbitrary rotation gates now raise a warning instead of an error (#91)
- Parsing errors for invalid Stim circuits now raise useful exceptions (#91)

### Added
- `SPP` and `SPP_DAG` instructions — generalized S gate that phases the -1 eigenspace of Pauli product observables by i or -i. Supports multi-qubit Pauli products and inverted targets (#97)
- `MXX`, `MYY`, `MZZ` two-qubit parity measurement instructions, delegating to existing MPP infrastructure. Also adds `II_ERROR` support (#96)
- `MPAD` instruction for padding the measurement record with fixed bit values (#95)


## [0.1.1] - 2026-04-01

### Added
Expand Down
46 changes: 37 additions & 9 deletions docs/demos/from_stim_to_tsim.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,41 @@
"cell_type": "markdown",
"id": "13",
"metadata": {},
"source": [
"### Decomposition strategies\n",
"\n",
"Tsim supports three stabilizer rank decomposition strategies: `\"cat5\"` (default), `\"bss\"`, and `\"cutting\"`. The strategy can be passed to `compile_sampler` or `compile_detector_sampler`:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "14",
"metadata": {},
"outputs": [],
"source": [
"c.compile_detector_sampler(strategy=\"cutting\")"
]
},
{
"cell_type": "markdown",
"id": "15",
"metadata": {},
"source": [
"Different strategies can yield different performance depending on the circuit structure. If sampling is slow, it can be worth trying an alternative strategy."
]
},
{
"cell_type": "markdown",
"id": "16",
"metadata": {},
"source": [
"### Visualization methods"
]
},
{
"cell_type": "markdown",
"id": "14",
"id": "17",
"metadata": {},
"source": [
"Tsim supports a subset of Stim's visualization methods. Since Tsim is based on ZX diagrams, it also provides visualization via `pyzx`."
Expand All @@ -175,7 +203,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "15",
"id": "18",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -196,7 +224,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "16",
"id": "19",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -206,7 +234,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "17",
"id": "20",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -215,7 +243,7 @@
},
{
"cell_type": "markdown",
"id": "18",
"id": "21",
"metadata": {},
"source": [
"It can be interesting to look at the ZX diagram of more advanced Stim programs. For example, the following program measures a qubit and records the flipped measurement outcome. Based on this outcome, an X gate is applied to a different qubit:"
Expand All @@ -224,7 +252,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "19",
"id": "22",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -236,15 +264,15 @@
},
{
"cell_type": "markdown",
"id": "20",
"id": "23",
"metadata": {},
"source": [
"### `REPEAT` instructions are flattened"
]
},
{
"cell_type": "markdown",
"id": "21",
"id": "24",
"metadata": {},
"source": [
"Tsim does not support `REPEAT` instructions. Any `REPEAT` instructions will be flattened."
Expand All @@ -253,7 +281,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "22",
"id": "25",
"metadata": {},
"outputs": [],
"source": [
Expand Down
2 changes: 1 addition & 1 deletion src/tsim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- `utils/`: Utility functions for visualization and linear algebra.
"""

__version__ = "0.1.0"
__version__ = "0.1.2"

from tsim.circuit import Circuit as Circuit
from tsim.sampler import (
Expand Down
Loading