Quantum Simulation Suite with VQE, QPE, and QITE modules (PennyLane-based)
Project description
Quantum Simulation Suite
PennyLane-based workflows for:
- ground-state VQE
- excited-state methods
- quantum phase estimation
- variational imaginary-time evolution
- variational real-time evolution
Implemented packages:
vqefor ground-state and excited-state solversqpefor phase-estimation workflowsqitefor projected variational dynamics (VarQITE,VarQRTE)commonfor shared chemistry, Hamiltonians, caching, and plotting
What This Repo Is Good For
Use this repo if you want:
- one Hamiltonian pipeline shared across VQE, QPE, and QITE/QRTE
- one shared problem-resolution layer for molecule, explicit-geometry, and expert-mode inputs
- reproducible runs with stable cache keys and JSON outputs
- both Python APIs and CLI workflows
- notebooks that separate demos from benchmarks
It is optimized for small-molecule algorithm development and comparison, not large-scale production chemistry.
Choose A Method
Use VQE when you want a ground-state energy or a good reference state.
Use ADAPT-VQE when you want an adaptive ansatz rather than a fixed one.
Use QSE, EOM-QSE, LR-VQE, or EOM-VQE when you already have a converged VQE reference and want excited-state information.
Use SSVQE or VQD when you want variational excited-state solvers directly.
Use QPE when you want spectral / phase information rather than a compact variational state.
Use VarQITE when you want imaginary-time relaxation toward a low-energy state.
Use VarQRTE when you already have a relevant state and want to evolve it in real time and analyze observables.
Use expert-mode Hamiltonian inputs when you want to benchmark algorithms on non-chemistry qubit models without going through the molecule / geometry pipeline.
Install
From PyPI:
pip install vqe-pennylane
From source:
git clone https://github.com/SidRichardsQuantum/Variational_Quantum_Eigensolver.git
cd Variational_Quantum_Eigensolver
pip install -e .
Verify:
python -c "import vqe, qpe, qite, common; print('Quantum stacks imported successfully')"
Quickstart
Python:
import pennylane as qml
from vqe import run_vqe
from qite import run_qite, run_qrte
vqe_res = run_vqe(molecule="H2")
print("VQE:", vqe_res["energy"])
qite_res = run_qite(molecule="H2", steps=50, dtau=0.2)
print("VarQITE:", qite_res["energy"])
qrte_res = run_qrte(molecule="H2", steps=20, dt=0.05)
print("VarQRTE final energy:", qrte_res["energy"])
H_model = qml.Hamiltonian([1.0, 0.5], [qml.PauliZ(0), qml.PauliX(0)])
model_res = run_vqe(
hamiltonian=H_model,
num_qubits=1,
reference_state=[1],
ansatz_name="RY-CZ",
steps=10,
plot=False,
)
print("Model VQE:", model_res["energy"])
CLI:
python -m vqe -m H2
python -m qpe --molecule H2 --ancillas 4 --shots 2000
python -m qite run --molecule H2 --steps 50 --dtau 0.2
python -m qite run-qrte --molecule H2 --steps 20 --dt 0.05
Typical Workflow
For stationary-state work:
- run
VQEto get a ground-state reference - run post-VQE or excited-state solvers if needed
- compare against exact small-system references where possible
For dynamics:
- prepare a state with
VQE,VarQITE, or an excited-state workflow - use
VarQRTEfor real-time dynamics - benchmark against exact evolution on small systems when possible
Package Overview
vqe
Includes:
run_vqerun_adapt_vqerun_lr_vqerun_eom_vqerun_qserun_eom_qserun_ssvqerun_vqd
Use it for:
- ground-state optimization
- excited-state studies
- ansatz / optimizer / mapping comparisons
- geometry scans
- noisy VQE experiments
qpe
Includes:
run_qpe
Use it for:
- phase-to-energy estimation
- ancilla / shot studies
- controlled time-evolution experiments
qite
Includes:
run_qiterun_qrte
Use it for:
- imaginary-time relaxation with
VarQITE - real-time dynamics with
VarQRTE - prepared-state quench workflows
Important:
VarQITEis a state-finding / relaxation methodVarQRTEis a dynamics method, not an eigensolver- for time-independent Hamiltonians,
VarQRTEshould usually conserve energy up to numerical error
Shared Infrastructure
All solver packages use the same chemistry layer in common/.
That gives you:
- consistent Hamiltonians across algorithms
- comparable outputs across methods
- shared run signatures and cache reuse
- standardized result and image paths
Main shared modules:
common/molecules.pycommon/geometry.pycommon/hamiltonian.pycommon/problem.pycommon/persist.pycommon/plotting.pycommon/paths.py
Non-Molecule Mode
The Python APIs also support a direct qubit-Hamiltonian mode for algorithm benchmarking outside chemistry.
Currently supported:
run_vqe(..., hamiltonian=H, num_qubits=..., reference_state=...)run_qite(..., hamiltonian=H, num_qubits=..., reference_state=...)run_qrte(..., hamiltonian=H, num_qubits=..., reference_state=...)run_qpe(..., hamiltonian=H, hf_state=..., system_qubits=...)
Notes:
- this is a Python expert-mode API, not a CLI feature
- arbitrary qubit wire labels are normalized internally
run_qpe(...)expert mode requires bothhamiltonianandhf_state- chemistry-specific ansatzes like
UCCSDstill require chemistry metadata; for generic model Hamiltonians prefer ansatzes likeRY-CZ,Minimal, orStronglyEntanglingLayers
Outputs And Reproducibility
Generated outputs are written under:
results/vqe/
results/qpe/
results/qite/
images/vqe/
images/qpe/
images/qite/
General behavior:
- run configurations are hashed deterministically
- matching runs reuse cached JSON records
--forcerecomputes instead of loading cache
Notebooks
Notebook guide:
Layout:
notebooks/getting_started/for usage-oriented demosnotebooks/benchmarks/for exact-reference, comparison, and scan workflows
Recommended starting points:
notebooks/getting_started/vqe_vs_qpe_from_scratch_h2.ipynbnotebooks/getting_started/06_getting_started_qite_h2.ipynbnotebooks/getting_started/13_getting_started_qrte_h2.ipynbnotebooks/benchmarks/qite/H2/Exact_QRTE_Benchmark.ipynb
Documentation
Use these in order:
README.mdfor orientation and quickstartUSAGE.mdfor CLI and Python entrypointsTHEORY.mdfor algorithmic backgroundnotebooks/README_notebooks.mdfor notebook navigation
Deeper implementation notes:
more_docs/architecture.mdmore_docs/vqe/more_docs/qpe/more_docs/qite/
Repository Layout
Variational_Quantum_Eigensolver/
├── vqe/
├── qpe/
├── qite/
├── common/
├── notebooks/
│ ├── getting_started/
│ └── benchmarks/
├── results/
├── images/
├── README.md
├── USAGE.md
├── THEORY.md
└── pyproject.toml
Testing
pytest -q
Author
Sid Richards
- LinkedIn: sid-richards-21374b30b
- GitHub: SidRichardsQuantum
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vqe_pennylane-0.3.11.tar.gz.
File metadata
- Download URL: vqe_pennylane-0.3.11.tar.gz
- Upload date:
- Size: 131.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40c790b935fb649769b5e37c42c65b56c0df62d946e75d9303c54d5ce75ef944
|
|
| MD5 |
b27b52707530beb1b718337a53c2d7fa
|
|
| BLAKE2b-256 |
14a669348f9e7453ab5423388a5c3a6a42e9a16a687a5ae0537b36176dd14d46
|
File details
Details for the file vqe_pennylane-0.3.11-py3-none-any.whl.
File metadata
- Download URL: vqe_pennylane-0.3.11-py3-none-any.whl
- Upload date:
- Size: 119.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c07bf0593602668e6cc9097165005732c0d026b38d806106b849ebaf70c464d9
|
|
| MD5 |
bba955f614b410b22581347fa09f2d4a
|
|
| BLAKE2b-256 |
757ee8f3a12dc63f712b9adec007db4990f129323e87206a370cd3795ef27a92
|