Skip to main content

Quantum Circuit Optimisation and Compilation using the ZX-calculus

Project description

QuiZX: A quick backend for PyZX

pypi py-version

PyZX is a Python library for quantum circuit optimisation and compiling using the ZX-calculus. It's great for hacking, learning, and trying things out in Jupyter notebooks. However, it's written to maximise clarity and fun, not performance.

This is a port of some of the core functionality of PyZX to the Rust programming language. This is a modern systems programming language, which enables writing software that is very fast and memory efficient.

See the CONTRIBUTING.md file for detailed instructions for building the libraries from source and contributing to the project.

A bit about performance

As a very anecdotal example of the performance difference, the program spider_chain builds a chain of 1 million green spiders and fuses them all. In PyZX, you can fuse all the spiders in a ZX-diagram as follows:

from pyzx.basicrules import *

success = True
while success
    success = any(fuse(g, g.edge_s(e), g.edge_t(e)) for e in g.edges()):

In QuiZX, the Rust code is slightly more verbose, but similar in spirit:

use quizx::basic_rules::*;

loop {
    match g.find_edge(|v0,v1,_| check_spider_fusion(&g, v0, v1)) {
        Some((v0,v1,_)) => spider_fusion_unsafe(&mut g, v0, v1),
        None => break,
    };
}

On my laptop, the PyZX code takes about 98 seconds to fuse 1 million spiders, whereas the QuiZX code takes 17 milliseconds.

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

quizx-0.1.1.tar.gz (97.9 kB view details)

Uploaded Source

Built Distributions

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

quizx-0.1.1-cp39-abi3-win_amd64.whl (575.8 kB view details)

Uploaded CPython 3.9+Windows x86-64

quizx-0.1.1-cp39-abi3-win32.whl (538.2 kB view details)

Uploaded CPython 3.9+Windows x86

quizx-0.1.1-cp39-abi3-musllinux_1_2_x86_64.whl (945.3 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ x86-64

quizx-0.1.1-cp39-abi3-musllinux_1_2_i686.whl (985.5 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ i686

quizx-0.1.1-cp39-abi3-musllinux_1_2_armv7l.whl (1.0 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARMv7l

quizx-0.1.1-cp39-abi3-musllinux_1_2_aarch64.whl (932.6 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

quizx-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (775.6 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

quizx-0.1.1-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (915.9 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ s390x

quizx-0.1.1-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (850.4 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ppc64le

quizx-0.1.1-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (836.3 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ i686

quizx-0.1.1-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (777.1 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARMv7l

quizx-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (754.7 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

quizx-0.1.1-cp39-abi3-macosx_11_0_arm64.whl (686.2 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

quizx-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl (702.9 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file quizx-0.1.1.tar.gz.

File metadata

  • Download URL: quizx-0.1.1.tar.gz
  • Upload date:
  • Size: 97.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.2

File hashes

Hashes for quizx-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ed07874db1b9e91d05dba86d2f4b9a2015a03ec1a6d14d6863920872cad678ec
MD5 49c74d8591c31e069fcec458b059ed4b
BLAKE2b-256 6262c6f3b7de454326dda63059fde5e6c1cedf680bb11f5811e873ab03b84771

See more details on using hashes here.

File details

Details for the file quizx-0.1.1-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: quizx-0.1.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 575.8 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.2

File hashes

Hashes for quizx-0.1.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7f2d05aeb3cf65feb9d3de9ba827646144aa77ed6617baa85fcc46facf0ccfb9
MD5 3db8b50c2165ba5e7ab0d6cf1f148c7f
BLAKE2b-256 b4b52b0caad2cfaff2b0453f115c0c1f95471034372e54e15ed7724683d282a6

See more details on using hashes here.

File details

Details for the file quizx-0.1.1-cp39-abi3-win32.whl.

File metadata

  • Download URL: quizx-0.1.1-cp39-abi3-win32.whl
  • Upload date:
  • Size: 538.2 kB
  • Tags: CPython 3.9+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.2

File hashes

Hashes for quizx-0.1.1-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 31a7b4a4652b4c35fac0e0442f02d45703c0fbe5c67cfa303df86c55d3d7c44b
MD5 88860940d70590977726fce5bba65633
BLAKE2b-256 b74b0288c10f199ff5ebe1cdfa45d00e334eeee957240f1a57449411a787a325

See more details on using hashes here.

File details

Details for the file quizx-0.1.1-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for quizx-0.1.1-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 527c5313fcced31355c4d4f995759b7901d569af91c7b4583da0536ad7fc429f
MD5 2e28f55f5c45cd5e52b5f37861a85c98
BLAKE2b-256 40c10ee9a8d8e3310be18ddb1542a954b2b7d4f6b82ac18887333f1208152b58

See more details on using hashes here.

File details

Details for the file quizx-0.1.1-cp39-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for quizx-0.1.1-cp39-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 5d81c6e833fcc95ab17d0b8609141c1126c6e3905f93bc13bbd836c38e44f971
MD5 a55b859073f8f8685c529f8352753de7
BLAKE2b-256 e0cf129c2841f9a41c2e18e366303030a48ef84c126b19b866f075fcfe821d35

See more details on using hashes here.

File details

Details for the file quizx-0.1.1-cp39-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for quizx-0.1.1-cp39-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 97fbdfb435d083622a232b48eaa0c4aec515671c0549ef0f02b697594e5ce86b
MD5 361e56510b0be7f9fcbb79ed567774e2
BLAKE2b-256 041b97a0ea6ab086687c7d3bc7946b5c02774df07c91e1ceeca74ae03e0d56c7

See more details on using hashes here.

File details

Details for the file quizx-0.1.1-cp39-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for quizx-0.1.1-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 15c25a40b879cf0ba131ce60e8452097f16e643ae4360b59a9278ff87166ea74
MD5 6070627da6e9e0ab986f874cb13afc92
BLAKE2b-256 8d7d4d63ed9b2979722dc19e645a3c2beae4e85445d18c13f0b645994a6f686c

See more details on using hashes here.

File details

Details for the file quizx-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for quizx-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 35c4a72bc70a05b4e596ce9973ca7164fab0fa1d9c4b2846b309b1de3a76604b
MD5 12f14983007632ead376d4e5d22b3a26
BLAKE2b-256 14bd828fd4459d03b4d3035270820d1fa2a10df7b48aeaf51b285e1e7dfb8ba0

See more details on using hashes here.

File details

Details for the file quizx-0.1.1-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for quizx-0.1.1-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 b980a0049e85e48ed11391f4aaa2b992d34e61bde19b5b79586249358810d3e0
MD5 70bfb2fd1abdddacc8c9b86b0307342c
BLAKE2b-256 e9550bf99ae11b54a3c602c48e398b9aad4b5a9939ff8cc664e89e4fdf1c52e9

See more details on using hashes here.

File details

Details for the file quizx-0.1.1-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for quizx-0.1.1-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 8d2e7b59cf7467518f5931cbba428f23fb73e35ed56e6987bf0a1d4326d9340e
MD5 572a3658254fcd88b265b4686bda5d70
BLAKE2b-256 eda4ff97d5f443a99f328b12eba9ae6dfd53242c591d8d3e965c3089af48a423

See more details on using hashes here.

File details

Details for the file quizx-0.1.1-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for quizx-0.1.1-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 4e40c736a341b247b335580aca220fa2e6afaaf112c6d28f3529fcbde61ea8a7
MD5 3221b45b07ae0a821a48bfba6fe44731
BLAKE2b-256 932921823b072581511e0cf55390209926243a82b3be5968ae1f22f5ee460c8c

See more details on using hashes here.

File details

Details for the file quizx-0.1.1-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for quizx-0.1.1-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 5eb926ff162e5fa942e2b12473fc3f151a9f8e77df1b682eaa3d9f7c44a5d074
MD5 88106fd6ecf18d5fc006398db5f66e48
BLAKE2b-256 f4110258aa08609df56874a73c35df1175dc1f8345c04c4b5664a01fa81cfcbc

See more details on using hashes here.

File details

Details for the file quizx-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for quizx-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 27649a42920235ace242ee7485d9098fe49b36d3ce15df7363b405f684394792
MD5 edc341c397f8099b42f3f97350a9e9ab
BLAKE2b-256 c6c0ed43d248400b738fc5dd6825f47b6e868adafee1206e7fa576072d492bba

See more details on using hashes here.

File details

Details for the file quizx-0.1.1-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for quizx-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 330f49045d523a60adcb091e0a21ebad8ccf168b6e036224d00d92d5020b9b5b
MD5 665d537c7fc9284c3f54930545f13990
BLAKE2b-256 4fc934d80ca798f68b46324626bda45193260462669faa3a42924d2446a8f961

See more details on using hashes here.

File details

Details for the file quizx-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for quizx-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 75ad66950420eadf0b6a8be8383645abead1ba7c611cfab633612b629e1998e8
MD5 d63ab8a7e01cb2c6da27c3c07d81fda6
BLAKE2b-256 eae06755fddf04f9bf931021a71e12e1251ab7178d70d0fabe30be92fdd03e60

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