Installation¶
Requirements¶
Matrix Toolkit requires Python 3.8 or newer.
Core Dependencies¶
The following packages are automatically installed:
NumPy >= 1.20.0
SciPy >= 1.7.0
Pandas >= 1.3.0
Requests >= 2.25.0
tqdm >= 4.60.0
PyYAML >= 5.4.0
Matplotlib >= 3.3.0
Click >= 8.0.0
joblib >= 1.0.0
h5py >= 3.0.0
Installation Methods¶
Using pip (Recommended)¶
pip install matrix-toolkit
From Source¶
git clone https://github.com/yourusername/matrix-toolkit.git
cd matrix-toolkit
pip install -e .
Optional Dependencies¶
CuPy (GPU Support)¶
For GPU-accelerated operations:
pip install matrix-toolkit[cupy]
Or install CuPy separately:
pip install cupy-cuda11x # For CUDA 11.x
pip install cupy-cuda12x # For CUDA 12.x
JAX Support¶
For JAX backend:
pip install matrix-toolkit[jax]
Or install JAX separately:
pip install jax jaxlib
PyTorch Support¶
For PyTorch backend:
pip install matrix-toolkit[torch]
Or install PyTorch separately:
pip install torch
All Optional Dependencies¶
To install all optional dependencies:
pip install matrix-toolkit[all]
Development Installation¶
For development, install with development dependencies:
git clone https://github.com/yourusername/matrix-toolkit.git
cd matrix-toolkit
pip install -e ".[dev]"
This installs:
pytest >= 7.0.0
pytest-cov >= 3.0.0
black >= 22.0.0
flake8 >= 4.0.0
mypy >= 0.950
sphinx >= 4.5.0
Verification¶
To verify the installation:
import matrix_toolkit
print(matrix_toolkit.__version__)
from matrix_toolkit.anymatrix import AnyMatrix
am = AnyMatrix()
print(f"Anymatrix groups: {am.groups()}")
You should see the version number and available anymatrix groups.
Troubleshooting¶
Import Errors¶
If you encounter import errors, ensure all dependencies are installed:
pip install --upgrade pip
pip install -r requirements.txt
SuiteSparse Access¶
For SuiteSparse matrix fetching, you may optionally install:
pip install ssgetpy
However, Matrix Toolkit includes its own fetcher that works without ssgetpy.
Platform-Specific Notes¶
Windows¶
On Windows, you may need Visual C++ Build Tools for some dependencies:
Download from: https://visualstudio.microsoft.com/visual-cpp-build-tools/
Install “Desktop development with C++” workload
macOS¶
On macOS, you may need to install Xcode Command Line Tools:
xcode-select --install
Linux¶
On Linux, ensure you have Python development headers:
# Ubuntu/Debian
sudo apt-get install python3-dev
# Fedora/RHEL
sudo dnf install python3-devel
Next Steps¶
After installation, check out the Quick Start Guide guide to get started!