QCLAB: A MATLAB Toolbox for Quantum Numerical Linear Algebra
Sophia Keip, Daan Camps, Roel Van Beeumen
Abstract
Quantum numerical linear algebra is about solving numerical linear algebra problems on quantum computers - a field that has seen exciting and significant progress in the past few years. Rapid advancements in quantum hardware continue to drive this momentum forward and highlight the fast-paced progress of the field. To facilitate quantum algorithm research, especially as quantum hardware is still maturing, access to robust computational tools is crucial. We present QCLAB (https://github.com/QuantumComputingLab/qclab) [1], an object-oriented MATLAB toolbox for creating, representing and simulating quantum circuits. What sets QCLAB apart is its emphasis on numerical linear algebra, prioritizing numerical stability, efficiency, and performance. This dedication to robust numerical techniques underlies its role as the foundational framework for a range of derived software packages and quantum compilers.
In this talk, featuring a MATLAB tutorial on QCLAB, we will not only showcasing the key features of QCLAB, but also providing an overview of the state of the art in quantum numerical linear algebra research. To offer concrete insights, the presentation will focus on three landmark quantum algorithms: the Quantum Fourier Transform (QFT) [2], Quantum Phase Estimation (QPE) [4], and the Quantum Singular Value Estimation (QSVE) [3]. By demonstrating QCLAB along the way and introducing fundamental concepts in quantum computing, the audience will be encouraged to engage actively with this promising research area.
The QFT is a quantum version of the discrete Fourier transform forming the foundation for numerous quantum algorithms in quantum numerical linear algebra. Building on the QFT, QPE is a principal quantum algorithm used to determine the eigenvalue (or phase) corresponding to an eigenvector of a unitary operator. In simple terms, it estimates the phase \(\theta \) in the equation:
\(\seteqnumber{0}{}{0}\)\begin{align*} U |\psi \rangle = e^{2\pi i \theta } |\psi \rangle , \end{align*} where \(U\) is a unitary operator and \(|\psi \rangle \) is an eigenvector of \(U\). QPE is essential for applications like factoring large numbers (as in Shor’s algorithm) and finding eigenvalues in quantum simulations. Finally, the QSVE extends these principles to non-unitary matrices, allowing singular values to be estimated directly through quantum methods. Both, QPE and QSVE promise polynomial complexity in \(n\) when applied to matrices of size \(2^n\).
To better understand how these quantum algorithms function, we will begin with the underlying principles of quantum computation, highlighting its accessibility for researchers with a linear algebra background [5, 6]. A quantum computation involves the following three key components:
-
• Quantum State: The representation of information, a unit vector in a complex vector space.
-
• State Evolution: The transformation of the quantum state via unitary operators.
-
• Measurement: The process of extracting information from the quantum state.
A common way of representing those three components is a so-called quantum circuit. A Quantum circuit is an intuitive visual way to track the evolution and measurement of a quantum state. QCLAB, based on this circuit model, offers a user-friendly interface for constructing, simulating, and visualizing quantum circuits, in line with most modern quantum hardware platforms.
Because the QCLAB circuits are rendered with the qcircuit package, which does not work well with lwarp, please see the PDF version for further details.
Alongside the numerical linear algebra applications we present in this talk, QCLAB offers a variety of other examples that help users getting familiar with both quantum computing concepts and the toolbox itself. Additionally, extensive documentation is available to make the learning process as smooth as possible.
QCLAB also has a C++ counterpart, QCLAB++ [7, 8], which is designed for more computationally demanding tasks by leveraging GPU capabilities. QCLAB++ retains the same user-friendly syntax as QCLAB, allowing researchers to easily transition from prototyping in MATLAB to scaling up simulations with C++ on GPUs.
This talk is designed for both researchers in numerical linear algebra seeking an easy entry point into quantum computing, and experienced quantum computing practitioners looking for a tool to facilitate rapid prototyping of quantum algorithms.
References
-
[1] D. Camps and R. Van Beeumen. “QCLAB v0.1.2,” Aug. 2021. doi:10.5281/zenodo.5160555. github.com/QuantumComputingLab/qclab
-
[2] D. Coppersmith. “An approximate Fourier transform useful in quantum factoring.” IBM Research Report RC 19642, (1994).
-
[3] A. Gilyén, Y. Su, G. H. Low and N. Wiebe. “Quantum singular value transformation and beyond: exponential improvements for quantum matrix arithmetics.” In Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing (pp. 193-204), (2019).
-
[4] A. W. Harrow, A. Hassidim and S. Lloyd. “Quantum algorithm for linear systems of equations.” Physical review letters, 103(15), (2009).
-
[5] G. Nannicini. “An introduction to quantum computing, without the physics.” SIAM Review 62.4: 936-981, (2020).
-
[6] M. A. Nielsen and I. L. Chuang. “Quantum computation and quantum information,” Vol. 2. Cambridge: Cambridge University Press, (2001).
-
[7] R. Van Beeumen and D. Camps. “QCLAB++ v0.1.2,” Aug. 2021. doi:10.5281/zenodo.5160682. github.com/QuantumComputingLab/qclabpp
-
[8] R. Van Beeumen, D. Camps, and N. Mehta. “QCLAB++: Simulating Quantum Circuits on GPUs,” arXiv:2303.00123 (2023).