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_unchecked(&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.2.0.tar.gz (104.1 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.2.0-cp39-abi3-win_amd64.whl (427.9 kB view details)

Uploaded CPython 3.9+Windows x86-64

quizx-0.2.0-cp39-abi3-win32.whl (415.0 kB view details)

Uploaded CPython 3.9+Windows x86

quizx-0.2.0-cp39-abi3-musllinux_1_2_x86_64.whl (798.0 kB view details)

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

quizx-0.2.0-cp39-abi3-musllinux_1_2_i686.whl (834.2 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ i686

quizx-0.2.0-cp39-abi3-musllinux_1_2_armv7l.whl (882.2 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARMv7l

quizx-0.2.0-cp39-abi3-musllinux_1_2_aarch64.whl (795.1 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

quizx-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (627.0 kB view details)

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

quizx-0.2.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (689.8 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ s390x

quizx-0.2.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (772.6 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ppc64le

quizx-0.2.0-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (674.5 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ i686

quizx-0.2.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (619.2 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARMv7l

quizx-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (618.3 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

quizx-0.2.0-cp39-abi3-macosx_11_0_arm64.whl (564.5 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

quizx-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl (577.6 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for quizx-0.2.0.tar.gz
Algorithm Hash digest
SHA256 73fe57a0e347b6cd52d3f790e060985d7e585874d2cca41f180a261584f72d61
MD5 9a1ee061b56fecb125f2ca04e8e13e3d
BLAKE2b-256 441b84b370f01d5b0f204f0ea2a3d4ea21e72a4464d538fe317cedc8f51a5536

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for quizx-0.2.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2ab375ca53690a458ec164ef57b88af99d2c643f0b3dbf74b4a3a05383096efd
MD5 8d545af2c65b25e834c105e988935471
BLAKE2b-256 9dc5afd9452f0b37ae9df65066b628377884778270effe46b2e5c43d4d5f94c7

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for quizx-0.2.0-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 ab0e60b1e0cadb6c5f09e84d63bd075dfbe5653a987119d6b2a66080b337c0bf
MD5 0f9d45b30d77c04520ce433ad6038d69
BLAKE2b-256 be342c4d81aa3cb8f156067bbd3024283d948cd37517da7a51dffd171b41bdd5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for quizx-0.2.0-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b40a9fbf4385818eddaf8788fa5e81e4408a89871a1bcdff5f56f27c78bcf338
MD5 c59d24836da0bbd11a681e5309ddfaec
BLAKE2b-256 36a3f0ae999565bd3784120f69c7216127224478279ab464b9caf1967db7c375

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for quizx-0.2.0-cp39-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 2360664e47d5a61f9420114bf6c14b68aa109d8ea9aef0694981290aeee4c1c2
MD5 68865e844f7aeebe683cc7034005ceb9
BLAKE2b-256 ebb7c0b38f6ea0c712b45dbe4fcab3aad59dd39d48c1c0f7c075b595a7ee457b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for quizx-0.2.0-cp39-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 992a68b7791a3080bea0b11aa158ada02341b1620f767a7fd121fdfe70378330
MD5 fe6fbc5548da6ef3c3a7907dc3a7d8ea
BLAKE2b-256 4e63f952ff14def70dae6d28730cebcdad33c8a58fde6e6fa1df964e4c94a88c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for quizx-0.2.0-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 d254820a6f2ce3547bfc32ebfe76d151d038823448cb41a6cd2f07386423e37e
MD5 a6fbf43d336e0fd57ea41dc8dd01e0b6
BLAKE2b-256 adba07ce177df685230123badbb7446e01747b53e60049d0d19487729548adbd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for quizx-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6d4de7c8e577a9c6478f447b1192e8ec0689b61832b24c01fa023fbc83568540
MD5 afba4aaea3c3da37171910f4292d8972
BLAKE2b-256 da1956592c8a0c49f84eab38dd0936358dce39e125403d59255d227901b6a231

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for quizx-0.2.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 3ac3ead00a91719a822955634af96dbd95edd2f7750a2e41cf53054c7583f314
MD5 0b9d6cf993ab9b896a62cc268250d994
BLAKE2b-256 1a3e3133dfac8916e0def13c1d636b3926842bf4e9fbee80c858d1e7f5257f40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for quizx-0.2.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 8c92fa30cfd6b457324275f46d293ab4fcef5d92aa4e91da5fbfdca18ad25450
MD5 3c7608b1d978ac538313017a4360214c
BLAKE2b-256 b97fecd6a350f1ed3dadc55dd8ae43db55566d31f27d22f2777a06977fe27b1f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for quizx-0.2.0-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 a4a6e98297bd54977c661d38d87e5bf32031ee9cb02e5e91b49d80f1f2f668c7
MD5 2a89c922eea0d47c4d45fe4ba2b779a8
BLAKE2b-256 a4bee5deadfdc60c74222037985922bcb07291f236236458c50e85a3b35f0c7f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for quizx-0.2.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 14d3bf494b9187b386ad5a3d4e21d24857bc6b8d5cf339f15d0a1e6c9cf0ba80
MD5 045254ef5048e65038ba07e93e557bd6
BLAKE2b-256 bb8861bfdac640f031efb72e773e757278301d69eb76aea41544e17dbd21ac5b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for quizx-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c7bfc335fd62f7ef68824f2c2b949a12fcd34247467c308be41d75e3cd01d999
MD5 ebd785a8af7bdc721ff400df9e3ca6e8
BLAKE2b-256 08c4892f25e370fa523153b63808b49499f6359d5264aaa940998053b6d87727

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for quizx-0.2.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 709e6626bc4b1b2f8ee9282a492c8a541473f7078e0328317f81491f482094e3
MD5 5ab5cdecafe14fe4ab2e29af44841f36
BLAKE2b-256 101e56d084bc9ea5b949fa705bf552b33e7a606078da587ff9a7096c0d5b335a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for quizx-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8a85b0213d58ea4dbd4adf13345213ce5f3377d36a1f98f144d38ba6d14b9880
MD5 156d147d02f684eb0154ecbc3ecc209e
BLAKE2b-256 654b88f1003bcd5885874068edf1b349eee31debca19dd116f49b60df01ecf82

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