Skip to main content

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.

Metadata

Release files for quizx 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quizx 0.3.0
File Size Uploaded
quizx-0.3.0.tar.gz 137.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for quizx 0.3.0
File
quizx-0.3.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
quizx-0.3.0-cp39-abi3-win32.whl CPython 3.9 abi3 Windows x86-32 Details
quizx-0.3.0-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details
quizx-0.3.0-cp39-abi3-musllinux_1_2_i686.whl CPython 3.9 abi3 Linux musl 1.2+ x86-32 Details
quizx-0.3.0-cp39-abi3-musllinux_1_2_armv7l.whl CPython 3.9 abi3 Linux musl 1.2+ ARMv7l Details
quizx-0.3.0-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details
quizx-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
quizx-0.3.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl CPython 3.9 abi3 Linux glibc 2.17+ IBM System/390x Details
quizx-0.3.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl CPython 3.9 abi3 Linux glibc 2.17+ PowerPC 64-le Details
quizx-0.3.0-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-32 Details
quizx-0.3.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl CPython 3.9 abi3 Linux glibc 2.17+ ARMv7l Details
quizx-0.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
quizx-0.3.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details

Total release size: 12.9 MB

Release files / quizx-0.3.0.tar.gz

Download URL quizx-0.3.0.tar.gz
Size 137.5 kB
Tags Source
SHA-256 checksum
How to use checksums
80e7977e7e6445c9a6b1bc09c98b679d7e55e3497ba8590e55351bb6a764c0fc
BLAKE2b-256 checksum
How to use checksums
63a8c5d93f6f95e91fb2782e9b9f4c3be9206bbe58dbdf285c9a6d305b65bce7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / quizx-0.3.0-cp39-abi3-win_amd64.whl

Download URL quizx-0.3.0-cp39-abi3-win_amd64.whl
Size 706.1 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
38bf9d4af1cd61ff25c9ae866e944fcacf03831bef93cc27829b51bf34ea3b6b
BLAKE2b-256 checksum
How to use checksums
8dfba1b8a6af0dc50076fca6524c5881fd9e5ee129a1c30ad1559f60d933f987
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / quizx-0.3.0-cp39-abi3-win32.whl

Download URL quizx-0.3.0-cp39-abi3-win32.whl
Size 658.9 kB
Tags CPython 3.9 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
8fbd1c6a4375a59cd26377cc285cacbe95411164724e9da719c051fb069f5d9c
BLAKE2b-256 checksum
How to use checksums
b37e6ff02c510b7a718f1a1c355a212106dc49577def89b5cf8384a1f3c5607b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / quizx-0.3.0-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL quizx-0.3.0-cp39-abi3-musllinux_1_2_x86_64.whl
Size 1.1 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
aede4b59f1113335e27efba7b2c3e90f2a4e8803b0cf35a84b5a53eb98b81ecf
BLAKE2b-256 checksum
How to use checksums
492d68a7d273d8ec028eb8f1be3ae7e75b4254757177b78d2ec56704678c1c59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / quizx-0.3.0-cp39-abi3-musllinux_1_2_i686.whl

Download URL quizx-0.3.0-cp39-abi3-musllinux_1_2_i686.whl
Size 1.2 MB
Tags CPython 3.9 Linux musl 1.2+ x86-32 abi3
SHA-256 checksum
How to use checksums
1a13a281911ed672bbd057080d72dac7f3b611da9d7dd12c1f80d13725834c68
BLAKE2b-256 checksum
How to use checksums
78076a087383c2af17f3cb7ba400f3e0bd9f8d58367a5e72e0c8cff4fa8c36af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / quizx-0.3.0-cp39-abi3-musllinux_1_2_armv7l.whl

Download URL quizx-0.3.0-cp39-abi3-musllinux_1_2_armv7l.whl
Size 1.2 MB
Tags CPython 3.9 Linux musl 1.2+ ARMv7l abi3
SHA-256 checksum
How to use checksums
2258de25e5c3f604bfe7ff00e4fc07f3fbaca508b03d4e6ae2c831705478c97f
BLAKE2b-256 checksum
How to use checksums
59675ef1d83e8e90e6982fe065f7d3011e82378d6f17aa8ec86de563eab9d18a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / quizx-0.3.0-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL quizx-0.3.0-cp39-abi3-musllinux_1_2_aarch64.whl
Size 1.1 MB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
c10cbf04c818ed21c83159460438a800239f0a4d54d2f2e98ebe27768dd1cf22
BLAKE2b-256 checksum
How to use checksums
5540b603c562a61004e5b42101e31cc926266df795d40be019e40bde54b5b355
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / quizx-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL quizx-0.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 981.3 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
e4acdff540a8a194848aed80f0f897cffda082e424e82274585a24eddfb942d7
BLAKE2b-256 checksum
How to use checksums
2779cc1ec43ddf8315da769019132529c3e186aaf30bcda7e8df515679723477
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / quizx-0.3.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL quizx-0.3.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Size 962.6 kB
Tags CPython 3.9 Linux glibc 2.17+ IBM System/390x abi3
SHA-256 checksum
How to use checksums
fee85c08b5f0b4275facb91fe58e8950d238b85cee2e98582b07785ddb2c732e
BLAKE2b-256 checksum
How to use checksums
f64f789f97a0cdcc128d026e29b3680a8295dde1c3bfc26a7e928c59fde250c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / quizx-0.3.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Download URL quizx-0.3.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Size 1.2 MB
Tags CPython 3.9 Linux glibc 2.17+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
6fd0627c7318a2d2416472097014d75a8502132ed5de9664dafae9d8df234928
BLAKE2b-256 checksum
How to use checksums
fae927a5ddfa5fffdc39d105ea1e6a47cfa9f966528f2f6ed6b7b92ac8a24b16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / quizx-0.3.0-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL quizx-0.3.0-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Size 1.0 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-32 abi3
SHA-256 checksum
How to use checksums
23cdcab38359a57ae8e7f7ef4923febc10e11f6b49c81a1e30f1694ad9440993
BLAKE2b-256 checksum
How to use checksums
252eae0a183db8a8620cd2816c46a3e6f905136b2f5076025cb2f945266e55e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / quizx-0.3.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL quizx-0.3.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 919.0 kB
Tags CPython 3.9 Linux glibc 2.17+ ARMv7l abi3
SHA-256 checksum
How to use checksums
12c3ef6165d38349c4a415cb67263a92013d8e0d91b179329cd90ad38760a4a7
BLAKE2b-256 checksum
How to use checksums
f15f32c61beefd3070dbc6fb29297f8c63ee92dd7cc216e0e0eb781fb09e38de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / quizx-0.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL quizx-0.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 903.0 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
f345e40c927e023f5358c44070c4c339e5bc92c40b23ab5962fa62f625e314b6
BLAKE2b-256 checksum
How to use checksums
ca6410b91306bf6dbe2143ed5321f9cde64be249360a3c71be328e71d71ccf1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / quizx-0.3.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL quizx-0.3.0-cp39-abi3-macosx_11_0_arm64.whl
Size 836.9 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c4ed59a6f7637658bab5e52df027f9542962f3e06be1f8d2eb6101d3d4facedd
BLAKE2b-256 checksum
How to use checksums
b974afe0bf45acf4ed97b17796d2b421290551d874150886fa0c3025d5452efa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

0.3.0 This release

14 release files

0.2.0

15 release files

0.1.1

15 release files

0.1.0

97 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page