diff --git a/CHANGELOG.md b/CHANGELOG.md index 057a80b6..3d2173b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/docs/demos/from_stim_to_tsim.ipynb b/docs/demos/from_stim_to_tsim.ipynb index 7332b725..98889e6b 100644 --- a/docs/demos/from_stim_to_tsim.ipynb +++ b/docs/demos/from_stim_to_tsim.ipynb @@ -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`." @@ -175,7 +203,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15", + "id": "18", "metadata": {}, "outputs": [], "source": [ @@ -196,7 +224,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16", + "id": "19", "metadata": {}, "outputs": [], "source": [ @@ -206,7 +234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17", + "id": "20", "metadata": {}, "outputs": [], "source": [ @@ -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:" @@ -224,7 +252,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19", + "id": "22", "metadata": {}, "outputs": [], "source": [ @@ -236,7 +264,7 @@ }, { "cell_type": "markdown", - "id": "20", + "id": "23", "metadata": {}, "source": [ "### `REPEAT` instructions are flattened" @@ -244,7 +272,7 @@ }, { "cell_type": "markdown", - "id": "21", + "id": "24", "metadata": {}, "source": [ "Tsim does not support `REPEAT` instructions. Any `REPEAT` instructions will be flattened." @@ -253,7 +281,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22", + "id": "25", "metadata": {}, "outputs": [], "source": [ diff --git a/src/tsim/__init__.py b/src/tsim/__init__.py index 0cce9e32..c77dfe6c 100644 --- a/src/tsim/__init__.py +++ b/src/tsim/__init__.py @@ -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 (