Installation Guide¶
Welcome to the Quantum Entangled Knowledge Graphs (QE-KGR) installation guide. This page provides comprehensive instructions for installing QE-KGR on various platforms and environments.
๐ System Requirements¶
Minimum Requirements¶
- Python: 3.8 or higher
- Memory: 4GB RAM (8GB+ recommended for large graphs)
- Storage: 500MB free space
- OS: Windows 10+, macOS 10.14+, or Linux (Ubuntu 18.04+)
Recommended Requirements¶
- Python: 3.9 or 3.10
- Memory: 16GB RAM
- Storage: 2GB free space
- GPU: CUDA-compatible GPU (optional, for acceleration)
๐ Quick Installation¶
Install from PyPI (Recommended)¶
Verify Installation¶
import qekgr
print(f"QE-KGR version: {qekgr.__version__}")
# Create a simple test graph
graph = qekgr.EntangledGraph()
print("โ
QE-KGR installed successfully!")
๐ ๏ธ Advanced Installation Options¶
Install with All Dependencies¶
For full functionality including visualization and advanced features:
Install Development Version¶
To get the latest features from GitHub:
Install in Development Mode¶
For contributors and developers:
git clone https://github.com/krish567366/quantum-entangled-knowledge-graphs.git
cd quantum-entangled-knowledge-graphs
pip install -e .
๐ฆ Optional Dependencies¶
QE-KGR supports various optional dependencies for enhanced functionality:
Visualization Dependencies¶
pip install plotly>=5.0.0
pip install matplotlib>=3.5.0
pip install seaborn>=0.11.0
pip install networkx>=2.8.0
Machine Learning Dependencies¶
Quantum Computing Dependencies¶
Performance Dependencies¶
๐ณ Docker Installation¶
Pull Pre-built Image¶
Run Interactive Container¶
Build from Source¶
git clone https://github.com/krish567366/quantum-entangled-knowledge-graphs.git
cd quantum-entangled-knowledge-graphs
docker build -t qekgr:local .
๐ Conda Installation¶
Create Conda Environment¶
conda create -n qekgr python=3.9
conda activate qekgr
pip install quantum-entangled-knowledge-graphs
Install from Conda-Forge (Coming Soon)¶
๐ฅ๏ธ Platform-Specific Instructions¶
Windows¶
- Install Python from python.org or Microsoft Store
- Open Command Prompt as Administrator
- Install QE-KGR:
macOS¶
- Install Homebrew (if not already installed):
- Install Python:
- Install QE-KGR:
Linux (Ubuntu/Debian)¶
- Update system packages:
- Install Python and pip:
- Install QE-KGR:
Linux (CentOS/RHEL)¶
- Install Python:
- Install QE-KGR:
๐ง Virtual Environment Setup¶
Using venv (Recommended)¶
python -m venv qekgr-env
source qekgr-env/bin/activate # On Windows: qekgr-env\Scripts\activate
pip install quantum-entangled-knowledge-graphs
Using virtualenv¶
pip install virtualenv
virtualenv qekgr-env
source qekgr-env/bin/activate # On Windows: qekgr-env\Scripts\activate
pip install quantum-entangled-knowledge-graphs
Using pipenv¶
๐งช Testing Your Installation¶
Basic Functionality Test¶
#!/usr/bin/env python3
"""Test script for QE-KGR installation."""
import qekgr
import numpy as np
def test_installation():
print("๐งช Testing QE-KGR Installation...")
print(f" Version: {qekgr.__version__}")
# Test 1: Create graph
print(" โ
Creating EntangledGraph...")
graph = qekgr.EntangledGraph(hilbert_dim=4)
# Test 2: Add nodes
print(" โ
Adding quantum nodes...")
alice = graph.add_quantum_node("Alice", state="physicist")
bob = graph.add_quantum_node("Bob", state="engineer")
# Test 3: Add entangled edge
print(" โ
Creating entangled edges...")
graph.add_entangled_edge(alice, bob,
relations=["collaborates"],
amplitudes=[0.8])
# Test 4: Quantum inference
print(" โ
Testing quantum inference...")
inference = qekgr.QuantumInference(graph)
walk_result = inference.quantum_walk("Alice", steps=5)
# Test 5: Query engine
print(" โ
Testing query engine...")
query_engine = qekgr.EntangledQueryEngine(graph)
results = query_engine.query("Who collaborates with Alice?")
print("๐ All tests passed! QE-KGR is working correctly.")
return True
if __name__ == "__main__":
test_installation()
Performance Benchmark¶
import time
import qekgr
def benchmark_installation():
"""Benchmark QE-KGR performance."""
print("โก Benchmarking QE-KGR Performance...")
start_time = time.time()
# Create larger graph
graph = qekgr.EntangledGraph(hilbert_dim=8)
# Add 100 nodes
for i in range(100):
graph.add_quantum_node(f"node_{i}", state=f"state_{i%10}")
# Add 200 edges
for i in range(200):
source = f"node_{i%100}"
target = f"node_{(i+1)%100}"
graph.add_entangled_edge(source, target,
relations=["connects"],
amplitudes=[0.7])
# Run inference
inference = qekgr.QuantumInference(graph)
walk_result = inference.quantum_walk("node_0", steps=20)
end_time = time.time()
duration = end_time - start_time
print(f" Benchmark completed in {duration:.2f} seconds")
print(f" Graph size: {len(graph.nodes)} nodes, {len(graph.edges)} edges")
if duration < 10:
print(" ๐ Excellent performance!")
elif duration < 30:
print(" โ
Good performance!")
else:
print(" โ ๏ธ Consider upgrading hardware for better performance")
if __name__ == "__main__":
benchmark_installation()
๐จ Troubleshooting¶
Common Installation Issues¶
Issue: "No module named 'qekgr'"¶
Solution: Ensure you're using the correct Python environment:
Issue: Import errors with dependencies¶
Solution: Install with full dependencies:
Issue: "Microsoft Visual C++ 14.0 is required" (Windows)¶
Solution: Install Visual Studio Build Tools:
- Download from Microsoft Visual Studio
- Install "C++ build tools"
- Retry installation
Issue: Permission denied (Linux/macOS)¶
Solution: Use virtual environment or install with --user:
Issue: Slow performance¶
Solutions:
- Install with performance dependencies:
- Use smaller Hilbert dimensions for testing
- Consider GPU acceleration if available
Getting Help¶
If you encounter issues not covered here:
- Check GitHub Issues: GitHub Issues
- Create New Issue: Provide system info, error messages, and minimal reproduction case
- Email Support: bajpaikrishna715@gmail.com
- Discord Community: Join our Discord (coming soon)
System Information Script¶
Use this script to gather system information for bug reports:
import sys
import platform
import pkg_resources
def system_info():
"""Gather system information for debugging."""
print("๐ฅ๏ธ System Information")
print("=" * 30)
print(f"Python Version: {sys.version}")
print(f"Platform: {platform.platform()}")
print(f"Architecture: {platform.architecture()}")
print(f"Processor: {platform.processor()}")
print("\n๐ฆ Installed Packages")
print("=" * 20)
installed = [d.project_name for d in pkg_resources.working_set]
qe_related = [pkg for pkg in installed if 'quantum' in pkg.lower() or 'qekgr' in pkg.lower()]
for pkg in qe_related:
try:
version = pkg_resources.get_distribution(pkg).version
print(f"{pkg}: {version}")
except:
print(f"{pkg}: unknown version")
if __name__ == "__main__":
system_info()
๐ Upgrading QE-KGR¶
Check Current Version¶
Upgrade to Latest Version¶
Upgrade to Specific Version¶
Uninstall QE-KGR¶
โ Next Steps¶
After successful installation:
- ๐ Read the Quick Start Guide
- ๐งช Try the Examples
- ๐ Explore API Reference
- ๐ Follow Tutorials
Congratulations! You now have QE-KGR installed and ready to explore quantum-enhanced knowledge graphs! ๐