Installation
This guide walks you through installing QC (Quasi Quantum Computing) and all required dependencies.System Requirements
Python Version
Python 3.8 or higher
Hardware
CPU or NVIDIA GPU (CUDA-compatible)
Memory
Minimum 4GB RAM (8GB+ recommended)
Storage
~1GB for code and checkpoints
QC can run on CPU or GPU. GPU execution is faster but not required. The simulator automatically detects available hardware.
Prerequisites
Before installing QC, ensure you have the following:- Python 3.8+ with pip
- Git for cloning the repository
- (Optional) CUDA toolkit if using GPU acceleration
Installation Steps
Create Virtual Environment
Create and activate a Python virtual environment:
Using a virtual environment is strongly recommended to avoid dependency conflicts.
Install Dependencies
Install required Python packages:
Core Dependencies Breakdown
Core Dependencies Breakdown
- PyTorch (
torch): Neural network backends and tensor operations - NumPy (
numpy): Numerical computations and array operations - SciPy (
scipy): Optimization algorithms (L-BFGS-B for VQE) - Matplotlib (
matplotlib): Visualization and plotting - PySCF (
pyscf): Quantum chemistry calculations and molecular data - OpenFermion (
openfermion): Fermionic operators and Jordan-Wigner transformation - OpenFermion-PySCF (
openfermionpyscf): Integration between OpenFermion and PySCF
Download Neural Network Checkpoints
QC requires pre-trained neural network checkpoint files for the physics backends. Ensure you have:
hamiltonian.pth- Hamiltonian backend weightscheckpoint_phase3_training_epoch_18921_20260224_154739.pth- Schrödinger backendbest_dirac.pth- Dirac backend weights
Configuration Options
QC supports various configuration parameters that must match the values used during neural network training:| Parameter | Default | Description |
|---|---|---|
--grid-size | 16 | Spatial grid resolution (G×G) |
--hidden-dim | 32 | Hidden layer dimension in neural networks |
--expansion-dim | 64 | Expansion dimension for Schrödinger/Dirac backends |
--device | auto | Computation device: cpu or cuda |
--hamiltonian-checkpoint | weights/latest.pth | Path to Hamiltonian weights |
--schrodinger-checkpoint | weights/schrodinger_crystal_final.pth | Path to Schrödinger weights |
--dirac-checkpoint | weights/dirac_phase5_latest.pth | Path to Dirac weights |
Important: The
grid-size, hidden-dim, and expansion-dim parameters must match the values used during checkpoint training. Using mismatched values will cause errors.GPU Acceleration (Optional)
To enable GPU acceleration:Install CUDA Toolkit
Install the appropriate CUDA toolkit for your GPU:
- Visit NVIDIA CUDA Downloads
- Follow installation instructions for your operating system
Install PyTorch with CUDA
Install PyTorch with CUDA support:Replace
cu118 with your CUDA version (e.g., cu121 for CUDA 12.1).Installation Script
For convenience, use the provided installation script:install.sh
Troubleshooting
ModuleNotFoundError: No module named 'torch'
ModuleNotFoundError: No module named 'torch'
Solution: Make sure you activated your virtual environment and installed all dependencies:
Checkpoint file not found
Checkpoint file not found
Solution: Verify checkpoint file paths are correct and files exist:If missing, download or specify correct paths with
--hamiltonian-checkpoint, --schrodinger-checkpoint, and --dirac-checkpoint flags.CUDA out of memory error
CUDA out of memory error
Solution: Reduce grid size or switch to CPU:
Backend parameters mismatch
Backend parameters mismatch
Solution: Ensure
--grid-size, --hidden-dim, and --expansion-dim match checkpoint training configuration. Default values are:- Grid size: 16
- Hidden dim: 32
- Expansion dim: 64
Verifying Your Installation
Run the molecular simulator test to confirm everything works:If you see “100.0%” correlation energy captured and |VQE-FCI| < 10⁻¹⁰, your installation is working correctly!
Next Steps
Quick Start Tutorial
Run your first quantum simulation
API Reference
Explore the complete API documentation