Skip to main content

Small dense quantum lattice Hamiltonians for exact diagonalization and quantum algorithm prototypes.

Project description

Quantum Lattice Models

PyPI Version Python Versions Tests Docs License Sponsor

Quantum Lattice Models is a lightweight, package-first Python library for constructing, analyzing, plotting, and exporting small lattice Hamiltonians used in physics workflows and quantum algorithm research prototypes.

PyPI: placeholder
Website: placeholder

This repository is organized as an installable package first. The real logic lives in src/quantum_lattice_models/; notebooks, scripts, and examples should stay thin and import the public package API.

Implemented Models

  • Transverse-field Ising spin chain
  • Anisotropic Heisenberg spin chain
  • Su-Schrieffer-Heeger single-particle tight-binding model
  • Generic one-dimensional single-particle tight-binding chain

Spin-chain Hamiltonians are dense qubit-space matrices Tight-binding Hamiltonians are single-particle matrices. This distinction is intentional and explicit.

Why Lattice Models Matter

Small lattice Hamiltonians are useful because they are concrete, inspectable testbeds. They connect physics intuition to numerical linear algebra, and they give quantum algorithm researchers controlled problems for VQE, QPE, QSVT, spectral transforms, quantum walks, and simulation workflows.

This package does not claim quantum advantage. It provides honest small-system tools for exact diagonalization, prototyping, teaching, and notebook-first experiments.

Installation

From a local checkout:

python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"

Minimal runtime dependencies are numpy, scipy, and matplotlib.

PennyLane export is optional:

pip install -e ".[pennylane]"

Notebook support is optional:

python -m pip install -e ".[notebooks]"
python -m ipykernel install --user --name quantum-lattice-models --display-name "Quantum Lattice Models"

Quickstart

from quantum_lattice_models.models import transverse_field_ising
from quantum_lattice_models.spectra import ground_energy, spectral_gap

H = transverse_field_ising(n_sites=4, j=1.0, h=0.5, periodic=False)

print(H.shape)
print(ground_energy(H))
print(spectral_gap(H))
from quantum_lattice_models.models import ssh_model, ssh_edge_state_localizations
from quantum_lattice_models.spectra import eigensystem

H = ssh_model(n_cells=8, t1=0.5, t2=1.0, periodic=False)
values, vectors = eigensystem(H)
weights = ssh_edge_state_localizations(vectors, n_cells=8, edge_cells=2)

Repository Structure

src/quantum_lattice_models/  Package source
tests/                       Pytest test suite
examples/                    Command-line examples that save plots
README.md                    Project overview
USAGE.md                     API examples
THEORY.md                    Model and method notes
RESULTS.md                   Placeholder for generated results

Notebooks as Thin Clients

Notebooks should import from quantum_lattice_models rather than defining their own model logic. A notebook can choose parameters, run spectra, plot results, and tell a story. The package should remain the source of truth.

Development

Use the virtual environment for examples, notebooks, tests, and packaging commands. The standard local checks are:

make format
make lint
make test

The Makefile runs Black one file at a time to avoid multi-file formatter stalls observed in some Codespace environments.

Limitations / Truth Contract

  • Dense spin-chain matrices scale as 2**n_sites by 2**n_sites.
  • These tools are for small systems, education, exact diagonalization, and research prototypes.
  • The SSH and generic tight-binding builders return single-particle matrices, not many-body Fock-space Hamiltonians.
  • PennyLane is optional and only used when explicitly installed.
  • The project is a backend for experiments, not a benchmark suite proving speedup or quantum advantage.

Support development

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

https://github.com/sponsors/SidRichardsQuantum

Sponsorship helps support ongoing work on open-source implementations of quantum algorithms, including improvements to documentation, reproducible workflows, and example notebooks.

Support helps maintain and expand practical tooling for variational quantum methods, quantum simulation workflows, and related experimentation.

Citation

Sid Richards (2026)

Unified Variational and Phase-Estimation Quantum Simulation Suite

Author

Sid Richards

License

MIT. 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

quantum_lattice_models-0.1.0.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

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

quantum_lattice_models-0.1.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file quantum_lattice_models-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for quantum_lattice_models-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eb92a57d02c34e432357b1062c191c6ee3a4177a592e917c84ccf8054e013467
MD5 757109636fa76b11f9a8e59533a10b45
BLAKE2b-256 2985ecbd7a6ffb91a8eae27c50813ff318ddb391819e745b23762f7765553dc7

See more details on using hashes here.

File details

Details for the file quantum_lattice_models-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for quantum_lattice_models-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b67d94483fb2df38c18f4d001be4f6721e63356c5244a8e50f602536c409f5a4
MD5 4c8ab0d91cef74b6e34b4effca813254
BLAKE2b-256 18f37bd7c79864e0595e5884ea861fffe96c62a6c30a1d6edac4d9a2d140053a

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