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. 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


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.0.tar.gz (170.2 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.0-cp313-cp313-macosx_14_0_arm64.whl (131.8 kB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

stabiliser_tools-1.0.0-cp313-cp313-macosx_13_0_x86_64.whl (146.0 kB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

stabiliser_tools-1.0.0-cp312-cp312-win_amd64.whl (157.6 kB view details)

Uploaded CPython 3.12Windows x86-64

stabiliser_tools-1.0.0-cp312-cp312-manylinux2014_x86_64.whl (175.1 kB view details)

Uploaded CPython 3.12

stabiliser_tools-1.0.0-cp311-cp311-win_amd64.whl (157.4 kB view details)

Uploaded CPython 3.11Windows x86-64

stabiliser_tools-1.0.0-cp311-cp311-manylinux2014_x86_64.whl (164.0 kB view details)

Uploaded CPython 3.11

stabiliser_tools-1.0.0-cp311-cp311-macosx_14_0_arm64.whl (131.8 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

stabiliser_tools-1.0.0-cp311-cp311-macosx_13_0_x86_64.whl (145.3 kB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

stabiliser_tools-1.0.0-cp310-cp310-win_amd64.whl (156.3 kB view details)

Uploaded CPython 3.10Windows x86-64

stabiliser_tools-1.0.0-cp310-cp310-manylinux2014_x86_64.whl (162.5 kB view details)

Uploaded CPython 3.10

stabiliser_tools-1.0.0-cp310-cp310-macosx_14_0_arm64.whl (130.5 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

stabiliser_tools-1.0.0-cp310-cp310-macosx_13_0_x86_64.whl (143.7 kB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

stabiliser_tools-1.0.0-cp39-cp39-win_amd64.whl (153.5 kB view details)

Uploaded CPython 3.9Windows x86-64

stabiliser_tools-1.0.0-cp39-cp39-manylinux2014_x86_64.whl (162.7 kB view details)

Uploaded CPython 3.9

stabiliser_tools-1.0.0-cp39-cp39-macosx_14_0_arm64.whl (130.6 kB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

stabiliser_tools-1.0.0-cp39-cp39-macosx_13_0_x86_64.whl (143.9 kB view details)

Uploaded CPython 3.9macOS 13.0+ x86-64

stabiliser_tools-1.0.0-cp38-cp38-win_amd64.whl (156.3 kB view details)

Uploaded CPython 3.8Windows x86-64

stabiliser_tools-1.0.0-cp38-cp38-manylinux2014_x86_64.whl (162.3 kB view details)

Uploaded CPython 3.8

stabiliser_tools-1.0.0-cp38-cp38-macosx_14_0_arm64.whl (130.3 kB view details)

Uploaded CPython 3.8macOS 14.0+ ARM64

stabiliser_tools-1.0.0-cp38-cp38-macosx_13_0_x86_64.whl (143.6 kB view details)

Uploaded CPython 3.8macOS 13.0+ x86-64

File details

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

File metadata

  • Download URL: stabiliser_tools-1.0.0.tar.gz
  • Upload date:
  • Size: 170.2 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.0.tar.gz
Algorithm Hash digest
SHA256 583a0ad427a10dbf8d46b5fbacd2159af3d343b0f9128db3a5665210cfe945ce
MD5 b4ab23194019ab2469eb164a9175a669
BLAKE2b-256 3ce446f103534e69d852048b8aba6c7153201cec83ff9e010fafd48aa394540b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 2ba8f5ea0fccebd1157c711c34a2ab0cef058dd3980a332834e71144806284fc
MD5 d731f45a03bfb850a709fb2043919ef9
BLAKE2b-256 907fe5ab19e3345e889b5474ba22907a4f63e927025cec500cff1365349121ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 ad34e42339ced0f07670536f5ab91a024c1afc32e4fb7682c737515d366dcd8d
MD5 8a86878e77c65b183c822ebc149bd7aa
BLAKE2b-256 a0aedf16443f3564990aada3408795ee377a46b3987b4a37441121c59230f478

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 69398c624a1059242670ec78cc3ac110d5ac8602d16ac06886a58ced7b9ec436
MD5 080f38820e5d19a575126c48cce3af12
BLAKE2b-256 9d0316892035761cbda76daa64988e391a6e8c0f302eacedb7ad8bedaaebbfd4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7bff0d98d09fc888c3879869f1ae66fbe2fd3d85873f726b740ad03b10ea9e85
MD5 666110cba0583f172a9b9861c74deed3
BLAKE2b-256 f7a6b66dd56f2919728a8a1cca1e9dcfcc3491eb6d45283fe975a034213f86de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 052b2a7ea9b9acd2da8ee1afed6f63801312ed276a87d36326143de7a0d4cec4
MD5 55de7e66cc4d1d69ea1c9271a339e4d9
BLAKE2b-256 593c1c4b83915c79b94e1b00a0386a012c0f80a0e7e56ca344fcef8962cd1ba3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e9a4b442f84f271c2189edca35a799f706494bfdc17e31fdbf1e73cb50f5480f
MD5 b0bbf6fa08547cc0886f5b4422edbf72
BLAKE2b-256 5474988fc0a83c0aa89b7b28564808c7286d3e92c91c216270be8119d8968441

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 f57fcdc308e0cd7694130c4839ae4e3527fabde92ecb3f20e12198b61236aa84
MD5 5801e0df351dc8ab4da8c7b8af4949f0
BLAKE2b-256 f9a6419ae25b95a54bcbda9b36fe967a7759362c07e0f5d75d7ae4eb7dff1767

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 9484910af085607681c89717bbc90fe3cf6d5858f72ecdd290a36a2d82b30259
MD5 26904f72156500a26542a2e337855b74
BLAKE2b-256 e91502c557b72f55a65d9f6d965f32c13620dbfeaa8650960f70f36d3e49d35f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4ba93094a0b9a92818d983ca79865f282727649e88c0e41e374dd73676a16324
MD5 4fec2b6fa9b1582243420b00b12edbbf
BLAKE2b-256 01eb8cee183c9b7a87d132c9054923a696c0888c23995a1d938f678c4306d06d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d7bf23c7d43494f4d581376b94e1cc16be1c925a1f06d1e872f3f64e20b55e94
MD5 661479242185ef274919bdb035b1ca8c
BLAKE2b-256 e9ef67a3bd9e6fe349d13a19e17f335aa455cf0dac493fdf374c23f9073095a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 28bae6a6bf958a1f04c04b77779c310b3adee8b0ee7e0f1cda34dcbda769aff5
MD5 b015cc0137faf802f2403e8820746a7a
BLAKE2b-256 8a8d152a9e107aed34f5545c23265e2f8690cd9665a913a30fc5ae1c56250a52

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 94ea5acc55061cd4c4021e050e09bfba355b088de4af2ede32ec13ffc2fe7766
MD5 525205947fda06059e7d4be81705b0ce
BLAKE2b-256 a93be9d7d54dcef3d319fae5e40f3a78b40de525a6263bf46f0da15bc1af26bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 557e1f6b4f4f3f54dd941ee9e03d360e46a2b17888723b5c7922278cd969fe69
MD5 112970c7e4ee4220aacd3fa71ae5fab5
BLAKE2b-256 1b15a004e80b3034d2e867275c2a82d2f98cbbe41280c84841541a14108a7330

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 828798cbf82bc67d758246e295e709502bbb380fd2e98a5add6fd0eb6b6a3ef5
MD5 03ffe506f72c2d2d336c88b3315fd755
BLAKE2b-256 b1e6d94b8f1606d4358b8ed5a105ac09a4eab1e418f14caeb6224f1a32857ed9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 778df4a267922c2166479819673abc61dc8e032439d8848f17fdf85ca7bd8d5a
MD5 bc8d4841c309565716997928f1f73c01
BLAKE2b-256 08725268900c648c32a636fdd78c96074e65c8575d0e96fb087a989246d04352

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 4b3fa3e8d65958e38ec7266b9b5b21bb101e9e3ab37a07fa85fc43edee0803b4
MD5 7db6a43e4f06f06ffd9e5c22b389e9cd
BLAKE2b-256 646e6f7e024165e70873d79f3ff1ef5808d585aeb2e2211f35aebe2c8779d450

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 ca57d9146c42223113f25dd1cd0a600de1bfc3b8fe5fede44480a2036aa7d762
MD5 a41a596d7163c55973b36cc9289d3ab0
BLAKE2b-256 6cf10af040c0cc180003b91230048ce5443a90edc6be84ee07e199d3d54d1471

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5391b375b30b2d14d72e7b8663dcb6d912ae9cf16bc1b57e6ed76310bf302de7
MD5 f2cb92b6b328b790efa4d2d8a8afdd2a
BLAKE2b-256 975af43d11396d66a981368e33e8495e73ab8d47eded11b0d6e50437dfa95866

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp38-cp38-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 f34af193c2c1914d754986f40bad303eec772ecce3b7b586530f4e130764137c
MD5 2af33792884f625ca0ab8d584879a30c
BLAKE2b-256 02c43b9ed0997c0308292cd0814df3f6f1676c03ca47935d934a0b8fe8ac0f2b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.0-cp38-cp38-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 48a411de7020025cca7622c6e6422e9e1cf70bde6a8f12dc9d2db8c3ac4df82a
MD5 880d398a2fbd5b5b0625187e29f9ed36
BLAKE2b-256 a8a39f987c6519f5e73d79ea08870ea4ad45e44024cd0bb5edd689149435b5bb

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