QSVT Lab is a small educational Python package with visual demos for singular values, block encodings, QSP responses, and QSVT-style singular-value transformations.
pip install -e ".[dev,interactive]"Or create the conda environment:
conda env create -f environment.yml
conda activate qsvt-labRun tests with:
pytestLaunch the Streamlit app with:
qsvt-lab appStreamlit will print a local URL, usually http://localhost:8501.
Pages:
- Singular Values shows small matrices, heatmaps, singular values, condition numbers, and SVD reconstruction error.
- Block Encoding embeds a contraction
Ainto a larger unitaryUand highlights the top-left block that equalsA. - QSP Playground lets you adjust phase angles and inspect a simplified
scalar QSP response over
[-1, 1]. - QSVT Playground lets you choose a polynomial transform, checks whether it is bounded, and applies it to the singular values of a small matrix.
- Matrix Inverse Demo compares a true inverse or pseudoinverse with a regularized polynomial inverse approximation.
- Filtering Demo creates a noisy low-rank matrix and applies a singular-value threshold filter.
Recommended path:
- Start with Singular Values to build SVD intuition.
- Continue to Block Encoding to see why extra dimensions are needed.
- Use QSP Playground to see how phases change a scalar response.
- Use QSVT Playground to connect bounded polynomials to transformed singular values.
- Finish with Matrix Inverse Demo and Filtering Demo to see why small singular values are useful but dangerous.
What the visualizations simplify:
- The app uses tiny real matrices so every entry and singular value remains inspectable.
- The QSP page is an educational simulator, not a phase-synthesis tool.
- The QSVT page applies polynomial responses directly to singular values; it does not construct a full quantum circuit.
- The inverse demo uses a fitted polynomial response to mimic regularized inversion, so it is a stability illustration rather than an optimized approximation algorithm.