QCLAB: A Matlab Toolbox for Quantum Computing
Sophia Keip, Daan Camps, Roel Van Beeumen
TL;DR
QCLAB introduces a MATLAB-based, object-oriented toolbox for constructing, simulating, and visualizing quantum circuits, with a focus on numerical stability and accessible prototyping. It provides a full state-vector simulator, supports initialization from bitstrings or vectors, and implements gate application via sparse, extended unitaries, along with mid-circuit and basis-change measurements. The package offers OpenQASM compatibility, circuit visualization, LaTeX export, and a seamless path to the GPU-accelerated QCLAB++ backend, enabling scalable simulations. Through four demonstrations—Quantum Teleportation, Tomography, Grover's algorithm, and Quantum Error Correction—it showcases practical workflows and the transition from MATLAB prototyping to high-performance hardware-ready simulations, positioning QCLAB as a versatile tool beyond MATLAB's native options.
Abstract
We introduce QCLAB, an object-oriented MATLAB toolbox for constructing, representing, and simulating quantum circuits. Designed with an emphasis on numerical stability, efficiency, and performance, QCLAB provides a reliable platform for prototyping and testing quantum algorithms. For advanced performance needs, QCLAB++ serves as a complementary C++ package optimized for GPU-accelerated quantum circuit simulations. Together, QCLAB and QCLAB++ form a comprehensive toolkit, balancing the simplicity of MATLAB scripting with the computational power of GPU acceleration. This paper serves as an introduction to the package and its features along with a hands-on tutorial that invites researchers to explore its capabilities right away.
