We introduce qclab++, a light-weight, fully-templated C++ package for GPU-accelerated quantum circuit simulations. The code offers a high degree of portability as it has no external dependencies and the GPU kernels are generated through OpenMP offloading. qclab++ is designed for performance and numerical stability through highly optimized gate simulation algorithms for 1-qubit, controlled 1-qubit, and 2-qubit gates. Furthermore, we also introduce qclab, a quantum circuit toolbox for Matlab with a syntax that mimics qclab++. This provides users the flexibility and ease of use of a scripting language like Matlab for studying their quantum algorithms, while offering high-performance GPU acceleration when required. As such, the qclab++ library offers a unique combination of features. We compare the CPU simulator in qclab++ with the GPU kernels generated by OpenMP and observe a speedup of over $40\times$. Furthermore, we also compare qclab++ to other circuit simulation packages, such as cirq-qsim and qibo, in a series of benchmarks conducted on NERSC's Perlmutter system and illustrate its competitiveness.
翻译:我们介绍了qclab++,一个轻量级、完全模板化的C++软件包,用于GPU加速的量子电路模拟。该代码具有高度的可移植性,因为它没有外部依赖,并且GPU内核通过OpenMP卸载生成。qclab++通过高度优化的单量子比特、受控单量子比特和双量子比特门模拟算法,实现了高性能和数值稳定性。此外,我们还介绍了qclab,一个用于Matlab的量子电路工具箱,其语法模仿了qclab++。这为用户提供了使用Matlab等脚本语言研究量子算法的灵活性和便利性,同时在需要时提供高性能GPU加速。因此,qclab++库提供了独特的功能组合。我们将qclab++中的CPU模拟器与OpenMP生成的GPU内核进行了比较,观察到了超过$40\times$的加速比。此外,我们还将qclab++与其他电路模拟软件包(如cirq-qsim和qibo)在NERSC的Perlmutter系统上的一系列基准测试中进行了比较,展示了其竞争力。