Installation - Open-Quantum-Platform/openqp GitHub Wiki

1. Required Libraries for OpenQP Compilation

OpenQP relies on several external libraries, including TagArray, BLAS, LAPACK, nlOPT, libXC, SciPy, NumPy, libDLfind, and cffi. Some of these libraries are automatically downloaded and installed during the compilation and installation process, so a network connection is required.

However, there are some prerequisites and considerations:

  • CMake: Version 3.25 or higher must be installed before starting the compilation process.
  • BLAS/LAPACK: The appropriate variants of these libraries should be pre-installed to ensure compatibility with your preferred setups.
  • cffi: This is a package interconnecting C and Python, which should be pre-installed.
  • DFT-D4 Dispersion Correction: Its successful installation is subjective to the particular OS versions. Therefore, it is optional.

Note: OpenQP currently supports only the GCC compiler due to the specific features it utilizes. While using Ninja is optional, it can be beneficial for faster compilation, though OpenQP can be compiled without it.

For installation guides specific to MacOS, Ubuntu, and CentOS, including Real Site Installation Examples, please refer to the provided links.

Required Libraries and Tools:

  • GCC (Version >= 8)
  • SciPy (Version >= 1.10)
  • NumPy (Version >= 1.20)
  • CMake (Version >= 3.25)
  • libDLfind (Version >= 0.0.3)
  • cffi
  • Ninja (Optional)

2. Downloading OpenQP Source Files

To download the source files for OpenQP, use the following command:

git clone ssh://[email protected]:Open-Quantum-Platform/openqp.git

or

git clone https://github.com/Open-Quantum-Platform/openqp.git

3. Compilation with Ninja and OpenMP Support

To compile OpenQP with Ninja and enable OpenMP parallelization, follow these steps:

cd openqp
cmake -B build -G Ninja -DUSE_LIBINT=OFF -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_INSTALL_PREFIX=. -DENABLE_OPENMP=ON -DLINALG_LIB_INT64=OFF
ninja -C build install
pip install pyoqp/.
bash pyoqp/patch.sh

4. Compilation without Ninja and OpenMP Support

If you prefer to compile OpenQP without using Ninja and without OpenMP support, use the following commands:

cd openqp
cmake -B build -DUSE_LIBINT=OFF -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_INSTALL_PREFIX=. -DENABLE_OPENMP=ON -DLINALG_LIB_INT64=OFF
make -C build install
pip install pyoqp/.
bash pyoqp/patch.sh

Compilation Options:

  • Sequential Execution without OpenMP: To run OpenQP sequentially, without OpenMP, include -DENABLE_OPENMP=OFF in the CMake command.
  • Use of libint: Including -DUSE_LIBINT=ON will replace the default ERI (based on Rys Quadrature) with libint.
  • Use -DLINALG_LIB_INT64=OFF to ensure compatibility with third-party software like libdlfind compiled of BLAS index arrays with the 32-bit integer type.

Environmental Settings

Set the necessary environment variables as follows:

export OPENQP_ROOT=/path/to/openqp
export OMP_NUM_THREADS=4
export LD_LIBRARY_PATH=$OPENQP_ROOT/lib:$LD_LIBRARY_PATH

Special Environmental Settings for MKL Math Library:

export MKL_INTERFACE_LAYER="LP64"                            # Due to -DLINALG_LIB_INT64=OFF
export MKL_THREADING_LAYER=SEQUENTIAL

Testing Your Installation

After installation, you can run tests using the following commands:

openqp --run_tests other       # Run tests from the 'other' folder in examples
openqp --run_tests all         # Run all tests from all folders in examples
openqp --run_tests path_to_folder  # Run tests from a specific folder

OpenQP Docker Image

OpenQP with Jupyter Notebook

OpenQP Input Generator + Docker

Going back to Main