Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUDA-Q Docs Applications Section Reorg #2609

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b3ecd7f
Applications with filter
mawolf2023 Feb 6, 2025
d1778f3
new applications.rst
mawolf2023 Feb 7, 2025
b99a3e0
examples with solvers
mawolf2023 Feb 7, 2025
a7385da
Filters fixed, updated applications
mawolf2023 Feb 10, 2025
4738288
Update docs/sphinx/using/applications.rst
mawolf2023 Feb 12, 2025
b6eaa28
Drop down filters to backend, fixed dynamics page in backends
mawolf2023 Feb 12, 2025
f91f2e7
fix conflict
mawolf2023 Feb 12, 2025
d5e8eef
cudaqx page
mawolf2023 Feb 13, 2025
e10f431
remove sphinx needs
mawolf2023 Feb 20, 2025
7b941da
remove cudaqx and add apapt qaoa
mawolf2023 Feb 26, 2025
b745ca6
minor backend fixes, simulator figure update
mawolf2023 Feb 27, 2025
f3f8484
conflicts resolved
mawolf2023 Feb 27, 2025
f990b31
add license headers to .css and .js files
mawolf2023 Feb 27, 2025
5687b7d
Merge branch 'main' into sort_by_tag
khalatepradnya Mar 10, 2025
04f074a
* Spelling fixes
khalatepradnya Mar 10, 2025
e4457c6
* Make spell checker happy
khalatepradnya Mar 10, 2025
4c95f2a
* Content for two notebooks
khalatepradnya Mar 10, 2025
9c4935c
* Remove auto-generated files from source tree.
khalatepradnya Mar 10, 2025
ccfa657
* Fix output on QAOA notebook
khalatepradnya Mar 10, 2025
8e64813
* Reduce the diff by restoring notebooks which had only metadata changes
khalatepradnya Mar 10, 2025
9b30ff5
* Move the installation of `sphinx-tags` to devdeps image
khalatepradnya Mar 10, 2025
5adde72
Merge branch 'main' into sort_by_tag
khalatepradnya Mar 11, 2025
e070fa1
* Renamed notebooks to use capitalized proper names wherever applicable.
khalatepradnya Mar 11, 2025
5be370a
Merge branch 'main' into sort_by_tag
khalatepradnya Mar 11, 2025
86cfff8
Merge branch 'main' into sort_by_tag
khalatepradnya Mar 13, 2025
5151cc8
Since the AFQMC notebook was removed, doesn't make sense to have
khalatepradnya Mar 13, 2025
815ce62
Apply suggestions from code review
khalatepradnya Mar 13, 2025
97c58cb
Merge branch 'main' into sort_by_tag
khalatepradnya Mar 13, 2025
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
4 changes: 4 additions & 0 deletions .github/workflows/config/spellcheck_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ matrix:
# Ignore word prefixes, e.g. "pre-" in pre-computed
- open: '(^|\s)[A-Z]?[a-z]+-'
close: '(?=.)'
# Ignore apostrophy-s endings of words (e.g. NVIDIA's)
- open: '(?=\S)'
close: '($|(?=[^a-z]))'
content: '\u0027s'

- name: python
sources:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/config/spelling_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ DCO
DGX
DOI
Deuteron
Deutsch
Doxygen
FPGAs
Fock
Expand Down Expand Up @@ -54,6 +55,7 @@ Jupyter
JupyterLab
Kagome
Kraus
Krylov
LLVM
LSB
Libraries
Expand Down Expand Up @@ -99,6 +101,7 @@ QPU
QPUs
QPU’s
QTX
QX
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For CUDA-QX.

Qiskit
QuEra
QuTiP
Expand Down Expand Up @@ -169,7 +172,9 @@ coprocessor
coprocessors
copyable
coreset
coresets
cortex-cli
counterdiabatic
coupler
couplers
cuQuantum
Expand Down
2 changes: 1 addition & 1 deletion docker/build/devdeps.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@ RUN apt-get update && apt-get install -y --no-install-recommends python3 python3
ipython==8.15.0 pandoc==2.3 sphinx==5.3.0 sphinx_rtd_theme==1.2.0 sphinx-reredirects==0.1.2 \
sphinx-copybutton==0.5.2 sphinx_inline_tabs==2023.4.21 enum-tools[sphinx] breathe==4.34.0 \
nbsphinx==0.9.2 sphinx_gallery==0.13.0 myst-parser==1.0.0 ipykernel==6.29.4 notebook==7.3.2 \
ipywidgets==8.1.5
ipywidgets==8.1.5 sphinx-tags==0.4
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
157 changes: 157 additions & 0 deletions docs/sphinx/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
/*******************************************************************************
* Copyright (c) 2022 - 2025 NVIDIA Corporation & Affiliates. *
* All rights reserved. *
* *
* This source code and the accompanying materials are made available under *
* the terms of the Apache License 2.0 which accompanies this distribution. *
* *
* File: custom.css *
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have similar files in the source tree, so I don't know if the copyright banner format is same or different.
@schweitzpgi - can you provide pointers on the getting this one right for *.css and .*.js files?

* Created Date: 16 Feb 2023 *
* Last Modified: 16 Feb 2023 *
******************************************************************************/


.notebook-entry {
display: grid;
grid-template-areas:
"title image"
"content image";
grid-template-columns: 1fr 300px;
grid-template-rows: auto 1fr;
gap: 20px;
margin-bottom: 50px;
padding: 20px;
border: 1px solid #eee;
background: white;
}

.notebook-title {
grid-area: title;
display: block;
font-size: 24px;
font-weight: bold;
text-decoration: none;
margin: 0;
padding: 0 0 10px 0;
color: #333;
border-bottom: 1px solid #eee;
}

.notebook-title:hover {
color: #76b900;
text-decoration: underline;
}

.notebook-content {
grid-area: content;
padding: 0;
margin: 0;
line-height: 1.6;
}

.notebook-image {
grid-area: image;
width: 300px;
height: 200px;
object-fit: cover;
justify-self: end;
align-self: start;
margin: 0;
border-radius: 4px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toctree-wrapper {
grid-area: link;
margin: 10px 0 0 0;
padding: 0;
}

.tag-button {
margin: 2px;
padding: 8px 16px;
border: 1px solid #ccc;
background: #f8f8f8;
cursor: pointer;
border-radius: 4px;
transition: all 0.3s ease;
}

.tag-button.active {
background-color: #76b900;
color: white;
border-color: #599400;
box-shadow: 0 0 5px rgba(118, 185, 0, 0.3);
}

.tag-button:hover {
background-color: #ecffad;
}

.filter-groups {
margin-bottom: 40px;
padding: 20px;
background: #f9f9f9;
border-radius: 8px;
}

.tag-filters {
margin-bottom: 25px;
}

.backend-group {
display: inline-block;
position: relative;
margin-right: 10px;
}

.backend-options {
display: none;
position: absolute;
top: 100%;
left: 0;
background: white;
border: 1px solid #ccc;
border-radius: 4px;
padding: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
z-index: 100;
min-width: 200px;
}

.backend-group:hover .backend-options {
display: block;
}

.backend-toggle {
position: relative;
padding-right: 24px;
}

.backend-toggle::after {
content: '▼';
position: absolute;
right: 8px;
top: 50%;
transform: translateY(-50%);
font-size: 10px;
}

.sub-option {
display: block;
width: 100%;
text-align: left;
margin: 4px 0;
border: none;
background: transparent;
padding: 6px 12px;
}

.sub-option:hover {
background-color: #f5f5f5;
}

.sub-option.active {
background-color: #76b900;
color: white;
}
112 changes: 112 additions & 0 deletions docs/sphinx/_static/filter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/*******************************************************************************
* Copyright (c) 2022 - 2025 NVIDIA Corporation & Affiliates. *
* All rights reserved. *
* *
* This source code and the accompanying materials are made available under *
* the terms of the Apache License 2.0 which accompanies this distribution. *
* *
* File: filter.js *
* Created Date: 16 Feb 2023 *
* Last Modified: 16 Feb 2023 *
******************************************************************************/


document.addEventListener('DOMContentLoaded', function() {
const notebooks = document.querySelectorAll('.notebook-entry');
const tagButtons = document.querySelectorAll('.tag-button');

const activeFilters = {
domain: 'all',
backend: 'all',
occasion: 'all',
subFilter: 'all'
};

const backendCategories = {
noiseless: ['gpu', 'mgpu', 'mqpu'],
noisy: ['density'],
qpu: ['neutral']
};

tagButtons.forEach(button => {
button.addEventListener('click', function() {
const group = this.getAttribute('data-group');
const tag = this.getAttribute('data-tag');

if (this.classList.contains('sub-option')) {
if (activeFilters.subFilter === tag) {
activeFilters.subFilter = 'all';
activeFilters.backend = 'all';
document.querySelectorAll('.sub-option, .backend-toggle').forEach(btn =>
btn.classList.remove('active'));
document.querySelector('.tag-button[data-tag="all"]').classList.add('active');
} else {
activeFilters.subFilter = tag;
activeFilters.backend = this.closest('.backend-group')
.querySelector('.backend-toggle')
.getAttribute('data-tag');

document.querySelectorAll('.sub-option').forEach(btn =>
btn.classList.toggle('active', btn.getAttribute('data-tag') === tag));

document.querySelectorAll('.backend-toggle').forEach(toggle =>
toggle.classList.toggle('active',
toggle.getAttribute('data-tag') === activeFilters.backend));

document.querySelector('.tag-button[data-tag="all"]').classList.remove('active');
}
} else if (this.classList.contains('backend-toggle')) {
if (activeFilters.backend === tag) {
activeFilters.backend = 'all';
activeFilters.subFilter = 'all';
document.querySelectorAll('.backend-toggle, .sub-option').forEach(btn =>
btn.classList.remove('active'));
document.querySelector('.tag-button[data-tag="all"]').classList.add('active');
} else {
activeFilters.backend = tag;
activeFilters.subFilter = 'all';
document.querySelectorAll('.backend-toggle').forEach(btn =>
btn.classList.toggle('active', btn.getAttribute('data-tag') === tag));
document.querySelectorAll('.sub-option').forEach(btn =>
btn.classList.remove('active'));
document.querySelector('.tag-button[data-tag="all"]').classList.remove('active');
}
} else {
// Handle regular filter buttons
if (group === 'occasion') {
if (activeFilters[group] === tag) {
// If clicking the same tag, reset to 'all'
activeFilters[group] = 'all';
this.classList.remove('active');
} else {
activeFilters[group] = tag;
document.querySelectorAll(`.tag-button[data-group="${group}"]`)
.forEach(btn => btn.classList.remove('active'));
this.classList.add('active');
}
} else {
document.querySelectorAll(`.tag-button[data-group="${group}"]`)
.forEach(btn => btn.classList.remove('active'));
this.classList.add('active');
activeFilters[group] = tag;
}

if (group === 'backend') {
activeFilters.subFilter = 'all';
}
}

// Apply all filters
notebooks.forEach(notebook => {
const notebookTags = notebook.getAttribute('data-tags').split(',').map(t => t.trim());
const isVisible = Object.entries(activeFilters).every(([group, tag]) => {
if (group === 'subFilter' && tag !== 'all') {
return notebookTags.includes(tag);
}
return tag === 'all' || notebookTags.includes(tag);
});
notebook.style.display = isVisible ? 'grid' : 'none';
});
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"Deutsch's Algorithm is a concise demonstration of the differences in computational complexity between classical and quantum algorithms for certain problems. For Desutch's algorithm, we begin with a function which takes in a bit and outputs a bit. This can be represented as $f: \\{0,1\\} \\longrightarrow \\{0,1\\}$. \n",
"The function $f$ has the property that it either constant or balanced. The goal of Deutsch's Algorithm is to determine whether our given function is constant or whether it is balanced. \n",
"\n",
"A constant function is \"A balanced function is a function such that the outputs are the same regardless of the inputs, i.e., if $f(0) = 0$ then $f(1) = 1$ or if $f(0) = 1$ then $f(1) = 0$.\n\", the outputs are the same regardless of the inputs, i.e., in the case of $f: \\{0,1\\} \\longrightarrow \\{0,1\\}$, there are are two ways in which this can occur: $f(0) = f(1) = 0$ or $f(0) = f(1) = 1$.\n",
"A constant function is \"A balanced function is a function such that the outputs are the same regardless of the inputs, i.e., if $f(0) = 0$ then $f(1) = 1$ or if $f(0) = 1$ then $f(1) = 0$.\n",
"\", the outputs are the same regardless of the inputs, i.e., in the case of $f: \\{0,1\\} \\longrightarrow \\{0,1\\}$, there are are two ways in which this can occur: $f(0) = f(1) = 0$ or $f(0) = f(1) = 1$.\n",
"\n",
"A balanced function is defined such that the ouputs are balanced across their possibilities, i.e., if $f(0) = 0$ then $f(1) = 1$ or if $f(0) = 1$ then $f(1) = 0$.\n",
" \n",
Expand Down Expand Up @@ -394,7 +395,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -410,13 +411,12 @@
"pygments_lexer": "ipython3",
"version": "3.10.12"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"{ 11111:4 11110:1 01101:2 01010:148 01110:47 01000:3 00110:54 10101:165 00101:2 01011:154 00100:3 01001:41 00000:1 00011:3 01100:8 10011:7 00010:2 01111:2 11011:3 00111:10 11100:7 10001:65 10010:7 10100:144 10110:40 10000:5 10111:3 11000:7 11101:1 11001:59 11010:2 }\n",
"{ 00000:1 00010:3 00011:4 00100:2 00101:4 00110:58 00111:7 01000:1 01001:44 01010:153 01011:156 01100:6 01101:7 01110:54 01111:5 10000:7 10001:27 10010:8 10011:4 10100:155 10101:165 10110:45 11000:4 11001:65 11010:2 11011:2 11100:5 11101:2 11110:1 11111:3 }\n",
"\n",
"The max cut is given by the partition: 10101\n"
]
Expand Down Expand Up @@ -343,7 +343,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"CUDA-Q Version latest (https://github.com/NVIDIA/cuda-quantum a726804916fd397408cbf595ce6fe5f33dcd8b4c)\n"
"CUDA-Q Version proto-0.8.0-developer (https://github.com/NVIDIA/cuda-quantum e4457c69e5ed4e7061a0e40cd4b2825923cfaa00)\n"
]
}
],
Expand All @@ -354,7 +354,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -372,5 +372,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Loading
Loading