From ceb6132f9029b5b3823735902f6befe2c5847575 Mon Sep 17 00:00:00 2001 From: Pradnya Khalate <148914294+khalatepradnya@users.noreply.github.com> Date: Wed, 11 Dec 2024 15:08:39 -0800 Subject: [PATCH] Fixes for Python notebooks (#2472) Follow-up to PR# 2455 and PR# 2467 * Fix for invalid notebook - hadamard_test.ipynb * Remove explicit setting of target (default target is nvidia if GPU(s) present) - digitized_counterdiabatic_qaoa.ipynb Addresses CI failures in the image validation step. Signed-off-by: Pradnya Khalate --- .../python/digitized_counterdiabatic_qaoa.ipynb | 9 +++------ docs/sphinx/applications/python/hadamard_test.ipynb | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/docs/sphinx/applications/python/digitized_counterdiabatic_qaoa.ipynb b/docs/sphinx/applications/python/digitized_counterdiabatic_qaoa.ipynb index 0ac3df0ca5..a3043b7a1b 100644 --- a/docs/sphinx/applications/python/digitized_counterdiabatic_qaoa.ipynb +++ b/docs/sphinx/applications/python/digitized_counterdiabatic_qaoa.ipynb @@ -44,16 +44,13 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import cudaq\n", "from cudaq import spin\n", - "import numpy as np\n", - "\n", - "cudaq.set_target('nvidia')\n", - "# cudaq.set_target('qpp-cpu') # Uncomment this line if no GPUs are available" + "import numpy as np\n" ] }, { @@ -65,7 +62,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [ { diff --git a/docs/sphinx/applications/python/hadamard_test.ipynb b/docs/sphinx/applications/python/hadamard_test.ipynb index a643f59ba3..1d1f781d59 100644 --- a/docs/sphinx/applications/python/hadamard_test.ipynb +++ b/docs/sphinx/applications/python/hadamard_test.ipynb @@ -37,7 +37,7 @@ "![Htest2](./images/htestfactored.png)\n", "\n", "By preparing this circuit, and repeatedly measuring the ancilla qubit, we estimate the expectation value as $$P(0)-P(1) = Re \\bra{\\psi} O \\ket{\\phi}.$$\n", - "\, + "\n", "\n", "The following sections demonstrate how this can be performed in CUDA-Q." ]