Getting started¶
Install q2m3 from source with Python 3.11 or newer and uv.
Run the H2 examples before larger SQD or Catalyst calculations.
Install¶
git clone https://github.com/yjmaxpayne/q2m3.git
cd q2m3
uv sync --frozen
uv run uses the project’s .venv. Activation is optional.
The core dependencies include PySCF, PennyLane, NumPy, SciPy, Matplotlib, and Rich.
Add extras for the workflow you need:
Workflow |
Command |
|---|---|
Development |
|
SQD |
|
Catalyst solvation |
|
Documentation |
|
The gpu extra requires compatible NVIDIA drivers and CUDA runtime support.
CPU examples do not require it.
Run H2 validation¶
uv run python examples/qpe/h2_qpe_validation.py
uv run python examples/resources/h2_resource_estimation.py
The first script compares vacuum and MM-embedded HF and QPE energies.
Inspect every [OK] and [FAIL] line. Its exit status does not report failed checks.
The second script estimates quantum hardware resources.
See H2 QPE Validation and H2 Resource Estimation for interpretation.
Energies use Hartree internally. Convert explicitly before reporting kcal/mol:
>>> round(HARTREE_TO_KCAL_MOL * KCAL_TO_HARTREE, 12)
1.0
Choose the next workflow¶
Workflow |
Requirements and scope |
|---|---|
Catalyst and solvation extras. 8 GB+ RAM recommended. |
|
SQD extra, Linux x86_64, and serial native threads. |
|
Core install for |
|
H3O+ MC diagnostics |
Catalyst and solvation extras. 16 GB+ RAM recommended. |
8-bit QPE and dynamic-Trotter diagnostics |
30 GB+ RAM recommended. Use the scripts’ memory guards. |
The memory recommendations are not measured upper bounds. See Tutorials for diagnostic script paths. Catalyst compilation depends on estimation wires, Trotter depth, and Hamiltonian term count.
Troubleshooting¶
Symptom |
Action |
|---|---|
Missing |
Install the |
Missing |
Install the |
SQD rejects the platform, threads, or memory request |
Check Sample-based quantum diagonalization (SQD). |
Slow first MC run |
Allow compilation to finish. Later runs can reuse compatible IR. |
H3O+ run exceeds memory |
Start with H2. Reduce Trotter depth or use more memory. |
GPU device is unavailable |
Check |
Large QPE–HF difference |
Check estimation wires, |
Read Core Concepts before interpreting energy differences as chemistry.