Installation
Clone repository
To get the source code, simply clone CUNQA repository:
git clone git@github.com:CESGA-Quantum-Spain/cunqa.git
Warning
If SSH cloning fails, you may not have properly linked your environment to GitHub. To do this, run the following commands:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/SSH_KEY
where SSH_KEY is the secure key that connects your environment with GitHub, usually stored in the ~/.ssh folder.
Now CUNQA must be built and installed. If you are installing CUNQA in an HPC center other than CESGA, you might need to solve some dependencies or manually define the installation path. If you are installing it in CESGA, some steps can be skipped.
Define STORE environment variable
At build time, CUNQA will look at the STORE environment variable to set the root of the
.cunqa folder where configuration files and logging files will be stored. So, if it is not
defined by default on the environment, just run:
export STORE=/path/to/your/store
If you plan to compile CUNQA multiple times, we recommend adding this directive to your .bashrc
file to avoid potential issues.
Dependencies
CUNQA has a set of dependencies, as any other platform. The versions here displayed are the ones that have been employed in the development and, therefore, that are recommended. They are divided in three main groups:
Must be installed by the user before configuration.
gcc 12.3.0
qiskit 1.2.4
CMake 3.21.0
python 3.9 (recommended 3.11)
pybind11 2.7 (recommended 2.12)
MPI 3.1
OpenMP 4.5
Boost 1.85.0
Eigen 5.0.0
Blas -
Lapack -
Can be installed by the user, but if they are not they will be automatically installed by the configuration process.
nlohmann JSON 3.11.3
spdlog 1.16.0
MQT-DDSIM 1.24.0
libzmq 4.3.5
cppzmq 4.11.0
CunqaSimulator 0.1.1
Will be installed automatically by the configuration process.
argparse -
qiskit-aer 0.17.2 (modified version)
Configure, build and install
To build, compile, and install CUNQA, the three usual steps in a CMake project are followed.
cmake -B build/ -DCMAKE_PREFIX_INSTALL=/your/installation/path
cmake --build build/ --parallel $(nproc)
cmake --install build/
Warning
If CMAKE_PREFIX_INSTALL is not provided, CUNQA will be installed where the environment variable HOME points.
You can also employ Ninja to perform this task.
cmake -G Ninja -B build/ -DCMAKE_PREFIX_INSTALL=/your/installation/path
ninja -C build/ -j $(nproc)
cmake --install build/
Alternatively, you can use the configure.sh file, but only after all the dependencies have been
solved.
source configure.sh /your/installation/path
Configure, build and install
To build, compile, and install CUNQA, the three usual steps in a CMake project are followed.
cmake -B build/ -DCMAKE_PREFIX_INSTALL=/your/installation/path
cmake --build build/ --parallel $(nproc)
cmake --install build/
Warning
If CMAKE_PREFIX_INSTALL is not provided, CUNQA will be installed where the environment variable HOME points.
Note
To enable the GPU execution provided by AerSimulator, the flag -DAER_GPU=TRUE must be provided at build time:
cmake -B build/ -DCMAKE_PREFIX_INSTALL=/your/installation/path -DAER_GPU=TRUE
You can also employ Ninja to perform this task.
cmake -G Ninja -B build/ -DCMAKE_PREFIX_INSTALL=/your/installation/path
ninja -C build/ -j $(nproc)
cmake --install build/
Alternatively, you can use the configure.sh file.
source configure.sh /your/installation/path
Install as Lmod module
CUNQA is available as Lmod module in CESGA. To use it all you have to do is:
In QMIO:
module load qmio/hpc gcc/12.3.0 cunqa/2.0.0-python-3.9.9-mpi
In FT3:
module load cesga/2022 gcc/system cunqa/2.0.0 # without GPUs
module load cesga/2022 gcc/system cunqa/2.0.0-cuda-12.8.0 # with GPUs
If your HPC center is interested in using it this way, EasyBuild files employed to install it in
CESGA are available inside easybuild/ folder.
Uninstall
There has also been developed a Make directive to uninstall CUNQA if needed:
If you installed using the standard way:
make uninstall.If you installed using Ninja:
ninja uninstall.
Be sure to execute this command inside the build/ directory in both cases. An alternative is
using:
cmake --build build/ --target uninstall
to abstract from the installation method.