Fast algorithms for verifying and converting specifications of stabiliser states and Clifford gates.
Project description
stabiliser-tools: Fast checks and conversions for stabiliser states, Cliffords and Paulis
stabiliser-tools supports the following specifications:
- Stabiliser states:
- [SV]: a complex vector of amplitudes;
- [SP]: a quadratic form, a linear map, and an affine subspace of $\mathbb{Z}_2^n$;
- [SQ]: a check matrix, i.e. a compact list of Pauli gate generators for the stabiliser group.
- Cliffords:
- [CU]: a unitary matrix;
- [CT]: a list of $2n$ Pauli gates representing the images of basic Pauli gates under conjugation, i.e. a tableau.
After installing the package, its classes and functions can be accessed via
import stab_tools
Note that on Linux and other Unix-like operating systems, you may receive the following output upon importing:
WARNING: You may be about to receive an ImportError. (If you don't, you can safely ignore this message.) To resolve this, try running the following command in your terminal:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<path-to-python-environment>/lib/python3.10/site-packages/stab_tools
This is due to the way shared libraries are linked in Linux. In order to stop this error from occurring in every new terminal session, consider updating LD_LIBRARY_PATH in your .bashrc or .bashprofile file.
After successfully importing stab_tools, run help(stab_tools) to view the list of functions and classes.
Available classes:
Clifford
Pauli
Check_Matrix
Stabiliser_State
Example code:
>>> import stab_tools
>>> import numpy as np
>>> v = np.array([0, 1, 0, 0, 0, 0, 1, 0]) / np.sqrt(2)
>>> stab_tools.is_stabiliser_state(v)
True
>>> s = stab_tools.stabiliser_state_from_statevector(v)
>>> paulis = stab_tools.Check_Matrix(s).get_paulis()
>>> paulis[0].get_matrix()
[[0j, 0j, 0j, 0j, 0j, 0j, 0j, (1-0j)], [0j, 0j, 0j, 0j, 0j, 0j, (1-0j), 0j], [0j, 0j, 0j, 0j, 0j, (1-0j), 0j, 0j], [0j, 0j, 0j, 0j, (1-0j), 0j, 0j, 0j], [0j, 0j, 0j, (1-0j), 0j, 0j, 0j, 0j], [0j, 0j, (1-0j), 0j, 0j, 0j, 0j, 0j], [0j, (1-0j), 0j, 0j, 0j, 0j, 0j, 0j], [(1-0j), 0j, 0j, 0j, 0j, 0j, 0j, 0j]]
>>> pauli_xs = [stab_tools.Pauli(3, 2**n, 0, 0, 0) for n in range(3)]
>>> pauli_xs[0].get_matrix()
[[0j, (1-0j), 0j, 0j, 0j, 0j, 0j, 0j], [(1-0j), 0j, 0j, 0j, 0j, 0j, 0j, 0j], [0j, 0j, 0j, (1-0j), 0j, 0j, 0j, 0j], [0j, 0j, (1-0j), 0j, 0j, 0j, 0j, 0j], [0j, 0j, 0j, 0j, 0j, (1-0j), 0j, 0j], [0j, 0j, 0j, 0j, (1-0j), 0j, 0j, 0j], [0j, 0j, 0j, 0j, 0j, 0j, 0j, (1-0j)], [0j, 0j, 0j, 0j, 0j, 0j, (1-0j), 0j]]
>>> H = np.array([[1, 1], [1, -1]]) / np.sqrt(2)
>>> H2 = np.kron(H, H)
>>> H2
array([[ 0.5, 0.5, 0.5, 0.5],
[ 0.5, -0.5, 0.5, -0.5],
[ 0.5, 0.5, -0.5, -0.5],
[ 0.5, -0.5, -0.5, 0.5]])
>>> stab_tools.is_clifford_matrix(H2)
True
Compatibility
We have compiled and built the underlying C++ source code for a variety of different platforms and CPU architectures. However, if your machine is incompatible with any of the Python wheels, the full source code can be found in the source distribution, as well as on GitHub. You will need the libraries Catch2 and pybind11.
If you are unable to build the code yourself, or if you have any other questions, contact the developers at ming_yin_2@sfu.ca.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stabiliser_tools-1.0.1.tar.gz.
File metadata
- Download URL: stabiliser_tools-1.0.1.tar.gz
- Upload date:
- Size: 170.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56d71004a22b76376dfe0fac7a06692d161795576211cd1ea884276a7f1b4ca2
|
|
| MD5 |
fe407d3ffdb03e9118c69f1ed90fdef0
|
|
| BLAKE2b-256 |
1fed5d8720101d7dba22eddf8b5234b2509c0710789e12a73894c657c25a6e73
|
File details
Details for the file stabiliser_tools-1.0.1-cp313-cp313-macosx_14_0_arm64.whl.
File metadata
- Download URL: stabiliser_tools-1.0.1-cp313-cp313-macosx_14_0_arm64.whl
- Upload date:
- Size: 131.8 kB
- Tags: CPython 3.13, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
607cd201005afdf18eb889da21e73272933524670694429f3ea3a4fdcbf1b9bc
|
|
| MD5 |
f6a6eda1b36d1404bec9cc8f8d293ce8
|
|
| BLAKE2b-256 |
2ba4f1270d8bdc74be9930c29e68a2fa58d406b434bde350ea127a40f239a7e6
|
File details
Details for the file stabiliser_tools-1.0.1-cp313-cp313-macosx_13_0_x86_64.whl.
File metadata
- Download URL: stabiliser_tools-1.0.1-cp313-cp313-macosx_13_0_x86_64.whl
- Upload date:
- Size: 146.0 kB
- Tags: CPython 3.13, macOS 13.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb33585cab1241728bb78f0ac6f477a60483103c44a55d7dfbb9a2b8381fbccf
|
|
| MD5 |
9ed061eb0426fa4b43df2dc070d5a79f
|
|
| BLAKE2b-256 |
ac027ccf684165a018a34e7a683146cb7dea1b37ca5b4df2f771bbf5d0db2926
|
File details
Details for the file stabiliser_tools-1.0.1-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: stabiliser_tools-1.0.1-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 157.6 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c769090e62543d204eb849fdf72c3612646ab12978e393473dd9867ce62987b9
|
|
| MD5 |
52cff74024873d94e5821d0fe694863e
|
|
| BLAKE2b-256 |
b8a2bc722783fa56d7c05e0ad5cd24727c0b14939ae0c0f6f0cd59930001a723
|
File details
Details for the file stabiliser_tools-1.0.1-cp312-cp312-manylinux2014_x86_64.whl.
File metadata
- Download URL: stabiliser_tools-1.0.1-cp312-cp312-manylinux2014_x86_64.whl
- Upload date:
- Size: 175.1 kB
- Tags: CPython 3.12
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5d42a945ac1f3747c782eec20f921583886812ac3056a668172f1a1ebe01102
|
|
| MD5 |
9b0126dd49d083757698c85f44ef0786
|
|
| BLAKE2b-256 |
3eadc8eb740721b42bed591c649dadaa023bc10ec2e983152203cadee52cf36d
|
File details
Details for the file stabiliser_tools-1.0.1-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: stabiliser_tools-1.0.1-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 157.3 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
367307c32910ba7a99289feadeed736602df7c55bc8179fa11dff4cb9a2ce9d4
|
|
| MD5 |
68aa5b15f4e780a56ba2ee77df6e1487
|
|
| BLAKE2b-256 |
3bc64e4bc6aae7f379c8e1acf0186947acae992160a9bd10bf3f30b0db67aa6c
|
File details
Details for the file stabiliser_tools-1.0.1-cp311-cp311-manylinux2014_x86_64.whl.
File metadata
- Download URL: stabiliser_tools-1.0.1-cp311-cp311-manylinux2014_x86_64.whl
- Upload date:
- Size: 164.0 kB
- Tags: CPython 3.11
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d6a713c6da722a4a5a03a3991f9da9481b49268b4ad0e3a9e70b43d21512dde
|
|
| MD5 |
e9f6cd83c98367e4d66eb9270446b950
|
|
| BLAKE2b-256 |
cb9ab72542a4bcad9df81e9764a25e453b7fb2fe06ffc092e7dd7fe2726fa7fe
|
File details
Details for the file stabiliser_tools-1.0.1-cp311-cp311-macosx_14_0_arm64.whl.
File metadata
- Download URL: stabiliser_tools-1.0.1-cp311-cp311-macosx_14_0_arm64.whl
- Upload date:
- Size: 131.8 kB
- Tags: CPython 3.11, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cce43f843f5389fbae5a324ef90726de88afe6ebe92eda4e9ca70701296a1324
|
|
| MD5 |
5faac19793bfc418c56b45d421e166fa
|
|
| BLAKE2b-256 |
4b10ef1f62bae889a50d67ea1ba186fb126a34958b698ee8859f8b6262b177f4
|
File details
Details for the file stabiliser_tools-1.0.1-cp311-cp311-macosx_13_0_x86_64.whl.
File metadata
- Download URL: stabiliser_tools-1.0.1-cp311-cp311-macosx_13_0_x86_64.whl
- Upload date:
- Size: 145.3 kB
- Tags: CPython 3.11, macOS 13.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac60ec2acef1df6490c20a2a5fc8b49c5b9779d118296c0c1dcb6f6b36724ac6
|
|
| MD5 |
99892c0675e3ab93f40895134474177f
|
|
| BLAKE2b-256 |
b5eb18c412c810cea40c029ccffb851417d6d7a6421f33f9042627a78c4f66ed
|
File details
Details for the file stabiliser_tools-1.0.1-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: stabiliser_tools-1.0.1-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 156.3 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5be93b74b898af76932f19981275284117819d1863a4d8327da117997f521eb
|
|
| MD5 |
3f5908322a92e964f1db1789bc921491
|
|
| BLAKE2b-256 |
3f388c6dede792bf70376a8440edc8fa331737ab5c1fcbf0b319acd3194835e0
|
File details
Details for the file stabiliser_tools-1.0.1-cp310-cp310-manylinux2014_x86_64.whl.
File metadata
- Download URL: stabiliser_tools-1.0.1-cp310-cp310-manylinux2014_x86_64.whl
- Upload date:
- Size: 162.4 kB
- Tags: CPython 3.10
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62abd93aaf9cda6f0408bc7655cded8a8bd7e162ed4a19fea1700e727482d2f7
|
|
| MD5 |
b244e33568d7796f41437dd1996053cb
|
|
| BLAKE2b-256 |
835c16d13a120cd7817f8616327f0ba2629ab32937529bf2dba074603dbf7b63
|
File details
Details for the file stabiliser_tools-1.0.1-cp310-cp310-macosx_14_0_arm64.whl.
File metadata
- Download URL: stabiliser_tools-1.0.1-cp310-cp310-macosx_14_0_arm64.whl
- Upload date:
- Size: 130.5 kB
- Tags: CPython 3.10, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5419aacd4a7890143ce50c0edfb13831c528b9f4e73a87b3a4d47db31ba70d9
|
|
| MD5 |
5ab90be91881c901b1e255fda757b980
|
|
| BLAKE2b-256 |
bb645e81f016a3572984f9c8343427d61db63b420e7f744735baf27f0a4a4534
|
File details
Details for the file stabiliser_tools-1.0.1-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: stabiliser_tools-1.0.1-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 153.5 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b897f6c3427f72b45563b81bac37a91c4022dc0dbe2c3219e729d12efcce615
|
|
| MD5 |
14af0a08105b9869d260ad168776ca83
|
|
| BLAKE2b-256 |
0ea158937312e8997ab1f6a936524fdc3adeb48a34aa47bc0ab336e85fa90f13
|
File details
Details for the file stabiliser_tools-1.0.1-cp39-cp39-manylinux2014_x86_64.whl.
File metadata
- Download URL: stabiliser_tools-1.0.1-cp39-cp39-manylinux2014_x86_64.whl
- Upload date:
- Size: 162.7 kB
- Tags: CPython 3.9
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c84f78a4ba484ec9dd62f0de9b6950448dba9a91e5005a71e7444c52e987f498
|
|
| MD5 |
8c83491ee7159f4c014be0892e6a4e03
|
|
| BLAKE2b-256 |
b3d846126d53a379a2f6d8e35e1f37058dba3b766d99b7bf44cff64232b4a6ce
|
File details
Details for the file stabiliser_tools-1.0.1-cp39-cp39-macosx_14_0_arm64.whl.
File metadata
- Download URL: stabiliser_tools-1.0.1-cp39-cp39-macosx_14_0_arm64.whl
- Upload date:
- Size: 130.6 kB
- Tags: CPython 3.9, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70eb87145cedbd11cda475e707558a424271bbc58abdfad863afff62d652ef0b
|
|
| MD5 |
37ecd7f190dc0a6116eb1c269ca53758
|
|
| BLAKE2b-256 |
79f7e17da10953a96e408c6d629b8f525552efe9ea5b38a557091c95b3668c38
|
File details
Details for the file stabiliser_tools-1.0.1-cp39-cp39-macosx_13_0_x86_64.whl.
File metadata
- Download URL: stabiliser_tools-1.0.1-cp39-cp39-macosx_13_0_x86_64.whl
- Upload date:
- Size: 143.8 kB
- Tags: CPython 3.9, macOS 13.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7889a41c51bc358e81057b5724a4b25eb81b53c022235c71712e81b311b1eff3
|
|
| MD5 |
9b9c747c88389821351d93c4282c43b8
|
|
| BLAKE2b-256 |
761b172b6f7a76007909454c3eab687a67c534a4a79627176ff2de798e2dd400
|
File details
Details for the file stabiliser_tools-1.0.1-cp38-cp38-win_amd64.whl.
File metadata
- Download URL: stabiliser_tools-1.0.1-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 156.3 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32d3b3592892c5b684afd5bfbcffd7a6ecd26411441b364696384ac7ea3520d1
|
|
| MD5 |
207159a186de7a271988fbe73a0ac38d
|
|
| BLAKE2b-256 |
44cbf0f149bc47adf76da68fd027133ef5fced5d8c61ee510dcf96113de606d6
|
File details
Details for the file stabiliser_tools-1.0.1-cp38-cp38-manylinux2014_x86_64.whl.
File metadata
- Download URL: stabiliser_tools-1.0.1-cp38-cp38-manylinux2014_x86_64.whl
- Upload date:
- Size: 162.3 kB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
435f1ac4f47dfcedf6d3f4296a92555313fac6097aaacb94b43d5506726289a1
|
|
| MD5 |
fd11b51a84913a002703027fc6e4689d
|
|
| BLAKE2b-256 |
95f54663d7c13c939849e730da68ad1997b642c4ab8026cd9f2718ebc336a4d8
|
File details
Details for the file stabiliser_tools-1.0.1-cp38-cp38-macosx_14_0_arm64.whl.
File metadata
- Download URL: stabiliser_tools-1.0.1-cp38-cp38-macosx_14_0_arm64.whl
- Upload date:
- Size: 130.3 kB
- Tags: CPython 3.8, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6914dd771e5e9b8b861fe1efc0b1cb19517811cd3d860d1954617483a732879
|
|
| MD5 |
9cda38d3fca540eb1fae31f40aaa6122
|
|
| BLAKE2b-256 |
a822fbd3547aa517e61900b4a704287820da549994ce3a3291da4932a6ba5ca3
|
File details
Details for the file stabiliser_tools-1.0.1-cp38-cp38-macosx_13_0_x86_64.whl.
File metadata
- Download URL: stabiliser_tools-1.0.1-cp38-cp38-macosx_13_0_x86_64.whl
- Upload date:
- Size: 143.6 kB
- Tags: CPython 3.8, macOS 13.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07dcc1a24a80e1a90b8c0acbec0283a361286d573398b07fb5468d70c847f989
|
|
| MD5 |
d219b4fdddbf911f9c2057ebb9fb3685
|
|
| BLAKE2b-256 |
48931436f39ea36b182633873dfe4b7c9e5e7c76911eb84d1b4bd8575ea498e1
|