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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Initial release
- Clifford+T circuit simulation via stabilizer rank decomposition
- Stabilizer decomposition backend based on pyzx and the [paramzx-extension](https://github.com/mjsutcliffe99/ParamZX) by [(2025) M Sutcliffe and A Kissinger](https://arxiv.org/pdf/2403.06777)
- Support for all [Stim](https://github.com/quantumlib/Stim) instructions
- Support for most [Stim](https://github.com/quantumlib/Stim) instructions
- `T`, `T_DAG`, `R_Z`, `R_X`, `R_Y`, and `U3` instructions
- Arbitrary rotations gates via magic cat state decomposition from Eq. 10 of [(2021) Qassim et al.](https://arxiv.org/pdf/2106.07740)
- GPU acceleration via jax
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Tsim can be five orders of magnitude faster than [quizx](https://github.com/zxca

## Supported Instructions

Tsim supports all [Stim instructions](https://github.com/quantumlib/Stim/wiki/Stim-v1.9-Gate-Reference). In addition, Tsim defines the following non-Clifford instructions:
Tsim supports most [Stim instructions](https://github.com/quantumlib/Stim/wiki/Stim-v1.9-Gate-Reference). In addition, Tsim defines the following non-Clifford instructions:

### `T` and `T_DAG`

Expand Down
97 changes: 58 additions & 39 deletions docs/demos/overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"source": [
"### Clifford Instructions\n",
"\n",
"Tsim supports all instructions [supported by Stim](https://github.com/quantumlib/Stim/wiki/Stim-v1.9-Gate-Reference). Below we show the standard generating set of Clifford gates:"
"Tsim supports most instructions [supported by Stim](https://github.com/quantumlib/Stim/wiki/Stim-v1.9-Gate-Reference). Below we show the standard generating set of Clifford gates:"
]
},
{
Expand Down Expand Up @@ -330,6 +330,25 @@
"cell_type": "markdown",
"id": "28",
"metadata": {},
"source": [
"The `SPP` instruction phases the $-1$ eigenspace of a Pauli product observable by $i$. For example, `SPP Z0` is equivalent to the `S` gate, and `SPP X0*X1` is equivalent to `SQRT_XX`. The `SPP_DAG` instruction phases by $-i$ instead. The `!` operator inverts the product, swapping `SPP` and `SPP_DAG` behavior."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "29",
"metadata": {},
"outputs": [],
"source": [
"c = Circuit(\"SPP X0*Y1*Z2\")\n",
"c.diagram(\"timeline-svg\", height=220)"
]
},
{
"cell_type": "markdown",
"id": "30",
"metadata": {},
"source": [
"### Noise Channels\n",
"\n",
Expand All @@ -341,7 +360,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "29",
"id": "31",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -351,7 +370,7 @@
},
{
"cell_type": "markdown",
"id": "30",
"id": "32",
"metadata": {},
"source": [
"The `PAULI_CHANNEL_1(p_x, p_y, p_z)` instruction is a `X`, `Y`, and `Z` instruction that is applied with probabilities `p_x`, `p_y`, and `p_z` respectively."
Expand All @@ -360,7 +379,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "31",
"id": "33",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -370,7 +389,7 @@
},
{
"cell_type": "markdown",
"id": "32",
"id": "34",
"metadata": {},
"source": [
"The `PAULI_CHANNEL_2` instruction takes fifteen floats specifying the disjoint probabilities of each possible Pauli pair\n",
Expand All @@ -397,7 +416,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "33",
"id": "35",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -409,7 +428,7 @@
},
{
"cell_type": "markdown",
"id": "34",
"id": "36",
"metadata": {},
"source": [
"The `DEPOLARIZE1(p)` instruction applies a randomly chosen Pauli with probability `p`."
Expand All @@ -418,7 +437,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "35",
"id": "37",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -428,7 +447,7 @@
},
{
"cell_type": "markdown",
"id": "36",
"id": "38",
"metadata": {},
"source": [
"The `DEPOLARIZE2(p)` instruction applies a randomly chosen two-qubit Pauli with probability `p`."
Expand All @@ -437,7 +456,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "37",
"id": "39",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -447,7 +466,7 @@
},
{
"cell_type": "markdown",
"id": "38",
"id": "40",
"metadata": {},
"source": [
"The `CORRELATED_ERROR(p)` instruction applies a specified Pauli product with probability `p`. If no error occurred, then a following `ELSE_CORRELATED_ERROR(p2)` instruction may apply a Pauli product with probabiliy `p2`. If no error occurs again, further `ELSE_CORRELATED_ERROR(pi)` instructions in the chain may apply a Pauli products."
Expand All @@ -456,7 +475,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "39",
"id": "41",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -470,7 +489,7 @@
},
{
"cell_type": "markdown",
"id": "40",
"id": "42",
"metadata": {},
"source": [
"### Annotations\n",
Expand All @@ -483,7 +502,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "41",
"id": "43",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -496,7 +515,7 @@
},
{
"cell_type": "markdown",
"id": "42",
"id": "44",
"metadata": {},
"source": [
"The `OBSERVABLE_INCLUDE` instruction is only used in observable sampling mode and ignored otherwise. It instructs the detector sampler to record the XOR of the specified measurement bits."
Expand All @@ -505,7 +524,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "43",
"id": "45",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -518,7 +537,7 @@
},
{
"cell_type": "markdown",
"id": "44",
"id": "46",
"metadata": {},
"source": [
"## Sampling\n",
Expand All @@ -529,7 +548,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "45",
"id": "47",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -546,7 +565,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "46",
"id": "48",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -555,7 +574,7 @@
},
{
"cell_type": "markdown",
"id": "47",
"id": "49",
"metadata": {},
"source": [
"The second sampling mode is detector sampling. This will sample detector events and observable values. Detector and observable bits can always be obtained by linear transformations of the measurement bits as return by the measurement sampler.\n",
Expand All @@ -565,7 +584,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "48",
"id": "50",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -584,7 +603,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "49",
"id": "51",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -595,7 +614,7 @@
},
{
"cell_type": "markdown",
"id": "50",
"id": "52",
"metadata": {},
"source": [
"Finally, Tsim allows to compute probability values for target states via the `CompiledStateProbs` sampler."
Expand All @@ -604,7 +623,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "51",
"id": "53",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -617,7 +636,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "52",
"id": "54",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -627,7 +646,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "53",
"id": "55",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -637,7 +656,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "54",
"id": "56",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -647,7 +666,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "55",
"id": "57",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -656,7 +675,7 @@
},
{
"cell_type": "markdown",
"id": "56",
"id": "58",
"metadata": {},
"source": [
"## Visualization\n",
Expand All @@ -669,7 +688,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "57",
"id": "59",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -696,7 +715,7 @@
},
{
"cell_type": "markdown",
"id": "58",
"id": "60",
"metadata": {},
"source": [
"When `TICK` instructions are present, each tick can be shown as a 2D time slice with the `timeslice-svg` diagram. Here, `QUBIT_COORDS` annotations can be used to specify the 2D coordinates of the qubits."
Expand All @@ -705,7 +724,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "59",
"id": "61",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -714,7 +733,7 @@
},
{
"cell_type": "markdown",
"id": "60",
"id": "62",
"metadata": {},
"source": [
"With the `pyzx` argument, the circuit can be visualized using the [pyzx](https://github.com/zxcalc/pyzx) as a ZX-diagram."
Expand All @@ -723,7 +742,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "61",
"id": "63",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -732,7 +751,7 @@
},
{
"cell_type": "markdown",
"id": "62",
"id": "64",
"metadata": {},
"source": [
"The `pyzx-meas` and `pyzx-dets` diagrams show ZX diagrams where outputs represent probabilities of measurement outcomes for measurement and detector/observables, respectively."
Expand All @@ -741,7 +760,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "63",
"id": "65",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -751,7 +770,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "64",
"id": "66",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -760,7 +779,7 @@
},
{
"cell_type": "markdown",
"id": "65",
"id": "67",
"metadata": {},
"source": [
"## Detector Error Models\n",
Expand All @@ -771,7 +790,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "66",
"id": "68",
"metadata": {},
"outputs": [],
"source": [
Expand Down
Loading
Loading