KEMBAR78
Update Hadamard test tutorial by ikkoham · Pull Request #1972 · NVIDIA/cuda-quantum · GitHub
Skip to content

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-pr-bot
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...

@github-actions
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
@github-actions
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
@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
@bettinaheim bettinaheim added this to the release 0.9.0 milestone Nov 19, 2024
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.

4 participants