QuiZX: a quick Rust port of PyZX
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.
Check the Rust Changelog for the latest updates.
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:
= True
=
In QuiZX, the Rust code is slightly more verbose, but similar in spirit:
use *;
loop
On my laptop, the PyZX code takes about 98 seconds to fuse 1 million spiders, whereas the QuiZX code takes 17 milliseconds.