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

Restructure of examples and applications #2218

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

zohimchandani
Copy link
Collaborator

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.

Copy link

copy-pr-bot bot commented Sep 19, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

},
"nbformat": 4,
"nbformat_minor": 4
}
Copy link
Collaborator

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?

Copy link
Collaborator

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?

Copy link
Collaborator

@sacpis sacpis left a 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.

@sacpis
Copy link
Collaborator

sacpis commented Sep 19, 2024

/ok to test

Command Bot: Processing...

@sacpis
Copy link
Collaborator

sacpis commented Sep 19, 2024

/ok to test

Command Bot: Processing...

@sacpis
Copy link
Collaborator

sacpis commented Sep 19, 2024

@efratshabtai Adding Efrat for visibility as the Python examples have been moved.

@sacpis
Copy link
Collaborator

sacpis commented Sep 19, 2024

/ok to test

Command Bot: Processing...

@sacpis
Copy link
Collaborator

sacpis commented Sep 19, 2024

/ok to test

Command Bot: Processing...

@sacpis
Copy link
Collaborator

sacpis commented Sep 20, 2024

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants