Skip to content

Commit

Permalink
Docs preview for PR #832.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuda-quantum-bot committed Nov 13, 2023
1 parent 11d258a commit 0d3d513
Show file tree
Hide file tree
Showing 99 changed files with 3,501 additions and 893 deletions.
3 changes: 2 additions & 1 deletion pr-832/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ add_nvqpp_test(IterativePhaseEstimation other/iterative_qpe.cpp)
add_nvqpp_test(RandomWalkPhaseEstimation other/random_walk_qpe.cpp)

if (CUSTATEVEC_ROOT AND CUDA_FOUND)
add_nvqpp_test(CuQuantumBackend basics/cuquantum_backends.cpp TARGET nvidia)
add_nvqpp_test(CuQuantumGHZ basics/cuquantum_backends.cpp TARGET nvidia)
add_nvqpp_test(CuQuantumBernsteinVazirani algorithms/bernstein_vazirani.cpp TARGET nvidia)
endif()

# mqpu code snippets, needs custatevec backend and (optionally MPI)
Expand Down
Binary file removed pr-832/_images/attachToDevContainer.png
Binary file not shown.
Binary file removed pr-832/_images/devContainersExtension.png
Binary file not shown.
Binary file removed pr-832/_images/openTerminal.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Single Qubit Rotation \n",
"# Cost Minimization\n",
"\n",
"Below we start with a basic example of a hybrid variational algorithm which involves flipping the bloch vector of a qubit from the $\\ket{0}$ to the $\\ket{1}$ state. First we import the relevant packages and set our backend to simulate our workflow on NVIDIA GPUs. \n",
"\n",
Expand Down Expand Up @@ -64,8 +64,6 @@
"outputs": [],
"source": [
"cost_values = []\n",
"cost_values.append(initial_cost_value)\n",
"\n",
"\n",
"def cost(parameters):\n",
" \"\"\"Returns the expectation value as our cost.\"\"\"\n",
Expand Down Expand Up @@ -115,6 +113,15 @@
"result = optimizer.optimize(dimensions=2, function=cost)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%pip install matplotlib"
]
},
{
"cell_type": "code",
"execution_count": 19,
Expand Down Expand Up @@ -147,7 +154,6 @@
],
"source": [
"# Plotting how the value of the cost function decreases during the minimization procedure.\n",
"# !pip install matplotlib\n",
"import matplotlib.pyplot as plt\n",
"\n",
"x_values = list(range(len(cost_values)))\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"qubit_count = 2\n",
"\n",
"# Define the simulation target.\n",
"cudaq.set_target(\"nvidia\")\n",
"cudaq.set_target(\"qpp-cpu\")\n",
"\n",
"# Define a quantum kernel function.\n",
"kernel = cudaq.make_kernel()\n",
Expand Down Expand Up @@ -87,7 +87,7 @@
"qubit_count = 2\n",
"\n",
"# Define the simulation target.\n",
"cudaq.set_target(\"nvidia\")\n",
"cudaq.set_target(\"qpp-cpu\")\n",
"\n",
"# Define a quantum kernel function.\n",
"kernel = cudaq.make_kernel()\n",
Expand Down
11 changes: 9 additions & 2 deletions pr-832/_sources/examples/python/tutorials/hybrid_qnns.ipynb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
"We perform binary classification on the MNIST dataset where data flows through the neural network architecture to the quantum circuit whose output is used to classify hand written digits."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%pip install matplotlib torch torchvision"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand All @@ -30,8 +39,6 @@
"source": [
"# Import the relevant packages\n",
"\n",
"# !pip install matplotlib torch torchvision\n",
"\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"source": [
"### Available Targets\n",
"\n",
"- **default**: The default qpp based CPU backend which is multithreaded to maximise the usage of available cores on your system.\n",
"- **qpp-cpu**: The qpp based CPU backend which is multithreaded to maximize the usage of available cores on your system.\n",
"\n",
"- **nvidia**: GPU based backend which accelerates quantum circuit simulation on NVIDIA GPUs powered by cuQuantum.\n",
"\n",
Expand Down Expand Up @@ -76,7 +76,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Default CPU Backend"
"### QPP-based CPU Backend"
]
},
{
Expand All @@ -93,7 +93,7 @@
}
],
"source": [
"cpu_result = ghz_state(n_qubits=2, target=\"default\")\n",
"cpu_result = ghz_state(qubit_count=2, target=\"qpp-cpu\")\n",
"\n",
"cpu_result.dump()"
]
Expand Down Expand Up @@ -122,7 +122,7 @@
}
],
"source": [
"gpu_result = ghz_state(n_qubits=25, target=\"nvidia\")\n",
"gpu_result = ghz_state(qubit_count=25, target=\"nvidia\")\n",
"\n",
"gpu_result.dump()"
]
Expand Down
2 changes: 1 addition & 1 deletion pr-832/_sources/examples/python/tutorials/vqe.ipynb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"metadata": {},
"outputs": [],
"source": [
"# !pip install openfermionpyscf"
"%pip install openfermionpyscf"
]
},
{
Expand Down
3 changes: 1 addition & 2 deletions pr-832/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ CUDA Quantum
Welcome to the CUDA Quantum documentation page!
You are browsing the documentation for |version| version of CUDA Quantum. You can find documentation for all released versions :doc:`here <versions>`.

**CUDA Quantum** is a single-source, modern C++ programming model and compiler platform
for the quantum acceleration of existing heterogeneous computing architectures.
**CUDA Quantum** is a programming model and toolchain for using quantum acceleration in heterogeneous computing architectures available in C++ and Python.

.. toctree::
:caption: Contents
Expand Down
Loading

0 comments on commit 0d3d513

Please sign in to comment.