Skip to main content

Educational utilities and examples for Quantum Singular Value Transformation (QSVT) using PennyLane.

Project description

Quantum Singular Value Transformation (QSVT)

PyPI Version Python Versions License Sponsor

Lightweight tools for experimenting with Quantum Singular Value Transformation (QSVT) and bounded polynomial transforms using PennyLane.

This repository combines:

  • a notebook-first introduction to QSVT and QSP
  • a reusable Python package for polynomial design, spectral transforms, and small PennyLane QSVT checks
  • reproducible examples for scalar, matrix, PDE, and small physics workflows

The focus is spectral intuition: how bounded polynomials transform singular values or eigenvalues through block encodings.

Links

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

Apply a scalar polynomial transform:

from qsvt.qsvt import qsvt_scalar_output

result = qsvt_scalar_output(
    x=0.5,
    poly=[0, 0, 1],  # x^2
    encoding_wires=[0],
)

Design a bounded sign polynomial and keep the diagnostics:

from qsvt.workflow import design_workflow

result = design_workflow(
    kind="sign",
    gamma=0.25,
    degree=13,
)

coeffs = result.coeffs
report = result.as_report()

Use the command line interface:

qsvt scalar --x 0.5 --poly "0,0,1"
qsvt design-workflow --kind sign --gamma 0.2 --degree 13
qsvt design-sweep --kind sign --degrees "5,9,13,17" --gamma 0.2 \
  --no-synthesis --output sign-degree-sweep.json
qsvt resource-report --poly "0,0,1" --matrix-dimension 4 --no-synthesis
qsvt benchmark cg-solve --matrix "4,1;1,3" --rhs "1,2" --qsvt-poly "0,1"

See USAGE.md for full Python and CLI workflows.

Package Map

The public package lives under src/qsvt.

module purpose
qsvt.polynomials Chebyshev utilities, parity checks, boundedness checks
qsvt.approximation polynomial fitting and approximation error helpers
qsvt.design task-oriented polynomial builders
qsvt.algorithms end-to-end simulator-scale algorithm workflows
qsvt.templates ready-made bounded polynomial families
qsvt.workflow combined coefficient, diagnostic, and compatibility workflows
qsvt.reports JSON-safe reports and plot helpers
qsvt.resources degree, phase-count, width, and compatibility proxy reports
qsvt.benchmarks classical baselines and QSVT-oriented benchmark summaries
qsvt.matrices small Hermitian test matrices
qsvt.spectral classical spectral matrix-function references
qsvt.qsvt PennyLane QSVT wrappers and comparisons
qsvt.hamiltonians, qsvt.pde, qsvt.rescaling reusable physics and PDE helpers
qsvt.matrix_functions, qsvt.diagnostics matrix-function designs and validation metrics

For detailed function-level documentation, use docs/qsvt/api_reference.md.

The package includes a py.typed marker so type checkers can consume the inline type annotations shipped with the public modules.

Documentation

Current release: 0.1.22

Notebooks

Tutorial notebooks live in notebooks/tutorials/ and introduce QSVT as polynomial functional calculus, from scalar transforms through sign functions, projectors, matrix functions, reusable design workflows, end-to-end algorithm workflows, reproducible reports, degree/error tradeoff studies, and resource-proxy limitations.

Real physics examples live in notebooks/real_examples/ and cover Hamiltonian simulation, ground-state filtering, quantum chemistry, Green's functions, spectral density estimation, Gibbs states, PDE systems, transport physics, spin-chain diagnostics, electronic occupations, photonic band gaps, graphene density of states, topological band projectors, and tensor-network hybrid filtering. Each real-example notebook includes a near-top orientation block for the system, QSVT implementation strategy, and quantum relevance.

Benchmark notebooks live in notebooks/benchmarks/ and compare classical linear-system, spectral, and polynomial matrix-function baselines against QSVT-oriented resource proxies and their underlying assumptions.

See docs/qsvt/notebooks.md for the full notebook map.

Scope

This project is intentionally educational, explicit, simulator-friendly, and polynomial-focused.

It does not aim to provide production-scale circuit optimization, resource estimation, fault-tolerant constructions, amplitude amplification, or state preparation methods. The emphasis is understanding how polynomial transforms act on spectra.

Support

If this repository is useful for research, learning, or experimentation, you can support continued development through GitHub Sponsors.

Author

Sid Richards

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.22.tar.gz (7.2 MB 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.22-py3-none-any.whl (68.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qsvt_pennylane-0.1.22.tar.gz
  • Upload date:
  • Size: 7.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qsvt_pennylane-0.1.22.tar.gz
Algorithm Hash digest
SHA256 f416e0c06354d831f23f633f64960b4582a4990b585f37c24489de1b81a5e7bf
MD5 8cc662029556debb7f01aaad35ae358a
BLAKE2b-256 ac151a107c33e594276126076352ce72bdf6530046970899a396c5bc23434398

See more details on using hashes here.

Provenance

The following attestation bundles were made for qsvt_pennylane-0.1.22.tar.gz:

Publisher: publish.yml on SidRichardsQuantum/Quantum_Singular_Value_Transformation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: qsvt_pennylane-0.1.22-py3-none-any.whl
  • Upload date:
  • Size: 68.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qsvt_pennylane-0.1.22-py3-none-any.whl
Algorithm Hash digest
SHA256 1706e564da93f456b6039410095ddbd647234068001cc82cd1245aeedda1cb18
MD5 7da6de3c97b9db512c6243126a181be9
BLAKE2b-256 f25c543ea277fb2fbc0d2fdd2f129538a31e8c04c1189adb4d27a05ee41f1d15

See more details on using hashes here.

Provenance

The following attestation bundles were made for qsvt_pennylane-0.1.22-py3-none-any.whl:

Publisher: publish.yml on SidRichardsQuantum/Quantum_Singular_Value_Transformation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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