Skip to main content

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

GitHub project page

Paper

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. Our testing has mostly been done on Windows, Ubuntu and Arch Linux. 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[at]sfu.ca.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stabiliser_tools-1.0.4.tar.gz (170.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

stabiliser_tools-1.0.4-cp313-cp313-macosx_14_0_arm64.whl (132.2 kB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

stabiliser_tools-1.0.4-cp313-cp313-macosx_13_0_x86_64.whl (146.4 kB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

stabiliser_tools-1.0.4-cp312-cp312-win_amd64.whl (158.0 kB view details)

Uploaded CPython 3.12Windows x86-64

stabiliser_tools-1.0.4-cp312-cp312-manylinux2014_x86_64.whl (175.5 kB view details)

Uploaded CPython 3.12

stabiliser_tools-1.0.4-cp311-cp311-win_amd64.whl (157.8 kB view details)

Uploaded CPython 3.11Windows x86-64

stabiliser_tools-1.0.4-cp311-cp311-manylinux2014_x86_64.whl (164.4 kB view details)

Uploaded CPython 3.11

stabiliser_tools-1.0.4-cp311-cp311-macosx_14_0_arm64.whl (132.2 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

stabiliser_tools-1.0.4-cp311-cp311-macosx_13_0_x86_64.whl (145.7 kB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

stabiliser_tools-1.0.4-cp310-cp310-win_amd64.whl (156.7 kB view details)

Uploaded CPython 3.10Windows x86-64

stabiliser_tools-1.0.4-cp310-cp310-manylinux2014_x86_64.whl (162.8 kB view details)

Uploaded CPython 3.10

stabiliser_tools-1.0.4-cp310-cp310-macosx_14_0_arm64.whl (130.9 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

stabiliser_tools-1.0.4-cp310-cp310-macosx_13_0_x86_64.whl (144.1 kB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

stabiliser_tools-1.0.4-cp39-cp39-win_amd64.whl (153.9 kB view details)

Uploaded CPython 3.9Windows x86-64

stabiliser_tools-1.0.4-cp39-cp39-manylinux2014_x86_64.whl (163.1 kB view details)

Uploaded CPython 3.9

stabiliser_tools-1.0.4-cp39-cp39-macosx_14_0_arm64.whl (131.0 kB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

stabiliser_tools-1.0.4-cp39-cp39-macosx_13_0_x86_64.whl (144.3 kB view details)

Uploaded CPython 3.9macOS 13.0+ x86-64

stabiliser_tools-1.0.4-cp38-cp38-win_amd64.whl (156.7 kB view details)

Uploaded CPython 3.8Windows x86-64

stabiliser_tools-1.0.4-cp38-cp38-manylinux2014_x86_64.whl (162.7 kB view details)

Uploaded CPython 3.8

stabiliser_tools-1.0.4-cp38-cp38-macosx_14_0_arm64.whl (130.7 kB view details)

Uploaded CPython 3.8macOS 14.0+ ARM64

stabiliser_tools-1.0.4-cp38-cp38-macosx_13_0_x86_64.whl (144.0 kB view details)

Uploaded CPython 3.8macOS 13.0+ x86-64

File details

Details for the file stabiliser_tools-1.0.4.tar.gz.

File metadata

  • Download URL: stabiliser_tools-1.0.4.tar.gz
  • Upload date:
  • Size: 170.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for stabiliser_tools-1.0.4.tar.gz
Algorithm Hash digest
SHA256 7a09364fc2b6970bf12917d314b3ed17450f5371c714e484785e8bbd6c1752c0
MD5 0bd54e299c32554827cfe9e7d59105f7
BLAKE2b-256 18c6d4150d1fd04fa4dc2b26bd533cc1bfc2c619546bd8be4b16b0e285b45620

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 8aac8d8af725802684f1450aaedd0e8dff0a3596f1a5cf23cca4ba5572d387c1
MD5 0bcf77e51d3baa7c7826f8a3f13c6a9d
BLAKE2b-256 2434937eb5384bf46f815057e02760f5a0945a7c77a4bfb0e371fe5bcca5f4c9

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 6fa1b4b9af275c85b8f62804c1a784975e44f72d29b548c26ea49003ef02e5ee
MD5 19aa49276cbb2999507c9a4272ffb826
BLAKE2b-256 b69e521b60184d88df2f3332b75420a4ce70c639283937adccb4e6f89fcc1fd3

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 20d2273d0711a47bcd9aaf3160ca45304082f687537bef15212bf6f1cac7a8c7
MD5 a3f2721bcbd3ee2d1e7e6093d64920fc
BLAKE2b-256 d0bd5b069cce9aa6cff3d046257d9e931dd0fcadd035ec6a5e1a9535cb7692b9

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8058625c8ffea279b2441fd01a824cab5de3024c62ad657f68c63b80a2aade9b
MD5 34a10468e87a95bbd499f4b365c11fab
BLAKE2b-256 733645ec08bc587ba4b36f4d36baff5286a0563d62c96330300ff389ec5a8bc8

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4ac24d6bf1331ae83687c7a105e2d4d6d7b7b2cd67e1e26b41e37bf6ed920ca6
MD5 8adb4e80abfa82c594b4cdd13ad1c15f
BLAKE2b-256 5594489f82844b02971acef69b271b9f4f5c0a367bc100cc17b6b8f93471846b

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9c2b07224b9a0d723f1abc9cfd666b56645711c640c46d752f71b2c46fe2da07
MD5 c813cab475e05f3a78a3f0a250ecc4ff
BLAKE2b-256 ad8986410347f49c8987c0cf9b3c2961bc468a21aaa69bcd25927411b6a7e4f7

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 d91d0b5c61b98b29253716732a12e961aef6be6a7ef1e5ffb64a1988423fc556
MD5 2dfeb60d81a90f11e31f8acfff213098
BLAKE2b-256 6a4ff15a66996b84ac25c1a06cc4828649e6777b011c38358cac7b594e43c1f4

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 e510ad04a835ec0ea134ab56c45b2d870793d9f65ba4e4a700791935894a998e
MD5 8f5b3de628fd7683b01b0dd8d89a1e6e
BLAKE2b-256 6b39eb16e8ea9ae7dd8319615c1f111821a8cc597000ed7ef450268dc3a31789

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a5366c261c409760dd1392a0143f29ce0f4fa0cf2a7385f80087312ae59efb8a
MD5 b4d066c4094cee3abff7fc5c813426e4
BLAKE2b-256 95f457e83a2d080f038acca8e2c193b45e9daba2ce6d56250c25e92d090244ad

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f352083b6a450c18bf2be0aa92b112a7cda8c6985bf6e7da39d35f3a247f145f
MD5 201a91658eeba8f161f3b7747d34ccf8
BLAKE2b-256 60b717ae275cf40393c4610c89039ecd8e60e3ef026dedfa64535a9ee5ba91c2

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 0691bf22fd0616e3cd62c91376f8d0d0cce8502a05ead733dd02e3f605abe27a
MD5 83da06ff0006d08bb35dc2cc90c8dceb
BLAKE2b-256 eaa715d24e9164444c949653db328db4ddeb6e7c5b846e0a952b49b5e481646a

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 c5ced37229b8f11d6f72d6d979ed37e013647b3ede3e8e1bceba0371d8ada1b8
MD5 de90510f33480b679554179381f68906
BLAKE2b-256 f63b434a643a9a412c0d033747bd5cd81a6203f329d35fe43a3592c49c250718

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 fefbeb4690f460d6ff213ba4cf6a8dab2c4f94b27cc9ed66bab8e7baf4763528
MD5 9d94dffddc347b9c671e6d4b96c00545
BLAKE2b-256 df02ffa6c09343d5b1a179acfeec8a8adc5e3d9844ee8ee469eb6741d3ca3825

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5e9cd8ed663a8f5e1fe9c1e8326e3de0bc0d3938ad6719eb29c88f1e2f6caa63
MD5 10b6fddf7113aced59516ce14a0a9a42
BLAKE2b-256 db142dfe04204badf459ddd498524136e760e96dd23f55408d1f1705f67794d4

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 7e2a3aa5f941cb9b2f5ecfc0186f48dfb5078474738d00f566e2fd11d88c852a
MD5 793cab02f81805bcb93d1ea233430fbe
BLAKE2b-256 0391879396deda6a279d7a078254498663e25fea77010ef3969868cc96fbbe01

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp39-cp39-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 0cb3e4bca94b78a4bd984e2e22e48d9cce4470f93166c774309a88332eefb649
MD5 4d9d3f0b9bb968f678e7b501b40ea9f2
BLAKE2b-256 2bb931feeac9ac06cc3aec18d67adbb6a7d754c4cb231e2f59246b34e132003a

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 4d13b54564ec3f190e0d81be4dfb517299dac761395215bce91bc3c2d731558b
MD5 b4b8babfd5ae32db6ffd8e9d856b9f5a
BLAKE2b-256 889e9fbac056f014e5ccf79db36b7d53c6505560fab1c87dc858fbb5cbff8645

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 74be3b81c3b98d1fe8669861479d4d037ef6b914b357c9626343190624df837f
MD5 7900006f431d4b7bd1f94384f2b9a87e
BLAKE2b-256 78375b0aeacaadb84f6f4c97f7d66a551c5f8b56f2aca32de6a42b9a4f467c46

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp38-cp38-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp38-cp38-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 74414d9fdad0eb204714971dd809a3ab917ceb02332c2cf7f99d5b4ff661c2c6
MD5 d44023c882000b7c2ad5867bbace7211
BLAKE2b-256 a23b8aef09178f65f63d6d9b1f85eaab6d3658f7badb40b22e74880fec922bfe

See more details on using hashes here.

File details

Details for the file stabiliser_tools-1.0.4-cp38-cp38-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for stabiliser_tools-1.0.4-cp38-cp38-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 ff27e7c7228f6062d69d6f038e5f2b8e6140a1e9ee2b215396aae5fe4d2327e6
MD5 9aef35a020a0a1cf6161c062430ef86b
BLAKE2b-256 a0187c2508c7a70576c6b066773685d904ded78af3b7f6e1ef3c5ca42c110a4a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page