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

Update Hadamard test tutorial #1972

Merged
merged 6 commits into from
Aug 21, 2024

Conversation

ikkoham
Copy link
Contributor

@ikkoham ikkoham commented Jul 19, 2024

Description

I'd like to suggest some points.

  • Use observe primitive instead of sample. It's simpler and easy to extend the imaginary part.
  • Removed diagonalization part. It's not Hadamard test itself but one of the applications of Hadamard test.
  • Format and improved naming.
  • Use @ instead of np.dot.

@marwafar Feel free to comment on this PR.

Copy link

copy-pr-bot bot commented Jul 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.

@marwafar
Copy link
Collaborator

marwafar commented Jul 19, 2024

I am fine with the modification. Looks good to me.

I recommend to keep the matrix diagonalization example (I am aware that it is one of the Hadamard test application). The goal of this application is to to show an example for the nvidia-mQpu backend. In chemistry, the quantum filter diagonalization (Hadamrd test type) can be use to build the matrix element of the Hamiltonian and the wavefunction overlap, then we use classical algorithm to diagonalize the matrix.

@ikkoham
Copy link
Contributor Author

ikkoham commented Jul 19, 2024

Thank you. I'll revert the diagonalization part and modify it.

@bmhowe23 bmhowe23 added the documentation Improvements or additions to documentation label Jul 25, 2024
@ikkoham
Copy link
Contributor Author

ikkoham commented Aug 8, 2024

Sorry. I didn't understand what you meant by diagonalizing random expectations in a matrix. It might make sense if the parameters were correlated, but that would be a generalized eigenvalue problem, which would be more complicated.

At any rate, I went back to computing the expectation values in parallel. I believe I have included what we want in this notebook.

@marwafar
Copy link
Collaborator

@ikkoham Notebook looks good to me.

@ikkoham
Copy link
Contributor Author

ikkoham commented Aug 21, 2024

Thank you. I believe this PR is mergeable now.

@bmhowe23
Copy link
Collaborator

bmhowe23 commented Aug 21, 2024

/ok to test

Command Bot: Processing...

@bmhowe23
Copy link
Collaborator

bmhowe23 commented Aug 21, 2024

/ok to test

Command Bot: Processing...

Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Aug 21, 2024
@bmhowe23
Copy link
Collaborator

bmhowe23 commented Aug 21, 2024

/ok to test

Command Bot: Processing...

@bmhowe23 bmhowe23 enabled auto-merge (squash) August 21, 2024 14:55
github-actions bot pushed a commit that referenced this pull request Aug 21, 2024
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

Copy link
Collaborator

@bmhowe23 bmhowe23 left a comment

Choose a reason for hiding this comment

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

👍

@bmhowe23 bmhowe23 merged commit 33e5f25 into NVIDIA:main Aug 21, 2024
129 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2024
@ikkoham ikkoham deleted the upodate-hadamard-test-tutorial branch September 3, 2024 12:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants