Hamiltonian VQE Kit (hvk)
Hamiltonian VQE Kit (hvk) is an open-source, scientifically validated toolkit designed to take any molecular or qubit Hamiltonian and synthesize a diagnosed VQE / ADAPT-VQE workflow capable of achieving chemical accuracy (≤ 1.6 mHa vs. Full Configuration Interaction / FCI) with strict, verifiable accounting of quantum simulation cost.
📌 Core Modules
| Module | Purpose |
|---|---|
hvk.chemistry |
PySCF & OpenFermion Hamiltonian loaders, Jordan-Wigner transformation, Pauli parsing, FCI & HF reference solutions |
hvk.audit |
Hamiltonian 2-body interaction graph analysis and wasted CNOT audit vs. rigid hardware-efficient ansätze (HEA) |
hvk.adapt |
Exact ADAPT-VQE engine with fermionic/qubit operator pools, commutator gradients, and strict measurement tracking |
hvk.ansatz |
Deterministic, connected sparse ansatz generator derived directly from Hamiltonian interaction topology |
hvk.init |
Principled statevector initializers (Random, Hartree-Fock, Perturbation-Adjusted HF, Guarded Residual ML) |
hvk.diagnostics |
Barren plateau gradient variance analyzers and realistic NISQ energy-error-under-noise benchmarks |
hvk.exporters |
Zero-overhead circuit and operator export to Qiskit, PennyLane, and Cirq |
hvk.cli |
Unified command-line interface (`hvk audit |
⚖️ Non-Negotiable Honesty Rules
This repository operates under strict scientific reproducibility constraints:
- Zero Hardcoded Numbers: Every metric, iteration count, and energy reported in documentation or tables must be generated by verifiable scripts in
benchmarks/results/recording random seed, commit hash, and dependency versions. - FCI/PySCF Parity: All molecular test systems (H₂, LiH, BeH₂, H₄ chain) must be validated directly against PySCF Hartree-Fock and FCI exact ground states. Tests fail if reference energies diverge.
- Core is 100% Non-ML: The core toolkit operates with standard numerical computing dependencies (
numpy,scipy). Machine learning models are strictly optional extras (pip install hvk[ml]). - Honest Baseline Comparisons: ML components must be compared head-to-head against exact non-ML and simple heuristic methods. If ML does not win, the null or negative result will be reported plainly.
- Guarded Residual Initializer: The residual-ML initializer is explicitly guarded, not guaranteed: it evaluates energy at the Hartree-Fock parameter point
θ_HFand the shifted pointθ_HF + Δθ, returns whichever yields lower energymin(E(θ_HF), E(θ_HF + Δθ)), and automatically falls back to PA-HF when an explicit out-of-distribution (OOD) criterion is triggered. - Physical Noise Metric: Noise benchmarks measure energy error under noise vs. the exact ground state with confidence intervals. State fidelity vs. ideal state is only reported if explicitly labeled as such.
- Strict Measurement Accounting: ADAPT execution tracks every energy evaluation, commutator measurement, and appended operator using documented, deterministic counting conventions.
- Code Quality Standards: 100% type annotations, comprehensive docstrings, clean
ruffandmypyaudits, unit tests for every public function, and test coverage > 85%.
⚡ Quickstart
Installation
# Core package (zero ML overhead)
pip install hamiltonian-vqe-kit
# With optional chemistry and dev dependencies
pip install "hamiltonian-vqe-kit[chemistry,dev]"
# With optional machine learning extensions
pip install "hamiltonian-vqe-kit[ml]"
Command-Line Interface (CLI)
# 1. Audit Hamiltonian locality and interaction graph
hvk audit H2
# 2. Run exact ADAPT-VQE toward chemical accuracy (<= 1.6 mHa)
hvk adapt LiH --accuracy 0.0016
# 3. Build a sparse ansatz from the interaction graph
hvk build BeH2
# 4. Run barren plateau diagnostic
hvk diagnose H4
# 5. Execute full reproducible multi-molecule benchmark suite
hvk benchmark --output-dir benchmarks/results
⚠️ Limitations and Known Failures
This section is continuously updated as empirical benchmarks are evaluated.
- Phase 1 Complete: Chemical structure validation verified against PySCF references across H₂, LiH, BeH₂, and H₄ with machine-precision parity (|ΔE| ≤ 10⁻¹¹ mHa). Exact ADAPT-VQE engine (Phase 2) is currently in development.
- Qubit Active Space Boundaries: Phase 1 through Phase 4 focus on small-molecule STO-3G active spaces (N ≤ 8 qubits). Systems exceeding 8 qubits require frozen-core approximations or extended basis set loaders.
- Physical Noise Assumptions: Energy-error-under-noise simulation in Phase 4 models quantum channels via stochastic Kraus operators; cross-talk and drift are not modeled in initial releases.
📜 Prior Work & Citation
If you use this toolkit in your research, please cite:
@software{khan2026hvk,
author = {Ashraf Khan},
title = {Hamiltonian VQE Kit: Validated, Honest VQE and ADAPT-VQE Toolkit},
year = {2026},
publisher = {GitHub},
version = {0.1.0},
url = {https://github.com/aashiq-parinda/hamiltonian-vqe-kit}
}
This project builds upon foundational theoretical and architectural insights pre-registered in:
- Ashraf Khan (2026). Rigorous Generalization Study: Transformer-Accelerated VQE Warm-Starting Across Multi-Molecule Families. Zenodo Record #22013110.
📄 License
Licensed under the Apache License, Version 2.0 (the "License"). See LICENSE for details.
Metadata
Release files for hamiltonian-vqe-kit 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hamiltonian_vqe_kit-0.1.2.tar.gz | 23.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hamiltonian_vqe_kit-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.6 kB
Release files / hamiltonian_vqe_kit-0.1.2.tar.gz
| Download URL | hamiltonian_vqe_kit-0.1.2.tar.gz |
|---|---|
| Size | 23.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
edcfd939247e11848c9fdd6b514b91d46cb8999c9a1de58caf951366a2be14dd
|
|
BLAKE2b-256 checksum How to use checksums |
3dedad1ee9e812d290ac386ef53d57565bb2266f0f971c128c31048799221d71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Release files / hamiltonian_vqe_kit-0.1.2-py3-none-any.whl
| Download URL | hamiltonian_vqe_kit-0.1.2-py3-none-any.whl |
|---|---|
| Size | 22.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
20671519e8d018f80c06b479970fa1d29fdb010c77845d4ae916d855168ab346
|
|
BLAKE2b-256 checksum How to use checksums |
b86a0e89c5c5f01ea7b8cb3e00f33ef10ebbc3bbde0ef94045e044adeda5ba5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|