The Qibo package comes with the following modules:
Installing with pip¶
The installation using
pip is the recommended approach to install Qibo.
We provide precompiled packages for linux x86/64, macosx 10.15 or greater
and Windows for multiple Python versions.
Make sure you have Python 3.6 or greater, then
pip to install
pip install qibo
pip program will download and install all the required
dependencies for Qibo.
pip packages for linux are compiled with CUDA support, so if your
system has a NVIDIA GPU, Qibo will perform calculations on GPU.
pip packages for Windows do not provide the
Installing from source¶
The installation procedure presented in this section is useful in two situations:
you need to install Qibo in an operating system and environment not supported by the
pippackages (see Installing with pip).
you have to develop the code from source.
In order to install Qibo from source, you can simply clone the GitHub repository with
git clone https://github.com/Quantum-TII/qibo.git cd qibo
then proceed with the installation of requirements with:
pip install -r requirements.txt
Make sure your system has a GNU
g++ >= 6 compiler. If you are working on
macosx make sure the command
clang >= 11 and install the libomp
brew install libomp command.
Optionally, you can use the
CXX environment variable to set then compiler
path. Similarly, the
PYTHON environment variable sets the python interpreter
If your system has a NVIDIA GPU, make sure TensorFlow is installed properly and runs on GPU, please refer to the official documentation.
In that case, you can activate GPU support for Qibo by:
installing the NVCC compiler matching the TensorFlow CUDA version, see the CUDA documentation.
CUDA_PATHvariable with the CUDA installation path containing the cuda compiler.
make sure the NVCC compiler is available from
CUDA_PATH/bin/nvcc, otherwise the compilation may fail. You can locate it with
whereis nvccand eventually link/copy to your
For example, TensorFlow 2.4 supports CUDA 11. After installing
TensorFlow proceed with the NVCC 11 installation. On linux the
installation path usually is
Before installing Qibo do
Note that Qibo will not enable GPU support if points 1 and 2 are not performed.
Then proceed with the Qibo installation using
pip install .
or if you prefer to manually execute all installation steps:
# builds binaries python setup.py build # installs the Qibo packages python setup.py install # or python setup.py develop
If you prefer to keep changes always synchronized with the code then install using the develop option:
pip install -e . # or python setup.py develop
Optionally, in order to run tests and build documentation locally you can install extra dependencies with:
pip install qibo[tests,docs]