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.2.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.2-cp313-cp313-macosx_14_0_arm64.whl (132.2 kB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

stabiliser_tools-1.0.2-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.2-cp312-cp312-win_amd64.whl (158.0 kB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11

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

Uploaded CPython 3.11macOS 14.0+ ARM64

stabiliser_tools-1.0.2-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.2-cp310-cp310-win_amd64.whl (156.7 kB view details)

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10

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

Uploaded CPython 3.10macOS 14.0+ ARM64

stabiliser_tools-1.0.2-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.2-cp39-cp39-win_amd64.whl (153.9 kB view details)

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.9

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

Uploaded CPython 3.9macOS 14.0+ ARM64

stabiliser_tools-1.0.2-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.2-cp38-cp38-win_amd64.whl (156.7 kB view details)

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.8

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

Uploaded CPython 3.8macOS 14.0+ ARM64

stabiliser_tools-1.0.2-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.2.tar.gz.

File metadata

  • Download URL: stabiliser_tools-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 2fca1858b436bdbec4e8a0316268e997e379f59ba414550b33478f64e6603c6f
MD5 a09f256228a54dd294a6fd66f28fd213
BLAKE2b-256 15878f43ce7f6d2d8b2158acc8f2bd5e2ca79ae6ea05af898a2507550f7e11ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 6322554055664d0bed13a0fd03d3e0c1983f5f4fda23f5166ad7b411fb49cb03
MD5 cc9de813c4cdbcc487509a9624d598a7
BLAKE2b-256 cd59382700a28e6dbb77bef827bc38715d6f97bef197dcae6c3feaa347c751c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 a6282ae75edc68489918d475a36006084e331eff3d4e6ea51708111695acc5f4
MD5 4ca74e2b8521a9ea1565e009541e21ad
BLAKE2b-256 3ad387f753a38d1beb8bed9a86fff3caaab05697c7e779e5df1533abba9eff48

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 212c85d1f1bbf5d4c11c42f3429879e42a042346b8ef0f2c03db22d943a40df3
MD5 e069f17c62d03d1a46f460b0c279c3a4
BLAKE2b-256 52bbf1d03264963c9ce1c668904a7f52c7379c767922f4d61be35e94b2cb4b98

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0d57a98e52fd9d7174b3cea3ad967ea057ac9025c1a642ee3fd75cfc14be5b49
MD5 aef8fced6648234668b0b0167332345a
BLAKE2b-256 a46688c3e4b8861b9f63dc0d2667fbb65dbcdfad724717aebbf055d9842d2ca6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3f187b0418a0c071621ff02506ef8d124648c8651a1a3ebb15d9a58a7b6c525f
MD5 910ee7b235176d3184ce32fa2c6a9ee6
BLAKE2b-256 fdec7c7b195c376e07f3b04c4209b955401f3ac9f93787a7c274f69bccb7f3e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2b1f39e7513135d34fb44bcd91fffe0dad0da2dbc7eb7d48e1097acbb7f092d8
MD5 59fa7680eaf52a8704d031c00ea65814
BLAKE2b-256 3f6e433a628754ef70feb2c41f309b026cc5749cff294d8f43a4a33acd8f26fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 53e303576d8bd09ef7a433d506a5c28a4e46d997e39f666c49e259a3a6c9f74c
MD5 f294a81f949f1f40918921076c0c6d62
BLAKE2b-256 e7254fc5c2577f3807d7aa56d97e9399d04358ba48658790efc8ae5c08238118

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 10af6a0d6b8d40e85f79e094a1a5d720733626dbf9b8a49e83534a8635ba4b0d
MD5 b04889f1631ee4c09b3e73ffa0d252bf
BLAKE2b-256 ccd9b180aaa6e733341f2dd4b83a9effd6cb303cb1207aae72b00c77998252a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f2303a45cb6a1d5569e86cdec00d7a45975d589e551dc714a9bd588a72e4a47c
MD5 afe0a3d14858c1c463ed84855ab94b55
BLAKE2b-256 61fdd0221550fc432e65a0b441b9f151554d5994db9841d4db8409a122396619

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6d2b4bb7c4f40fbe5898495eb1212b7ba69f6c4507575cbf15df2064e789f868
MD5 eae560151fb252bdcb13ed24ebff4fc2
BLAKE2b-256 c11b9b8d5636c50ada93ee77cf451c770dadbef1e0e81869bbeba395af4fb916

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 10841fe98adad354c8bbfbc9c8f7d9374dfb7a6d978c746e0d7583ebb10fad04
MD5 f5817bf7a320619799965b995c34e878
BLAKE2b-256 24bc257a6616fcf79b67f68508f73e44a7e958512cd4efbc110afbd71fd85de7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 c8042fae212533865153aa771b9308a1a7fdbc591b91183f71d73cb70e3269e8
MD5 d8704b82d57435343ec09a0936fad58f
BLAKE2b-256 29f860f6d5e13963a6c18977aa414f448951b28b46cc43454220ee3a497bd9c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 948f9cf2a47f722154eee5fad16180c44c60eda7a1d153873d36a579ef3b2fe6
MD5 fcf8dbcab4066a3fd3a5b7122a8e7072
BLAKE2b-256 6b8c509732a92c0903036a1ccc11203aaf67421e57399523f4f241cc317a6570

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4414287756af451889322e4f19e2f2cae93809d6829da3b1282d71201e536bd7
MD5 72d7d6d7e293ce9e7f3a29e7edf49634
BLAKE2b-256 a040abee6d0a1ba8a6f3547c0fce045e0ad4a8b52c9540d9fcc3c7acc763f752

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 11845fcb6b17b836000da737b44956775d3b7f8f1045101ed948aab50243801b
MD5 ed8e9538ddb1aee81bc48c7655100fe8
BLAKE2b-256 997508697a699239ab3bd8b219e301ae34dff01fbfec41d44453c36e6afe910a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 8fcb7ccff11fe4bb5de79ffb0026db2ab35d3f11baf2c7ca5ae962477452c21c
MD5 b4b84d69a23630bd65e31589b6f3e8b6
BLAKE2b-256 97f94b45545267d64c58696eebdfa7f138970e963761ebd6b97fdf8f53a5921b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 46554ec80eb09d0cb34abd1658abb9afa26a4cc9a5fb689a572ae570fa99050b
MD5 88bb28fd8b2e6aea3694acc3b38c46e1
BLAKE2b-256 0ba188baf453931f07fd28feee3a5f4c9864ff992119695c62ae0ce5ba954741

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d7438a1ae70c7050e1ff139d594edb7d1b1c80adabf73f2f94331ebc2d0c6b65
MD5 2cdf70796d403de1953e11e25aec2e9c
BLAKE2b-256 b0655ef71051056e18b313664d3a5dd5167b459f1798a8c1beaef2c641d25188

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp38-cp38-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 3f22d07c3161c21ba95d202b55281e5cfb60f4172d9e95adf0003fbe0468a81d
MD5 da31e7c3d8c6f1a639bb6825fefcf31d
BLAKE2b-256 65357aad6bc1ba6d946659d41906bc750c82eeec66e5e78d73bee95b74b7e65e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.2-cp38-cp38-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 c684a2bd93c27bbfd455c70098093735899a6a63125091223b8246793ad698f0
MD5 8a07e90b23ea488c47d922ed432626d4
BLAKE2b-256 0b52db42bb7aa3513989d68abf05eef4946c9b00850b853a2ef276aa11b4dd70

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