qsvt-qlsa

Solves linear systems Ax=b using QSVT-based quantum singular value transformation.

18|3|Updated Aug 14, 2026
One-click install
npx skills add https://github.com/unitarylab/quantum-practices --skill qsvt-qlsa-unitarylab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: qsvt-qlsa
Source: https://github.com/unitarylab/quantum-practices/tree/main/algorithms/linear-systems/qsvt-qlsa
Command: npx skills add https://github.com/unitarylab/quantum-practices --skill qsvt-qlsa-unitarylab

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, unitarylab, and includes scripts (resource) components.

What problem does it solve? It solves linear systems of equations Ax = b on quantum hardware by reformulating matrix inversion as a singular value transformation, using the QSVT framework to approximate the 1/x function on the singular values of A. ## Core Features & Use Cases - QSVT Linear Solver Wrapper: Runs the QSVTLinearSolverAlgorithm with matrix A, vector b, and accuracy epsilon, delegating block encoding and polynomial design to unitarylab's QSVTSolver. - Structured Results: Returns the solution vector, scaling factor, simulation time, and an exported SVG circuit diagram. - Educational Reference: Includes an SVD-based manual solver and theory-to-code mapping for studying block encoding, polynomial approximation, and post-selection. - Use Case: A researcher benchmarking quantum linear solvers runs the documented 2x2 example, compares the QSVT solution against numpy.linalg.solve, and inspects the generated circuit diagram. ## Quick Start Ask the assistant to run the QSVT QLSA solver on the matrix [[0.8, 0], [0, 0.4]] with vector [1, 2] and epsilon 1e-4, then report the solution vector and scaling factor.

Frequently Asked Questions about qsvt-qlsa

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I solve a linear system Ax = b with QSVT in Python?

Instantiate QSVTLinearSolverAlgorithm and call run(A, b, epsilon) with a square numpy matrix, a right-hand-side vector, and a target accuracy such as 1e-4. The result dictionary contains the solution vector, scaling factor, runtime, and circuit path.

What is the difference between QSVT QLSA and HHL for linear systems?

QSVT QLSA reformulates inversion as a singular value transformation on a block-encoded matrix using a polynomial approximation of 1/x, while HHL uses phase estimation and controlled rotations. QSVT provides a unified framework with degree O(K log(K/epsilon)) per block-encoding query.

What parameters does the QSVT linear solver require?

The run method requires A (2D square array), b (1D vector matching A's dimension), and epsilon (float accuracy from 1e-10 to 1). Optional arguments include backend (default torch), device (default cpu), and dtype (default complex128).

Why does the QSVT solver fail or give inaccurate results on ill-conditioned matrices?

When the condition number exceeds roughly 100, post-selection success probability drops toward 1e-4 and polynomial degree grows linearly with kappa. For benchmarking, start with well-conditioned matrices where kappa is below 10 and compare against numpy.linalg.solve.

What are the limitations of the QSVT linear system solver?

The matrix A must admit a block encoding with subnormalization alpha >= ||A||, and the inverse polynomial must stay bounded by 1 on [-1, 1]. End-to-end query complexity is O(K * kappa * log(K/epsilon)) with amplitude amplification, not just the polynomial degree.