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

Uploaded CPython 3.13macOS 14.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11

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

Uploaded CPython 3.11macOS 14.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10

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

Uploaded CPython 3.10macOS 14.0+ ARM64

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

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.9

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

Uploaded CPython 3.9macOS 14.0+ ARM64

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

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.8

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

Uploaded CPython 3.8macOS 14.0+ ARM64

stabiliser_tools-1.0.3-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.3.tar.gz.

File metadata

  • Download URL: stabiliser_tools-1.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 be39c57fdde5f029136639dc0ceb7447a3491f0da45ef786e6886fa78173eae0
MD5 00c2f9cb3e7969539f16e72684a73fbe
BLAKE2b-256 0115bf8d8c32e92e4508394d8e1eb411dae5d2503557c01467ad24bed800727d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 2300e9107f5d5fe2c61e37c6c7477557271d35103052e87d9c51d8ff52125c23
MD5 c6ecf8d505b57c12529d702bbb4494f4
BLAKE2b-256 f2ab456cd331146f09c33417a8500f5d7416e780179187c849b4d6a8c8a9cb65

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 453f0acd81dd6d5dab96abba0e18b6b124500b897a032eb1ebc5741d6c4682d5
MD5 1414e9f02d1cece702e43f3bc21d03d8
BLAKE2b-256 388c06401dad265f9657be9737870c4322ad20f3317b1139a7a5abe8d02175bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7efcd6ab640d4aec76de3f63b7587580ea575e9262ced1ac2dfd061ebe6046c5
MD5 0f3e2044f92e0a5569904b7b0f476052
BLAKE2b-256 1d972c704aa1b8899e6ff414c7229dfc188c8ec3d5e7a262136f574a249a8c5a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c0c3b21b270e28844149a9e2f5b24f419175a7abd270520e7aa00730a8683374
MD5 6628855fa5b8b326c375961573eda252
BLAKE2b-256 16cae36e0cea7e26ca0ffe3f16e751073569afdb43cf9a24462f253152340e72

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2957101f1e41b006e11459508ca6bd1a16ebadb874c86c874742cf9c8a111fc1
MD5 501e093df54440afd5674a01621ef929
BLAKE2b-256 a809c7a91661a5b870844eaca75c90bb926945c3eb50bfe6c3cf4988909edeb7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dc8fc0481829a04d4d274b6b90926ffc666b84ef88647197b2ba1477831806dc
MD5 1b3c938ee1a5328a9a483f5af37899ab
BLAKE2b-256 320299a11faf3cd9635707e178ac3f16f5a77f2ceb77bd8f50ae36c7f0f7b84a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4555b8c19324884457f0af4251780c03796d780c8c71cf7a8025c94b8ef32361
MD5 d27bfb2872782c40cade9a52c93b1ea3
BLAKE2b-256 dbbea60fa4487a5358729aa38efae47a5459c8bacfb60f0626f5b685d696a1b6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 6d05ad2e045d090333a983fbfea443dab0bcb2a479f63dd51a80fba2da2fa84f
MD5 2572af0e13e4a0812fefecd07e736d92
BLAKE2b-256 3847b387804785e69ec5a09772d749e597e0bb92389184cd1fa0c4791eb19f07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e2825f7616c8f23d8f4001bfe7f529a7e9633bca4eca533b7d1296822763d6ec
MD5 1b77bfcfc79f4887dacd6a641b114fd8
BLAKE2b-256 dea306832782d10f4c5179752d77edbb2a30937ade255be6f05bbc58a8bc0b97

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ae67958c845850817873798626e572570ef78da4fb01d0c971bf270b8e878415
MD5 4360ebc159529f80e2c83285fdb14121
BLAKE2b-256 6babf3ba7558bdadee58cd4c6042a47c0dee5876a43fdfccc30fde78add1c02c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 a50d131c01f1b1f8cbb9b2d05bae3b3f43ad7307888ae8e645ff046965911478
MD5 0cda52835988ec302eb0c1df7c7b4af3
BLAKE2b-256 e7d54589b7362462aebd2cacc9934e423f52ec8ef1a9917259d525e0bce53977

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 8e79fb37ff68d27cf9e4f9fff3a77273e049d941ac18e62adfdc89a1ddc91c8a
MD5 34631724849fc2ae612da7b99ca02816
BLAKE2b-256 52e7e58a31e6d4917372d4d49e35b612f3ad312985af5ae3685c368f44b5e52a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e4b189acafbe278cacd8d7f550ba3bf31637715eea1265d7489af3cb0b411ffc
MD5 55402e5745a6df8a57f4911ed59c2bb1
BLAKE2b-256 86327869a972d6775b100cf1fa7540cbfc33f1dc24e03c7fe66704c81d41c07f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 15c5edeafd26f42901b0cf446bafa18c305a9866e1796cb4cdba097abbb79939
MD5 729347ae82aa1bca112f149dfe05786f
BLAKE2b-256 791ca4aac15518705d0e2151539419da651bca362ccb5f95c9ebd11d806f08c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4a8e27055ed19fbac29ce34a43dcfb22bf17b9be600fa342cc849125031af131
MD5 c1b3dfbc0618707045aef2feb27ee76c
BLAKE2b-256 d398ea967a2f45ad4be52431b6644ffdf925888d0c08a47fce7fd9cb3406ec37

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 36f18db998c9ba52f8a5aa6ce0c3ae2a5cb9eeaf3415290861a345e4130cfb72
MD5 d02fbb197d379e8d863d1132b3361d4a
BLAKE2b-256 b793bb32e3ef77a10f4627b5f6d0e852e337c27b1c38b4dd3ee5bb623df7ec66

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 973e7ed4952a540564b791682e0631e2d92bc2750e7efcaa99e670ae7abf2f72
MD5 56f45afea54d78e2221d09263b912785
BLAKE2b-256 84c4323ed2f6c4d313d7ab3b72a3891a39fb0127a50d658bd562bbeb38c62113

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8207570e0df5b375fe1e772ac2169347e001862d0a024e3b950eb72fb173c8ef
MD5 a41472cb6ce81040c10bcc3aabf9781a
BLAKE2b-256 5ac2050d0501fc3f656b1927418e0507682a571a97961ea4617ad6cf6480231f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp38-cp38-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ba51864cad498e28e21d50eb3b7cd82883619f9c2af8c9453aa691e469c06f28
MD5 267d552467a091247550a3a419dbc36b
BLAKE2b-256 eb827923ea70e741ec09e1aaa8797a7693b6bcefae15fd439f78411448151978

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stabiliser_tools-1.0.3-cp38-cp38-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 473af1a4d3748dde69f34606a5b4fecf51956fcfc62ccfe3b8476950d60993a0
MD5 7f09588990257995043a5fbfe7c29cda
BLAKE2b-256 72e9960a1bcb36463d3e54e75366980d1f0fbf43b426fe4110451dad07917390

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