Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y g++ clang cmake ninja-build
sudo apt-get install -y g++ clang cmake ninja-build libhdf5-dev libopenblas-dev pkg-config libssl-dev libomp-dev libeigen3-dev openmpi-bin libopenmpi-dev
- name: Install tox
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Install via apt-get
run: |
sudo apt-get update
sudo apt-get install -y fd-find clang-tidy-21 clang-format-21
sudo apt-get install -y fd-find clang-tidy-21 clang-format-21 libhdf5-dev libopenblas-dev pkg-config libomp-dev libgomp-dev openmpi-bin libopenmpi-dev
sudo ln -fs clang-format-21 /usr/bin/clang-format
sudo ln -fs clang-tidy-21 /usr/bin/clang-tidy
sudo ln -fs /usr/bin/fdfind /usr/local/bin/fd
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_development_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y g++ clang cmake ninja-build
sudo apt-get install -y g++ clang cmake ninja-build libhdf5-dev libopenblas-dev pkg-config libssl-dev libomp-dev libeigen3-dev openmpi-bin libopenmpi-dev
- name: Configure CMake
run: >-
cmake -S . -B build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_latest_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y g++ clang cmake ninja-build
sudo apt-get install -y g++ clang cmake ninja-build libhdf5-dev libopenblas-dev pkg-config libssl-dev libomp-dev libeigen3-dev openmpi-bin libopenmpi-dev
- name: Configure CMake
run: >-
cmake -S . -B build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_without_exceptions_rtti.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y g++ clang cmake ninja-build
sudo apt-get install -y g++ clang cmake ninja-build libhdf5-dev libopenblas-dev pkg-config libomp-dev libgomp-dev openmpi-bin libopenmpi-dev
- name: Configure CMake
run: >-
cmake -S . -B build
Expand Down
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,15 @@
[submodule "deps/boost/mp11"]
path = deps/boost/mp11
url = https://github.com/boostorg/mp11.git
[submodule "deps/sbd"]
path = deps/sbd
url = https://github.com/r-ccs-cms/sbd.git
[submodule "deps/highfive"]
path = deps/highfive
url = https://github.com/highfive-devs/highfive.git
[submodule "deps/xtl"]
path = deps/xtl
url = https://github.com/xtensor-stack/xtl.git
[submodule "deps/xtensor"]
path = deps/xtensor
url = https://github.com/xtensor-stack/xtensor.git
51 changes: 51 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@ include_directories(include)
add_subdirectory(deps/doctest)
add_subdirectory(deps/nanobench)

function(find_package_fallback package_name subdir)
find_package(${package_name} QUIET)
if(${package_name}_FOUND)
message(STATUS "${package_name} found")
else()
message(STATUS "${package_name} not found, using version in ${subdir}")
set("${package_name}_VENDORED" TRUE PARENT_SCOPE)
add_subdirectory(${subdir})
endif()
endfunction()

# FIXME: These are required only by the sqd-hdf5-chemistry executable;
# ideally we could make them optional overall
find_package_fallback(HighFive deps/highfive)
find_package(MPI REQUIRED)
find_package(OpenMP REQUIRED)
set(xtensor_INCLUDE_DIRS
deps/xtensor/include
deps/xtl/include
)

# boost::dynamic_bitset
add_library(boost_dynamic_bitset INTERFACE)
target_include_directories(boost_dynamic_bitset INTERFACE
Expand All @@ -38,6 +59,23 @@ target_include_directories(boost_dynamic_bitset INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/deps/boost/type_traits/include
)

# sbd library
find_package(BLAS REQUIRED)
add_library(sbd INTERFACE)
target_include_directories(sbd INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/deps/sbd/include
${MPI_CXX_INCLUDE_DIRS}
${BLAS_INCLUDE_DIRS}
)
target_link_libraries(sbd
INTERFACE
${BLAS_LIBRARIES}
OpenMP::OpenMP_CXX
MPI::MPI_CXX
)

add_definitions(-DH5_USE_XTENSOR)

add_executable(sqd_tests
test/doctest_main.cpp
test/test_postselection.cpp
Expand All @@ -60,3 +98,16 @@ add_executable(sqd_benchmarks
)
target_include_directories(sqd_benchmarks PRIVATE deps/nanobench/src/include)
target_link_libraries(sqd_benchmarks PRIVATE nanobench)

add_executable(sqd-hdf5-chemistry src/sqd-hdf5-chemistry.cpp)
target_include_directories(sqd-hdf5-chemistry
PRIVATE
${xtensor_INCLUDE_DIRS}
)
target_link_libraries(sqd-hdf5-chemistry
PRIVATE
HighFive
boost_dynamic_bitset
sbd
MPI::MPI_CXX
)
1 change: 1 addition & 0 deletions deps/highfive
Submodule highfive added at e950d0
1 change: 1 addition & 0 deletions deps/sbd
Submodule sbd added at f0b85a
1 change: 1 addition & 0 deletions deps/xtensor
Submodule xtensor added at f31d41
1 change: 1 addition & 0 deletions deps/xtl
Submodule xtl added at 174e99
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/images/sqd_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ Table of Contents

Compilation flags <compilation-flags>
API Reference <apidocs/index>
Example app: tutorials <tutorials/index>
GitHub <https://github.com/Qiskit/qiskit-addon-sqd-hpc>
Release Notes <release-notes>
51 changes: 51 additions & 0 deletions docs/tutorials/01_compile.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Compile example app on the target machine
=========================================

Option 1: Manual compilation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Install dependencies
^^^^^^^^^^^^^^^^^^^^

- C++ compiler (must support C++17 or later)
- cmake
- MPI implementation
- ...

On RHEL systems, some of these can be installed with

.. code:: sh

export sudo dnf install cmake mpich-devel

Make sure ``mpicxx`` is in ``$PATH``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For instance, with ``mpich``, this may look like

.. code:: sh

export PATH=/usr/lib64/mpich/bin:$PATH
export LD_LIBRARY_PATH=/usr/lib64/mpich/lib:$LD_LIBRARY_PATH

Obtain the addon source code
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: sh

git clone https://github.com/Qiskit/qiskit-addon-sqd-hpc.git
cd qiskit-addon-sqd-hpc
git submodule update --init --recursive

Build using ``cmake``
^^^^^^^^^^^^^^^^^^^^^

.. code:: sh

mkdir -p build
cd build
cmake ..
cmake --build . -j4

Option 2: Compile using Spack
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Loading
Loading