Skip to main content

Educational utilities and examples for Quantum Singular Value Transformation in PennyLane.

Project description

Quantum Singular Value Transformation (QSVT)

PyPI version Python versions License Tests

Lightweight tools for experimenting with Quantum Singular Value Transformation (QSVT) using PennyLane.

This repository combines:

• a notebook-first introduction to QSVT • a reusable Python package for bounded polynomial transforms

The focus is on spectral intuition:

how bounded polynomials transform singular values or eigenvalues via block encodings.


Installation

Install from PyPI:

pip install qsvt-pennylane

Install from source:

git clone https://github.com/SidRichardsQuantum/Quantum_Singular_Value_Transformation.git
cd Quantum_Singular_Value_Transformation

pip install -e .

Requirements:

  • Python ≥ 3.10
  • PennyLane ≥ 0.36
  • NumPy ≥ 1.23
  • Matplotlib ≥ 3.7

Quick example

Scalar polynomial transform:

from qsvt.qsvt import qsvt_scalar_output

qsvt_scalar_output(
    x=0.5,
    poly=[0,0,1],  # x²
    encoding_wires=[0],
)

Diagonal transform:

from qsvt.qsvt import qsvt_diagonal_transform

qsvt_diagonal_transform(
    values=[1.0, 0.7, 0.3, 0.1],
    poly=[0,0,1],
    encoding_wires=[0,1,2],
)

Design a bounded sign polynomial:

from qsvt.design import design_sign_polynomial

coeffs = design_sign_polynomial(
    gamma=0.25,
    degree=13,
)

Package overview

The package provides small, composable utilities for constructing and applying bounded polynomial transforms.

Polynomial utilities

qsvt.polynomials

  • Chebyshev polynomials
  • polynomial degree and parity
  • boundedness checks
  • coefficient normalisation

Polynomial approximation

qsvt.approximation

  • Chebyshev fitting
  • approximation error metrics
  • polynomial evaluation helpers

Polynomial templates

qsvt.templates

Ready-to-use bounded polynomial families:

  • inverse-like polynomials
  • sign approximations
  • soft threshold filters
  • sqrt approximations
  • exponential weighting functions

Useful for quick experiments.


Polynomial design

qsvt.design

Task-oriented polynomial builders:

  • inverse-like transforms
  • sign polynomials
  • projector polynomials
  • sqrt approximations
  • power-law transforms
  • smooth spectral filters

Designed for reusable QSVT workflows.


Matrix helpers

qsvt.matrices

Small Hermitian test matrices:

  • diagonal matrices
  • rotated diagonal matrices
  • involutory matrices

Classical spectral reference

qsvt.spectral

Reference matrix-function utilities:

  • matrix powers
  • matrix square roots
  • matrix sign
  • spectral projectors

Useful for validating polynomial transforms.


QSVT simulation utilities

qsvt.qsvt

Thin wrappers around PennyLane QSVT:

  • scalar QSVT transforms
  • diagonal transforms
  • block extraction
  • classical vs QSVT comparisons

Documentation

Full documentation:


Notebooks

The notebooks provide a guided introduction to QSVT as polynomial functional calculus.

  1. scalar intuition
  2. singular value filtering
  3. QSP polynomials
  4. exact linear solvers
  5. approximate inverse behaviour
  6. polynomial design and approximation
  7. matrix powers and roots
  8. sign function and projectors
  9. reusable polynomial workflows

The examples emphasise:

  • bounded polynomial structure
  • spectral interpretation
  • simple matrices
  • reproducible results

CLI

After installation:

qsvt scalar --x 0.5 --poly "0,0,1"

qsvt diag \
  --values "1.0,0.7,0.3,0.1" \
  --poly "0,0,1" \
  --wires 3

qsvt cheb --degree 3 --x 0.5

Scope and philosophy

This repository is intentionally:

  • educational
  • explicit
  • simulator-friendly
  • polynomial-focused

The goal is to make QSVT easier to experiment with and understand.

Topics intentionally outside scope:

  • circuit optimisation
  • resource estimation
  • fault tolerance
  • amplitude amplification
  • state preparation methods

The emphasis is understanding how polynomial transforms act on spectra.


Author

Sid Richards

GitHub: https://github.com/SidRichardsQuantum

LinkedIn: https://www.linkedin.com/in/sid-richards-21374b30b/


License

MIT License — see LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qsvt_pennylane-0.1.2.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qsvt_pennylane-0.1.2-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

Details for the file qsvt_pennylane-0.1.2.tar.gz.

File metadata

  • Download URL: qsvt_pennylane-0.1.2.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for qsvt_pennylane-0.1.2.tar.gz
Algorithm Hash digest
SHA256 363b2479e03673af7a03bc5bb6187b79ba8e21732541c5ebcd2485a89f4e24f9
MD5 f13bbd63f6af4e9d196dcce4b1c25356
BLAKE2b-256 40d52c127d3e225176c60520d1b993a693f0bd141480fd9ca9741a9f1649a878

See more details on using hashes here.

File details

Details for the file qsvt_pennylane-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: qsvt_pennylane-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 27.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for qsvt_pennylane-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 38a6a0ca4484f317043222b06e0c869f761c6abc32500c5e34aa9720dae6d36c
MD5 3dddab1566bc66e9a4214e431f7f9fd0
BLAKE2b-256 f6d7e65f75f75ccb8927130688765b68ecc8cd5d9805d131ededd733d3ddf4d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page