iTensor Installation
Quick setup guide for installing iTensor and its dependencies
System Requirements
Minimum Requirements
- Python 3.9 or newer
- C/C++ compiler (gcc 9+, clang 10+, MSVC 2019+)
- 8GB RAM
- 2GB free disk space
Recommended
- 16GB+ RAM
- CUDA-compatible GPU (NVIDIA, 8GB+ VRAM)
- CUDA Toolkit 11.2+
- Fast SSD storage
For MHD simulations and raytracing, GPU acceleration is highly recommended. CPU-only mode works for symbolic calculations and smaller numerical problems.
Quick Install
PyPI Package (Recommended)
From Source
cd itensorpy
pip install -e .
With GPU Support
The itensorpy[cuda]
option requires a compatible CUDA toolkit already installed on your system. This is necessary for GPU-accelerated tensor calculations and visualization.
Platform-Specific Instructions
Linux
Dependencies
sudo apt update
sudo apt install build-essential cmake liblapack-dev libblas-dev
CUDA Setup (Optional)
sudo apt install nvidia-driver-535 nvidia-cuda-toolkit
After installing dependencies, follow the quick install instructions above.
macOS
Dependencies
brew install cmake openblas python@3.9
brew install llvm
macOS doesn't support CUDA, so GPU acceleration is unavailable. Use the standard install:
Note for Apple Silicon (M1/M2): Make sure to use Python with arm64 architecture, not x86_64 under Rosetta.
Windows
Dependencies
Install the following prerequisites:
- Visual Studio 2019+ with C++ build tools
- CMake (add to PATH)
- Python 3.9+ (add to PATH)
CUDA Setup (Optional)
Download and install the NVIDIA CUDA Toolkit
Install iTensor from a command prompt with administrator privileges:
For GPU support, use pip install itensorpy[cuda]
Verification
To verify your installation, run the following Python code:
If the script runs without errors, your installation is working correctly.
Troubleshooting
Compilation Errors
If you encounter C++ compilation errors during installation:
- Ensure your compiler is recent enough (gcc 9+, MSVC 2019+)
- Install development packages (
libblas-dev
,liblapack-dev
) - On Windows, verify Visual Studio C++ build tools are installed
CUDA Issues
If GPU acceleration isn't working:
- Verify NVIDIA drivers are installed:
nvidia-smi
- Check CUDA version:
nvcc --version
- Try reinstalling with:
pip install --no-cache-dir itensorpy[cuda]
Python Package Conflicts
If you encounter dependency conflicts:
- Create a fresh virtual environment:
python -m venv itensor_env
- Activate it and install iTensor there
- Try a minimal install first:
pip install itensorpy[minimal]