-
Notifications
You must be signed in to change notification settings - Fork 174
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
Restructure of examples and applications #2218
base: main
Are you sure you want to change the base?
Conversation
docs/sphinx/examples/python/tutorials/digitized_counterdiabatic_qaoa.ipynb
Show resolved
Hide resolved
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we run this notebook and save the output in this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When running vqe_advanced.ipynb, I am getting the following error as I have only 1 GPU on my system as the program is intended to run on nvidia-mqpu (tried target as nvidia as well).
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[20], [line 1](vscode-notebook-cell:?execution_count=20&line=1)
----> [1](vscode-notebook-cell:?execution_count=20&line=1) gradient = batched_gradient_function(kernel, x0, spin_ham, epsilon)
[3](vscode-notebook-cell:?execution_count=20&line=3) exp_vals = []
[6](vscode-notebook-cell:?execution_count=20&line=6) def objective_function(parameter_vector: list[float], \
[7](vscode-notebook-cell:?execution_count=20&line=7) gradient=gradient, hamiltonian=spin_ham, kernel=kernel):
Cell In[19], [line 36](vscode-notebook-cell:?execution_count=19&line=36)
[26](vscode-notebook-cell:?execution_count=19&line=26) g_plus.append(
[27](vscode-notebook-cell:?execution_count=19&line=27) cudaq.observe_async(kernel,
[28](vscode-notebook-cell:?execution_count=19&line=28) hamiltonian,
(...)
[31](vscode-notebook-cell:?execution_count=19&line=31) xplus[i],
[32](vscode-notebook-cell:?execution_count=19&line=32) qpu_id=qpu_counter))
[33](vscode-notebook-cell:?execution_count=19&line=33) qpu_counter += 1
[35](vscode-notebook-cell:?execution_count=19&line=35) g_minus.append(
---> [36](vscode-notebook-cell:?execution_count=19&line=36) cudaq.observe_async(kernel,
[37](vscode-notebook-cell:?execution_count=19&line=37) hamiltonian,
[38](vscode-notebook-cell:?execution_count=19&line=38) qubit_count,
[39](vscode-notebook-cell:?execution_count=19&line=39) electron_count,
[40](vscode-notebook-cell:?execution_count=19&line=40) xminus[i],
[41](vscode-notebook-cell:?execution_count=19&line=41) qpu_id=qpu_counter))
[42](vscode-notebook-cell:?execution_count=19&line=42) qpu_counter += 1
[44](vscode-notebook-cell:?execution_count=19&line=44) if qpu_counter % num_qpus == 0:
ValueError: Provided qpu_id is invalid (must be <= to platform.num_qpus()).
@zohimchandani Would you mind running this notebook and saving the output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few changes are needed.
Command Bot: Processing... |
Command Bot: Processing... |
@efratshabtai Adding Efrat for visibility as the Python examples have been moved. |
…densed) as part of PR NVIDIA#2218
Command Bot: Processing... |
Command Bot: Processing... |
@zohimchandani Seems like as we have purged *.py files from examples/python, we will need to update .rst files under docs/sphinx/using/examples/.rst. Would you please update those *.rst files? |
Examples section: aim is to show how to use CUDA-Q syntax.
Applications section: aim to show various useful things you can build with CUDA-Q.
Restructure of both sections, added new ones, deleted repeated ones and condensed ones that could be condensed.
This work is in collaboration with @mawolf2023 who did most of the heavy lifting here.