PyQLAS library lets quantum computers tackle larger linear systems
PyQLAS is a Python hybrid library that lets developers flexibly split linear‑system solving between quantum circuits and classical code, enabling larger problems on current quantum hardware.

Introduction
Quantum algorithms for linear systems promise exponential speed‑ups, but practical use on today’s noisy devices is hampered by limited qubit counts and fragile circuits. The newly released PyQLAS library tackles this gap by providing a product‑ready, hybrid quantum‑classical framework that lets developers decide how much work runs on a quantum processor versus a classical host. Built on the open‑source pyqpanda3 stack, PyQLAS works uniformly on exact state‑vector simulators, local samplers, and real superconducting processors, offering a smooth path from prototype to deployment.
Flexible hybrid architecture
At the heart of PyQLAS is a three‑layer solver hierarchy that surrounds a single variational core:
- Variational core – a bounded‑width quantum circuit that optimizes a sub‑problem using a variational algorithm.
- Outer residual iteration – a classical loop that refines the solution by feeding the residual back into the variational core.
- Krylov‑subspace projection – an additional classical layer that projects the iterates onto a fixed‑dimension subspace, improving convergence for larger systems.
This nesting lets users keep the quantum circuit width fixed (often just two qubits) while the classical host absorbs the growing computational load as problem size increases. The division of labor is an explicit parameter rather than an implicit assumption, giving developers direct control over resource budgeting.
Two‑level preconditioning and dimension alignment
Large, ill‑conditioned linear systems can stall iterative solvers. PyQLAS addresses this with independent preconditioning stages:
- Outer preconditioner – a purely classical routine applied before solver construction. It performs an incomplete LU factorisation, rescales the system by the median singular value, and pads the matrix to the nearest power of two. This padding aligns the problem dimension with the fixed subspace size used by the quantum core, ensuring efficient execution without altering the true solution.
- Inner preconditioner – selected during solver instantiation, it directly modifies the operator that the variational core minimizes, improving convergence of the quantum subroutine.
Together, these steps reduce the condition number and enable stable solves even when the underlying hardware is noisy.
Portable interface: QTask and QMachine
PyQLAS abstracts the quantum backend through two lightweight objects:
- QTask – an immutable description of the quantum workload, including circuit definitions and qubit allocation.
- QMachine – a stateful executor that runs QTasks on a chosen backend and records performance metrics.
Because the interface is backend‑agnostic, the same Python script can be executed on a high‑fidelity simulator, a local sampler, or a cloud‑hosted superconducting processor without code changes. The library also supports solver sharing (multiple solvers using a common QMachine) and checkpointing (saving intermediate states to disk), which are valuable for long‑running simulations or when quantum budget is limited.
Demonstrated accuracy on realistic benchmarks
The authors validated PyQLAS on an IEEE 118‑bus power‑flow test case, embedding the library within a classical Newton‑Raphson iteration. The hybrid solve reproduced the reference classical solution to within 2.3 × 10⁻⁸ in voltage magnitude and a few degrees in angle, confirming that the quantum component does not compromise numerical fidelity. Importantly, the same result was obtained across simulators and a physical superconducting device, highlighting the library’s hardware independence.
Practical impact and next steps
By productizing the division of labor between quantum and classical resources, PyQLAS moves beyond proof‑of‑concept algorithms toward a reusable engineering component. Developers can now experiment with quantum acceleration for linear systems while retaining a stable, familiar Python workflow. Future work may extend the library to other problem classes (e.g., eigenvalue problems) and integrate additional quantum backends, but the current release already offers a solid foundation for hybrid quantum‑classical research and prototyping.
--- PyQLAS demonstrates that thoughtful software design—exposing resource‑allocation knobs, providing robust preconditioning, and ensuring backend portability—can make quantum linear solvers practical on today’s noisy hardware.
Source
Read original sourceWhy we picked this
Accepted from curated QuantumUnzipped source (relevance scoring disabled).