Optyx: Python Library Uses ZX Calculus for Optimised Networked Quantum Architectures and Tensor Network Contraction

Summarize this article with:
The development of large-scale, distributed quantum computing demands new architectures that integrate matter-based qubits with photonic networks, yet current software tools typically address either gate-based processors or linear optics in isolation. To bridge this gap, Mateusz Kupper, Richie Yeung, and Boldizsár Poór, from Quantinuum and the Universities of Sussex and Oxford, alongside Alexis Toumi from DisCoPy, France, and William Cashman and Giovanni de Felice from the University of Oxford, present Optyx, a novel open-source Python framework. This unified language allows users to program, simulate, and prototype complex hybrid systems incorporating qubit registers, photonic modes, and realistic network characteristics such as loss and feedback. By compiling experiments using the ZX/ZW calculus into optimised tensor networks and leveraging advanced contraction schedulers, Optyx achieves significant speedups over existing methods for simulating multi-photon circuits, establishing a powerful platform for both high-performance simulation and rapid prototyping of future photonic quantum networks. This unified language allows researchers to program, simulate, and prototype complex hybrid systems incorporating qubit registers, photonic modes, and realistic network characteristics such as signal loss and feedback loops.
Photonic Quantum Circuits and Variational Optimisation The framework allows for defining circuits as directed acyclic graphs and evaluating their performance, leveraging a backend for numerical computation. The code showcases the creation of entanglement between two nodes using a photonic fusion gate, exploring how to incorporate internal degrees of freedom, such as polarisation, to enhance the entanglement process. NetworkX, a Python library for complex network analysis, is used to represent the network of nodes involved in entanglement distribution. The code simulates the Bose-Hubbard model, a fundamental model in condensed matter physics, using a photonic quantum computer. This model describes interacting bosons on a lattice and is relevant to understanding phenomena like superconductivity. The framework defines a Bose-Hubbard Hamiltonian as a quantum circuit, creating a simple variational ansatz circuit consisting of Mach-Zehnder interferometers. The code implements the Variational Quantum Eigensolver (VQE) algorithm to find the ground state energy of the Bose-Hubbard model, initialising parameters, defining a cost function, calculating gradients, and updating parameters using a gradient descent algorithm.
Hybrid Quantum System Simulation with Optyx Researchers have developed Optyx, a Python framework designed to program, simulate, and prototype hybrid, networked quantum systems combining matter-based qubits with photonic links. This work pioneers a unified language enabling users to create experiments that integrate qubit registers, discrete-variable photonic modes, lossy channels, heralded measurements, and real-time feedback loops within a single platform. The core of Optyx involves compiling experiments via ZX/ZW calculus into optimised tensor-network forms, leveraging graph-theoretic simplifications and reliable circuit extraction techniques to reduce circuit depth and gate count. This approach utilises state-of-the-art contraction schedulers based on Quimb and Cotengra to execute these tensor networks, significantly enhancing simulation performance. Benchmarking against permanent-based methods demonstrates that tensor network contraction delivers speedups of orders of magnitude for low-depth circuits and entangled photon sources. Crucially, the framework natively supports the modelling of both loss and distinguishability, establishing Optyx as a high-performance simulator and rapid-prototyping environment for future photonic quantum networks.
The team built Optyx upon the foundations of categorical quantum mechanics, specifically utilising DisCoPy and PyZX to create a compositional domain-specific language, allowing for a high-level description of network topologies and facilitating automated rewriting and validation workflows. The system employs tensor-network methods to bridge the gap between high-level circuit descriptions and low-level hardware simulations, pushing the boundaries of classical simulability for qubit circuits and extending these techniques to multi-node photonic networks.
Optyx Framework Simulates Hybrid Quantum Networks Scientists have developed Optyx, an open-source Python framework designed to program, simulate, and prototype networked hybrid quantum systems combining qubits and photons. The work introduces a unified language for modelling complex networked systems, incorporating qubit registers, photonic modes, lossy channels, and real-time feedback. Optyx compiles these experiments into optimised tensor-network forms, then executes them with state-of-the-art contraction schedulers based on Quimb and Cotengra. Experiments demonstrate that tensor network contraction delivers significant speedups, orders of magnitude faster than permanent-based methods, for low-depth circuits and entangled photon sources. Crucially, the tensor network approach natively supports loss and distinguishability, establishing it as a high-performance simulator and rapid-prototyping environment for next-generation photonic network experiments. The framework translates diagrams into tensor networks where each generator becomes a tensor, each wire an index, and diagram composition becomes index contraction. Numerical simulations reveal that Optyx can leverage both Quimb and Perceval backends, offering flexibility in evaluation methods. Comparisons to permanent-based methods, which scale exponentially with system size, show the advantage of tensor networks for complex circuits.
The team successfully implemented a qubit teleportation protocol within Optyx, showcasing the framework’s ability to handle both classical and quantum data through controlled boxes and correction mechanisms.
Photonic Networks Simulated with Optyx Framework Optyx represents a significant advance in the ability to design, simulate, and optimise hybrid quantum circuits combining qubits and photons. Researchers have developed an open-source Python framework that provides a unified language for modelling complex networked systems, incorporating qubit registers, photonic modes, lossy channels, and real-time feedback. Crucially, Optyx compiles these experiments into optimised tensor-network forms, enabling simulations that are orders of magnitude faster than previous methods, particularly for circuits involving entangled photons and accounting for realistic effects like signal loss. This achievement positions Optyx as both a high-performance simulator and a rapid-prototyping environment for next-generation photonic network experiments. The framework’s ability to model heterogeneous architectures and explicitly represent the interaction between qubits and photons addresses a critical need in the development of distributed quantum computing. While the current implementation demonstrates performance gains on relatively small instances, the authors acknowledge the need for further development to scale to larger, more complex systems. Future research directions include extending the framework to model quantum communication channels, simulating distributed error correction schemes, and investigating the feasibility of light-matter interfaces in hybrid quantum systems.
The team also intends to explore compilation strategies for mapping abstract circuit descriptions onto distributed hardware with limited connectivity. 👉 More information 🗞 Optyx: A ZX-based Python library for networked quantum architectures 🧠 ArXiv: https://arxiv.org/abs/2512.09648 Tags:
