Developing robust and high performance quantum software is challenging due to the dynamic nature of existing Python-based frameworks, which often suffer from runtime errors and scalability bottlenecks. In this work, we present LogosQ, a high performance backend agnostic quantum computing library implemented in Rust that enforces correctness through compile time type safety. Unlike existing tools, LogosQ leverages Rust static analysis to eliminate entire classes of runtime errors, particularly in parameter-shift rule gradient computations for variational algorithms. We introduce novel optimization techniques, including direct state-vector manipulation, adaptive parallel processing, and an FFT optimized Quantum Fourier Transform, which collectively deliver speedups of up to 900 times for state preparation (QFT) and 2 to 5 times for variational workloads over Python frameworks (PennyLane, Qiskit), 6 to 22 times over Julia implementations (Yao), and competitive performance with Q sharp. Beyond performance, we validate numerical stability through variational quantum eigensolver (VQE) experiments on molecular hydrogen and XYZ Heisenberg models, achieving chemical accuracy even in edge cases where other libraries fail. By combining the safety of systems programming with advanced circuit optimization, LogosQ establishes a new standard for reliable and efficient quantum simulation.
翻译:开发稳健且高性能的量子软件具有挑战性,这主要源于现有基于Python的框架的动态特性,这些框架常受运行时错误和可扩展性瓶颈的困扰。本文提出LogosQ,一个用Rust实现的高性能、后端无关的量子计算库,它通过编译时类型安全来确保正确性。与现有工具不同,LogosQ利用Rust的静态分析能力,彻底消除了整类运行时错误,特别是在变分算法的参数平移规则梯度计算中。我们引入了创新的优化技术,包括直接态矢量操作、自适应并行处理以及FFT优化的量子傅里叶变换,这些技术共同实现了高达900倍的态制备(QFT)加速,变分工作负载相比Python框架(PennyLane、Qiskit)提升2至5倍,相比Julia实现(Yao)提升6至22倍,并与Q#保持竞争性性能。除性能外,我们通过在氢分子和XYZ海森堡模型上的变分量子本征求解器(VQE)实验验证了数值稳定性,即使在其它库失效的边缘情况下也能达到化学精度。通过将系统编程的安全性与先进的电路优化相结合,LogosQ为可靠高效的量子模拟确立了新标准。