Skip to content

Commit 5cdaeef

Browse files
committed
Merge branch 'fix_oqc_test' of https://github.com/sacpis/cuda-quantum into fix_oqc_test
2 parents edb37fe + fc36171 commit 5cdaeef

File tree

100 files changed

+1197
-547
lines changed

Some content is hidden

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

100 files changed

+1197
-547
lines changed
Lines changed: 1 addition & 1 deletion
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: 8d7646431c824f8a7bf88bf3d9ba02f42746a024
2+
nvidia-mgpu-commit: 438397cdc7529293c78a399243c63dc3f6c3886a

.github/workflows/config/spelling_allowlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ toolchain
354354
toolchains
355355
toolset
356356
transmon
357+
transpile
357358
trotterization
358359
uccsd
359360
unary

.github/workflows/docker_images.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,7 @@ jobs:
841841
# In containers without GPU support, UCX does not work properly since it is configured to work with GPU-support.
842842
# Hence, don't enforce UCX when running these tests.
843843
docker exec cuda-quantum bash -c "python3 -m pip install --break-system-packages pandas scipy seaborn h5py contfrac"
844+
docker exec cuda-quantum bash -c "sudo apt install -y python3-venv"
844845
(docker exec cuda-quantum bash -c "unset OMPI_MCA_pml && set -o pipefail && bash validate_container.sh | tee /tmp/validation.out") && passed=true || passed=false
845846
docker cp cuda-quantum:"/tmp/validation.out" /tmp/validation.out
846847
docker stop cuda-quantum

.github/workflows/integration_tests.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,8 @@ jobs:
416416
exit 1
417417
}
418418
rm -f "$TEMP_NETRC"
419-
read -r id_token refresh_token < <(echo "$response" | jq -r '.id_token, .refresh_token')
419+
id_token=$(printf '%s' "$response" | jq -r '.id_token')
420+
refresh_token=$(printf '%s' "$response" | jq -r '.refresh_token')
420421
echo "::add-mask::$id_token"
421422
echo "::add-mask::$refresh_token"
422423
printf "key: %s\nrefresh: %s\n" "$id_token" "$refresh_token" > "$HOME/.anyon_config"
@@ -640,7 +641,7 @@ jobs:
640641
;;
641642
642643
iqm)
643-
nvq++ -DSYNTAX_CHECK --target iqm --iqm-machine Crystal_5 $filename
644+
nvq++ -DSYNTAX_CHECK --target iqm $filename
644645
test_status=$?
645646
if [ $test_status -eq 0 ]; then
646647
./a.out
@@ -763,7 +764,7 @@ jobs:
763764
if [[ "$filename" == *.cpp ]]; then
764765
if [[ "$filename" == *"quantinuum_ng/"* ]]; then
765766
echo "### Running Quantinuum-NG test" >> $GITHUB_STEP_SUMMARY
766-
nvq++ -v $filename --target quantinuum --quantinuum-machine Helios-1E --quantinuum-project ${{ secrets.QUANTINUUM_NEXUS_PROJECT_ID }} --quantinuum-max-cost 10 --quantinuum-max-qubits 7 --quantinuum-noisy-simulation false
767+
nvq++ -v $filename --target quantinuum --quantinuum-machine Helios-1E --quantinuum-project ${{ secrets.QUANTINUUM_NEXUS_PROJECT_ID }} --quantinuum-max-cost 15 --quantinuum-max-qubits 7 --quantinuum-noisy-simulation false
767768
else
768769
echo "### Running standard Quantinuum test" >> $GITHUB_STEP_SUMMARY
769770
nvq++ -v $filename -DSYNTAX_CHECK --target quantinuum --quantinuum-machine H2-1SC --quantinuum-project ${{ secrets.QUANTINUUM_NEXUS_PROJECT_ID }}
@@ -1024,6 +1025,7 @@ jobs:
10241025
fetch-depth: 1
10251026

10261027
- name: Install wheel
1028+
if: steps.skip_check.outputs.skipped != 'true'
10271029
id: install_wheel
10281030
run: |
10291031
python_version=${{ inputs.python_version || env.python_version }}
@@ -1079,7 +1081,7 @@ jobs:
10791081
GH_TOKEN: ${{ github.token }}
10801082

10811083
- name: Test NVQC
1082-
if: ${{ steps.install_wheel.outputs.skipped != 'true' }}
1084+
if: ${{ steps.skip_check.outputs.skipped != 'true' || steps.install_wheel.outputs.skipped != 'true' }}
10831085
run: |
10841086
echo "### Submit to NVQC from Python wheels" >> $GITHUB_STEP_SUMMARY
10851087
python_version=${{ inputs.python_version || env.python_version }}

.github/workflows/test_in_devenv.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
shell: bash
9292
run: |
9393
cd $CUDAQ_REPO_ROOT
94-
python3 -m pip install iqm-client==16.1
94+
python3 -m pip install iqm-client==28.0.0
9595
python3 -m pytest -v --durations=0 build/python/tests/interop/
9696
pytest_status=$?
9797
if [ ! $pytest_status -eq 0 ]; then
@@ -136,7 +136,7 @@ jobs:
136136
# Rerun the MPI plugin test
137137
cd $CUDAQ_REPO_ROOT
138138
ctest --test-dir build -R MPIApiTest -V
139-
external_plugin_status=$?
139+
external_plugin_status=$?
140140
if [ ! $external_plugin_status -eq 0 ] ; then
141141
echo "::error file=test_in_devenv.yml::Test CUDA Quantum MPI Plugin Activation failed with status $external_plugin_status."
142142
exit 1
@@ -153,7 +153,7 @@ jobs:
153153
docker run --name cuda-quantum-dev cuda-quantum-dev:local
154154
docker export cuda-quantum-dev > $output_directory/$filename.tar
155155
docker rm -f cuda-quantum-dev
156-
156+
157157
echo "filename=$filename" >> $GITHUB_OUTPUT
158158
echo "output_directory=$output_directory" >> $GITHUB_OUTPUT
159159
@@ -241,7 +241,7 @@ jobs:
241241
python3 -m venv --system-site-packages "$VENV_DIR"
242242
. "$VENV_DIR/bin/activate"
243243
244-
pip install iqm-client==16.1
244+
pip install iqm-client==28.0.0
245245
pip install . -vvv
246246
pyinstall_status=$?
247247
if [ ! $pyinstall_status -eq 0 ]; then
@@ -265,9 +265,9 @@ jobs:
265265
if [ ! $pytest_status -eq 0 ] && [ ! $pytest_status -eq 5 ]; then
266266
echo "::error file=test_in_devenv.yml::Python $backendTest tests failed with status $pytest_status."
267267
exit 1
268-
fi
269-
done
270-
268+
fi
269+
done
270+
271271
- name: Save environment
272272
id: env_save
273273
if: inputs.export_environment
@@ -279,7 +279,7 @@ jobs:
279279
docker run --name dev_env dev_env:local
280280
docker export dev_env > $output_directory/$filename.tar
281281
docker rm -f dev_env
282-
282+
283283
echo "filename=$filename" >> $GITHUB_OUTPUT
284284
echo "output_directory=$output_directory" >> $GITHUB_OUTPUT
285285

docs/notebook_validation.py

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,33 @@ def read_available_backends():
2525
return [backend.strip() for backend in available_backends]
2626

2727

28+
# Following pattern matches
29+
# `set_target("abc")`
30+
# `set_target( "abc")`
31+
# `set_target("abc", option="xyz")`
32+
# `set_target("abc", option = "xyz")`
33+
# `set_target(\"abc\")`
34+
# `set_target( \"abc\")`
35+
# `set_target(\"abc\", option=\"xyz\")`
36+
# `set_target(\"abc\", option = \"xyz\")`
37+
# `set_target('abc')`
38+
# `set_target( 'abc')`
39+
# `set_target('abc', option='xyz')`
40+
# `set_target('abc', option = 'xyz')`
41+
pattern = r"set_target\(\s*(\\?['\"])([^'\"]+)\1(?:\s*,\s*option\s*=\s*(\\?['\"])([^'\"]+)\3)?\)"
42+
43+
2844
def validate(notebook_filename, available_backends):
2945
with open(notebook_filename) as f:
3046
lines = f.readlines()
3147
for notebook_content in lines:
32-
match = re.search('set_target[\\\s\(]+"(.+)\\\\"[)]', notebook_content)
33-
if match and (match.group(1) not in available_backends):
34-
return False
48+
if re.search(r'\s*\#', notebook_content):
49+
continue
50+
51+
match = re.search(pattern, notebook_content)
52+
if match:
53+
target = match.group(2)
54+
return target in available_backends
3555
for notebook_content in lines:
3656
match = re.search('--target ([^ ]+)', notebook_content)
3757
if match and (match.group(1) not in available_backends):
@@ -122,7 +142,9 @@ def print_results(success, failed, skipped=[]):
122142

123143
## `quantum_transformer`:
124144
## See: https://github.com/NVIDIA/cuda-quantum/issues/2689
125-
notebooks_skipped = ['quantum_transformer.ipynb']
145+
notebooks_skipped = [
146+
'quantum_transformer.ipynb', 'logical_aim_sqale.ipynb'
147+
]
126148

127149
for notebook_filename in notebook_filenames:
128150
base_name = os.path.basename(notebook_filename)

docs/sphinx/applications/python/digitized_counterdiabatic_qaoa.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"#non_edges=[[u,v] for u in nodes for v in nodes if u<v and [u,v] not in edges]\n",
103103
"#print('Edges: ', edges)\n",
104104
"#print('Non-edges: ', non_edges)\n",
105-
"#weights=[0.6686,0.6686,0.6886,0.1091,0.0770,0.0770,0.0770,0.0770]\n",
105+
"#weights=[0.6686,0.6686,0.6686,0.1091,0.0770,0.0770,0.0770,0.0770]\n",
106106
"#penalty=8.0\n",
107107
"#num_layers=8"
108108
]

docs/sphinx/applications/python/hybrid_quantum_neural_networks.ipynb

Lines changed: 8 additions & 5 deletions
Large diffs are not rendered by default.

docs/sphinx/applications/python/quantum_pagerank.ipynb

Lines changed: 24 additions & 14 deletions
Large diffs are not rendered by default.

docs/sphinx/examples/python/dynamics/dynamics_intro_1.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Intorduction to CUDA-Q Dynamics (Jaynes-Cummings Model)"
7+
"# Introduction to CUDA-Q Dynamics (Jaynes-Cummings Model)"
88
]
99
},
1010
{
@@ -148,7 +148,7 @@
148148
"cell_type": "markdown",
149149
"metadata": {},
150150
"source": [
151-
"Initialize the states of the system in cupy arrays and define the time chedule"
151+
"Initialize the states of the system in cupy arrays and define the time schedule"
152152
]
153153
},
154154
{

0 commit comments

Comments
 (0)