Optyx: A ZX-based Python library for networked quantum architectures
Mateusz Kupper, Richie Yeung, Boldizsár Poór, Alexis Toumi, William Cashman, Giovanni de Felice
TL;DR
Optyx presents a ZX/ZW-based, open-source Python framework that unifies qubit and discrete-variable photonic modalities into a single diagrammatic language for networked quantum architectures. It combines a functional front-end with a tensor-network semantics, enabling classical control, mid-circuit feedback, and differentiable backends that include exact tensor-network contractions and permanent-based paths. The system supports conversion of external circuits, loss and distinguishability modeling, and rapid prototyping of hybrid experiments, demonstrated through boson sampling with entangled states, distributed entanglement generation, and a Bose-Hubbard variational solver. This approach offers scalable simulation and rapid exploration of distributed, heterogeneous quantum hardware, providing a practical platform for testing new ideas in quantum communication, distributed error correction, and light-mmatter interfacing.
Abstract
Distributed, large-scale quantum computing will need architectures that combine matter-based qubits with photonic links, but today's software stacks target either gate-based chips or linear-optical devices in isolation. We introduce Optyx, an open-source Python framework offering a unified language to program, simulate, and prototype hybrid, networked systems: users create experiments that mix qubit registers, discrete-variable photonic modes, lossy channels, heralded measurements, and real-time feedback; Optyx compiles them via ZX/ZW calculus into optimised tensor-network forms, and executes with state-of-the-art contraction schedulers based on Quimb and Cotengra. Benchmarking on exact multi-photon circuit simulations shows that, versus permanent-based methods, tensor network contraction can deliver speedups of orders of magnitude for low-depth circuits and entangled photon sources, and natively supports loss and distinguishability -- establishing it as both a high-performance simulator and a rapid-prototyping environment for next-generation photonic-network experiments.
