Skip to content

Commit 489350d

Browse files
Merge branch 'main' into fix-issue-2000
2 parents eb12f85 + 2f9e5f7 commit 489350d

File tree

197 files changed

+25919
-516
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+25919
-516
lines changed

.devcontainer/devcontainer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241
"C_Cpp.inlayHints.referenceOperator.enabled": false,
242242
"C_Cpp.doxygen.generateOnType": false,
243243
"C_Cpp.default.cStandard": "c17",
244-
"C_Cpp.default.cppStandard": "c++20",
244+
"C_Cpp.default.cppStandard": "c++17",
245245
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
246246
"C_Cpp.default.compileCommands": "${workspaceFolder}/build/compile_commands.json",
247247
"C_Cpp.default.includePath": [
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
nvidia-mgpu-repo: cuda-quantum/cuquantum-mgpu.git
2-
nvidia-mgpu-commit: 5a4c69fa1d5bc70fecccd758e5d936ff4b8115e3
2+
nvidia-mgpu-commit: de32bf2abae42f118a0da36be0066296d76b0dbc

.github/workflows/config/spelling_allowlist.txt

+3
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ OpenSUSE
8282
Ou
8383
POSIX
8484
PSIRT
85+
Pasqal
8586
Pauli
8687
Paulis
8788
Photonic
@@ -192,6 +193,7 @@ discoverable
192193
discretization
193194
discretize
194195
discretized
196+
eigenbasis
195197
eigensolver
196198
eigensolvers
197199
eigenstate
@@ -201,6 +203,7 @@ eigenvalues
201203
eigenvector
202204
eigenvectors
203205
endian
206+
endianness
204207
enqueue
205208
enqueues
206209
enqueuing

.github/workflows/dev_environment.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,10 @@ jobs:
218218
uses: docker/setup-buildx-action@v3
219219
with:
220220
endpoint: builder_context
221-
driver-opts: network=host
221+
version: v0.19.0
222+
driver-opts: |
223+
network=host
224+
image=moby/buildkit:v0.19.0
222225
223226
- name: Log in to DockerHub
224227
uses: docker/login-action@v3

.github/workflows/docker_images.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ jobs:
161161
uses: docker/setup-buildx-action@v3
162162
with:
163163
endpoint: builder_context
164-
driver-opts: network=host
164+
version: v0.19.0
165+
driver-opts: |
166+
network=host
167+
image=moby/buildkit:v0.19.0
165168
166169
- name: Build Open MPI
167170
id: docker_build
@@ -308,7 +311,10 @@ jobs:
308311
uses: docker/setup-buildx-action@v3
309312
with:
310313
endpoint: builder_context
311-
driver-opts: network=host
314+
version: v0.19.0
315+
driver-opts: |
316+
network=host
317+
image=moby/buildkit:v0.19.0
312318
313319
- name: Extract metadata
314320
id: metadata
@@ -512,7 +518,10 @@ jobs:
512518
uses: docker/setup-buildx-action@v3
513519
with:
514520
endpoint: builder_context
515-
driver-opts: network=host
521+
version: v0.19.0
522+
driver-opts: |
523+
network=host
524+
image=moby/buildkit:v0.19.0
516525
517526
- name: Extract cuda-quantum-dev metadata
518527
id: cudaqdev_metadata

.github/workflows/generate_cc.yml

+3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ jobs:
6060
uses: docker/setup-buildx-action@v3
6161
with:
6262
endpoint: builder_context
63+
version: v0.19.0
64+
driver-opts: |
65+
image=moby/buildkit:v0.19.0
6366
6467
- name: Build CUDA Quantum
6568
id: cudaq_build

.github/workflows/gh_registry.yml

+3
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ jobs:
121121
uses: docker/setup-buildx-action@v3
122122
with:
123123
endpoint: builder_context
124+
version: v0.19.0
125+
driver-opts: |
126+
image=moby/buildkit:v0.19.0
124127
125128
- name: Prepare push
126129
id: metadata

.github/workflows/integration_tests.yml

+40-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ on:
2121
- ionq
2222
- iqm
2323
- oqc
24+
- pasqal
2425
- quantinuum
2526
- nvqc
2627
- orca
@@ -121,6 +122,9 @@ jobs:
121122
uses: docker/setup-buildx-action@v3
122123
with:
123124
endpoint: builder_context
125+
version: v0.19.0
126+
driver-opts: |
127+
image=moby/buildkit:v0.19.0
124128
125129
- name: Extract metadata
126130
id: metadata
@@ -195,6 +199,9 @@ jobs:
195199
uses: docker/setup-buildx-action@v3
196200
with:
197201
endpoint: builder_context
202+
version: v0.19.0
203+
driver-opts: |
204+
image=moby/buildkit:v0.19.0
198205
199206
- name: Login to NGC container registry
200207
uses: docker/login-action@v3
@@ -381,7 +388,7 @@ jobs:
381388
shell: bash
382389

383390
- name: Setup quantinum account
384-
if: github.event_name == 'schedule' || inputs.target == 'nightly' || inputs.target == 'quantinuum'
391+
if: (success() || failure()) && (github.event_name == 'schedule' || inputs.target == 'nightly' || inputs.target == 'quantinuum')
385392
run: |
386393
curl -X POST -H "Content Type: application/json" -d '{ "email":"${{ secrets.BACKEND_LOGIN_EMAIL }}","password":"${{ secrets.QUANTINUUM_PASSWORD }}" }' https://qapi.quantinuum.com/v1/login > credentials.json
387394
id_token=`cat credentials.json | jq -r '."id-token"'`
@@ -390,7 +397,7 @@ jobs:
390397
echo "refresh: $refresh_token" >> ~/.quantinuum_config
391398
392399
- name: QIR syntax check (Quantinuum)
393-
if: github.event_name == 'schedule' || inputs.target == 'nightly'
400+
if: (success() || failure()) && (github.event_name == 'schedule' || inputs.target == 'nightly')
394401
run: |
395402
echo "### QIR syntax check (Quantinuum)" >> $GITHUB_STEP_SUMMARY
396403
export CUDAQ_LOG_LEVEL="info"
@@ -687,7 +694,37 @@ jobs:
687694
exit 1
688695
fi
689696
shell: bash
690-
697+
698+
- name: Submit to Pasqal test server
699+
if: (success() || failure()) && (inputs.target == 'pasqal' || github.event_name == 'schedule' || inputs.target == 'nightly')
700+
run: |
701+
echo "### Submit to Pasqal server" >> $GITHUB_STEP_SUMMARY
702+
python3 -m pip install pasqal-cloud
703+
export PASQAL_USERNAME='${{ secrets.PASQAL_USERNAME }}'
704+
export PASQAL_PASSWORD='${{ secrets.PASQAL_PASSWORD }}'
705+
export PASQAL_PROJECT_ID='${{ secrets.PASQAL_PROJECT_ID }}'
706+
export PASQAL_MACHINE_TARGET="EMU_FREE" # Speedup queuing time
707+
set +e # Allow script to keep going through errors
708+
test_err_sum=0
709+
python_tests="docs/sphinx/targets/python/pasqal.py"
710+
for filename in $python_tests; do
711+
[ -e "$filename" ] || echo "::error::Couldn't find file ($filename)"
712+
python3 $filename 1> /dev/null
713+
test_status=$?
714+
if [ $test_status -eq 0 ]; then
715+
echo ":white_check_mark: Successfully ran test: $filename" >> $GITHUB_STEP_SUMMARY
716+
else
717+
echo ":x: Test failed (failed to execute): $filename" >> $GITHUB_STEP_SUMMARY
718+
test_err_sum=$((test_err_sum+1))
719+
fi
720+
done
721+
set -e # Re-enable exit code error checking
722+
if [ ! $test_err_sum -eq 0 ]; then
723+
echo "::error::${test_err_sum} tests failed. See step summary for a list of failures"
724+
exit 1
725+
fi
726+
shell: bash
727+
691728
- name: Submit to ${{ inputs.target }}
692729
# The full set of tests used by this step is currently only supported on
693730
# Quantinuum. The other supported tests are tested by the step above.

.github/workflows/prebuilt_binaries.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ jobs:
127127
uses: docker/setup-buildx-action@v3
128128
with:
129129
endpoint: builder_context
130-
driver-opts: network=host
130+
version: v0.19.0
131+
driver-opts: |
132+
network=host
133+
image=moby/buildkit:v0.19.0
131134
132135
- name: Extract metadata
133136
id: metadata
@@ -225,6 +228,9 @@ jobs:
225228
uses: docker/setup-buildx-action@v3
226229
with:
227230
endpoint: builder_context
231+
version: v0.19.0
232+
driver-opts: |
233+
image=moby/buildkit:v0.19.0
228234
229235
- name: Log in to DockerHub
230236
uses: docker/login-action@v3

.github/workflows/publishing.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,10 @@ jobs:
430430

431431
- name: Set up buildx runner
432432
uses: docker/setup-buildx-action@v3
433+
with:
434+
version: v0.19.0
435+
driver-opts: |
436+
image=moby/buildkit:v0.19.0
433437
434438
- name: Extract cuda-quantum metadata
435439
id: metadata
@@ -586,6 +590,10 @@ jobs:
586590

587591
- name: Set up buildx runner
588592
uses: docker/setup-buildx-action@v3
593+
with:
594+
version: v0.19.0
595+
driver-opts: |
596+
image=moby/buildkit:v0.19.0
589597
590598
- name: Build installer
591599
uses: docker/build-push-action@v5
@@ -696,7 +704,10 @@ jobs:
696704
uses: docker/setup-buildx-action@v3
697705
with:
698706
endpoint: builder_context
699-
driver-opts: network=host
707+
version: v0.19.0
708+
driver-opts: |
709+
network=host
710+
image=moby/buildkit:v0.19.0
700711
701712
- name: Build cuda-quantum wheel
702713
id: build_wheel
@@ -958,7 +969,7 @@ jobs:
958969
bash ~/.miniconda3/miniconda.sh -b -u -p ~/.miniconda3
959970
rm -rf ~/.miniconda3/miniconda.sh
960971
eval "$(~/.miniconda3/bin/conda shell.bash hook)"
961-
conda install -y -c conda-forge openmpi
972+
conda install -y -c conda-forge openmpi">=5.0.7"
962973
963974
echo 'eval "$(~/.miniconda3/bin/conda shell.bash hook)"' >> ~/.bashrc
964975
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CONDA_PREFIX/lib"' >> ~/.bashrc

.github/workflows/publishing_stable.yml

+4
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ jobs:
115115
116116
- name: Set up buildx runner
117117
uses: docker/setup-buildx-action@v3
118+
with:
119+
version: v0.19.0
120+
driver-opts: |
121+
image=moby/buildkit:v0.19.0
118122
119123
- name: Update cuda-quantum metadata
120124
id: metadata

.github/workflows/python_wheels.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,10 @@ jobs:
129129
uses: docker/setup-buildx-action@v3
130130
with:
131131
endpoint: builder_context
132-
driver-opts: network=host
132+
version: v0.19.0
133+
driver-opts: |
134+
network=host
135+
image=moby/buildkit:v0.19.0
133136
134137
- name: Build wheel
135138
id: wheel_build

.github/workflows/test_in_devenv.yml

+6
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ jobs:
6161
uses: docker/setup-buildx-action@v3
6262
with:
6363
endpoint: builder_context
64+
version: v0.19.0
65+
driver-opts: |
66+
image=moby/buildkit:v0.19.0
6467
6568
- name: Build CUDA Quantum
6669
run: |
@@ -191,6 +194,9 @@ jobs:
191194
uses: docker/setup-buildx-action@v3
192195
with:
193196
endpoint: builder_context
197+
version: v0.19.0
198+
driver-opts: |
199+
image=moby/buildkit:v0.19.0
194200
195201
- name: Set up dev environment
196202
id: dev_env

CMakeLists.txt

+9
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ if (NOT DEFINED CUDAQ_ENABLE_BRAKET_BACKEND)
9898
set(CUDAQ_ENABLE_BRAKET_BACKEND ON CACHE BOOL "Enable building AWS SDK for Amazon Braket backends.")
9999
endif()
100100

101+
# Enable Pasqal target by default.
102+
if (NOT DEFINED CUDAQ_ENABLE_PASQAL_BACKEND)
103+
set(CUDAQ_ENABLE_PASQAL_BACKEND ON CACHE BOOL "Enable building the Pasqal target.")
104+
endif()
105+
101106
# Generate a CompilationDatabase (compile_commands.json file) for our build,
102107
# for use by clang_complete, YouCompleteMe, etc.
103108
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
@@ -554,6 +559,10 @@ endif()
554559
add_subdirectory(tools)
555560
add_subdirectory(utils)
556561

562+
if(CUDAQ_BUILD_TESTS)
563+
enable_testing()
564+
endif()
565+
557566
if (CUDAQ_ENABLE_PYTHON)
558567
find_package(Python 3 COMPONENTS Interpreter Development)
559568

cmake/Modules/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ set(CONFIG_FILES
1111
CUDAQEmDefaultConfig.cmake
1212
CUDAQNloptConfig.cmake
1313
CUDAQSpinConfig.cmake
14+
CUDAQOperatorConfig.cmake
1415
CUDAQConfig.cmake
1516
CUDAQEnsmallenConfig.cmake
1617
CUDAQPlatformDefaultConfig.cmake

cmake/Modules/CUDAQConfig.cmake

+14-4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ list(APPEND CMAKE_MODULE_PATH "${CUDAQ_CMAKE_DIR}")
1414
set (CUDAQSpin_DIR "${CUDAQ_CMAKE_DIR}")
1515
find_dependency(CUDAQSpin REQUIRED)
1616

17+
set (CUDAQOperator_DIR "${CUDAQ_CMAKE_DIR}")
18+
find_dependency(CUDAQOperator REQUIRED)
19+
1720
set (CUDAQCommon_DIR "${CUDAQ_CMAKE_DIR}")
1821
find_dependency(CUDAQCommon REQUIRED)
1922

@@ -106,10 +109,17 @@ set_target_properties(cudaq::cudaq-qpp-cpu-target PROPERTIES
106109

107110
# QPP CPU DensityMatrix Target
108111
add_library(cudaq::cudaq-qpp-density-matrix-cpu-target SHARED IMPORTED)
109-
set_target_properties(cudaq::cudaq-qpp-density-matrix-cpu-target PROPERTIES
110-
IMPORTED_LOCATION "${CUDAQ_LIBRARY_DIR}/libnvqir-dm${CMAKE_SHARED_LIBRARY_SUFFIX}"
111-
IMPORTED_SONAME "libnvqir-dm${CMAKE_SHARED_LIBRARY_SUFFIX}"
112-
IMPORTED_LINK_INTERFACE_LIBRARIES "cudaq::cudaq-platform-default;cudaq::cudaq-em-default")
112+
set_target_properties(cudaq::cudaq-qpp-density-matrix-cpu-target PROPERTIES
113+
IMPORTED_LOCATION "${CUDAQ_LIBRARY_DIR}/libnvqir-dm${CMAKE_SHARED_LIBRARY_SUFFIX}"
114+
IMPORTED_SONAME "libnvqir-dm${CMAKE_SHARED_LIBRARY_SUFFIX}"
115+
IMPORTED_LINK_INTERFACE_LIBRARIES "cudaq::cudaq-platform-default;cudaq::cudaq-em-default")
116+
117+
# Stim Target
118+
add_library(cudaq::cudaq-stim-target SHARED IMPORTED)
119+
set_target_properties(cudaq::cudaq-stim-target PROPERTIES
120+
IMPORTED_LOCATION "${CUDAQ_LIBRARY_DIR}/libnvqir-stim${CMAKE_SHARED_LIBRARY_SUFFIX}"
121+
IMPORTED_SONAME "libnvqir-stim${CMAKE_SHARED_LIBRARY_SUFFIX}"
122+
IMPORTED_LINK_INTERFACE_LIBRARIES "cudaq::cudaq-platform-default;cudaq::cudaq-em-default")
113123
# -------------------------
114124

115125
if(NOT TARGET cudaq::cudaq)

cmake/Modules/CUDAQEmDefaultConfig.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ get_filename_component(CUDAQ_EM_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
1111
set (CUDAQSpin_DIR "${CUDAQ_EM_CMAKE_DIR}")
1212
find_dependency(CUDAQSpin REQUIRED)
1313

14+
set (CUDAQOperator_DIR "${CUDAQ_EM_CMAKE_DIR}")
15+
find_dependency(CUDAQOperator REQUIRED)
16+
1417
set (CUDAQCommon_DIR "${CUDAQ_EM_CMAKE_DIR}")
1518
find_dependency(CUDAQCommon REQUIRED)
1619

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# ============================================================================ #
2+
# Copyright (c) 2022 - 2025 NVIDIA Corporation & Affiliates. #
3+
# All rights reserved. #
4+
# #
5+
# This source code and the accompanying materials are made available under #
6+
# the terms of the Apache License 2.0 which accompanies this distribution. #
7+
# ============================================================================ #
8+
9+
get_filename_component(CUDAQ_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
10+
11+
if(NOT TARGET cudaq::cudaq-operator)
12+
include("${CUDAQ_CMAKE_DIR}/CUDAQOperatorTargets.cmake")
13+
endif()

cmake/Modules/CUDAQPlatformDefaultConfig.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ get_filename_component(CUDAQ_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
1111
set (CUDAQEmDefault_DIR "${CUDAQ_CMAKE_DIR}")
1212
find_dependency(CUDAQEmDefault REQUIRED)
1313

14+
set (CUDAQOperator_DIR "${CUDAQ_CMAKE_DIR}")
15+
find_dependency(CUDAQOperator REQUIRED)
16+
1417
set (CUDAQSpin_DIR "${CUDAQ_CMAKE_DIR}")
1518
find_dependency(CUDAQSpin REQUIRED)
1619

0 commit comments

Comments
 (0)