Skip to content

Ion Trap example #3026

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

Merged
merged 15 commits into from
Jun 13, 2025
Merged

Ion Trap example #3026

merged 15 commits into from
Jun 13, 2025

Conversation

Gopal-Dahale
Copy link
Contributor

@Gopal-Dahale Gopal-Dahale commented Jun 10, 2025

Purpose

Add an example on ion trap quantum dynamics and GHZ state preparation using CUDA-Q, based on the Sørensen-Mølmer paper.

Details

Implements time evolution of the effective Hamiltonian H = $4\chi J_x^2$. It implements GHZ state preparation from |gg...g⟩ → (|gg...g⟩ + |ee...e⟩)/√2, and probability measurements are performed using projector operators. Below plots reproduce Fig. 1 from the paper.

This PR closes #2941

Mentions

@1tnguyen

Copy link

copy-pr-bot bot commented Jun 10, 2025

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.

@1tnguyen
Copy link
Collaborator

1tnguyen commented Jun 10, 2025

/ok to test 384a6a5

Command Bot: Processing...

@1tnguyen
Copy link
Collaborator

@Gopal-Dahale Thank you for the contribution. This tutorial looks great.
I've added a couple of comments to improve the readability.

@1tnguyen 1tnguyen added documentation Improvements or additions to documentation UnitaryHack Good issue for UnitaryHack labels Jun 10, 2025
@1tnguyen
Copy link
Collaborator

@Gopal-Dahale We need to fix a couple of things for the CI pipeline:

(1) Address the DCO check: https://github.com/NVIDIA/cuda-quantum/pull/3026/checks?check_run_id=43828576852
Please add a DCO Remediation Commit as described there and sign off (-s) future commits.

(2) Code format: https://github.com/NVIDIA/cuda-quantum/actions/runs/15565538371/job/43850332610?pr=3026

You can fix this by running the yapf formatter on the file and committing the changes.
python3 -m yapf --style google -i ion_trap.py

(3) Spelling check: https://github.com/NVIDIA/cuda-quantum/actions/runs/15565538371?pr=3026#summary-43850332620

We do check all the words in code comments. Hence, if a word is not English, we can escape it with backticks, e.g.,`gg`

Gopal-Dahale and others added 7 commits June 11, 2025 11:11
I, Gopal Dahale <[email protected]>, hereby add my Signed-off-by to this commit: 45fb968
I, Gopal Dahale <[email protected]>, hereby add my Signed-off-by to this commit: 384a6a5
I, Gopal Dahale <[email protected]>, hereby add my Signed-off-by to this commit: 1c3e38d

Signed-off-by: Gopal Dahale <[email protected]>
Signed-off-by: Gopal Dahale <[email protected]>
@sacpis
Copy link
Collaborator

sacpis commented Jun 11, 2025

/ok to test db6a804

Command Bot: Processing...

@sacpis
Copy link
Collaborator

sacpis commented Jun 11, 2025

@Gopal-Dahale Would you please run the following command to fix the spellcheck task in CI?

bash scripts/run_all_spelling.sh

Please enclose the words appearing in comments in `` to fix it.

@1tnguyen
Copy link
Collaborator

1tnguyen commented Jun 11, 2025

/ok to test 05e52cd

Command Bot: Processing...

Copy link
Collaborator

@1tnguyen 1tnguyen left a comment

Choose a reason for hiding this comment

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

LGTM 👍

github-actions bot pushed a commit that referenced this pull request Jun 12, 2025
Copy link

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

@1tnguyen
Copy link
Collaborator

1tnguyen commented Jun 13, 2025

/ok to test 0ed0e33

Command Bot: Processing...

@1tnguyen 1tnguyen enabled auto-merge (squash) June 13, 2025 02:21
@1tnguyen
Copy link
Collaborator

1tnguyen commented Jun 13, 2025

/ok to test 0872b09

Command Bot: Processing...

@sacpis
Copy link
Collaborator

sacpis commented Jun 13, 2025

/ok to test 65cd371

Command Bot: Processing...

github-actions bot pushed a commit that referenced this pull request Jun 13, 2025
Copy link

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

@1tnguyen 1tnguyen merged commit fe61ccc into NVIDIA:main Jun 13, 2025
190 of 191 checks passed
github-actions bot pushed a commit that referenced this pull request Jun 13, 2025
Copy link

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

@Gopal-Dahale
Copy link
Contributor Author

@1tnguyen @sacpis I missed updating the rst file. Have a look at #3063 .

annagrin pushed a commit to annagrin/cuda-quantum that referenced this pull request Jun 17, 2025
* Ion Trap example

* fix comments

* Addressed comments

* DCO Remediation Commit for Gopal Dahale <[email protected]>

I, Gopal Dahale <[email protected]>, hereby add my Signed-off-by to this commit: 45fb968
I, Gopal Dahale <[email protected]>, hereby add my Signed-off-by to this commit: 384a6a5
I, Gopal Dahale <[email protected]>, hereby add my Signed-off-by to this commit: 1c3e38d

Signed-off-by: Gopal Dahale <[email protected]>

* Formatted

Signed-off-by: Gopal Dahale <[email protected]>

* Fix spellings

* DCO Remediation Commit for Gopal Dahale <[email protected]>

I, Gopal Dahale <[email protected]>, hereby add my Signed-off-by to this commit: 1f6c4b1

Signed-off-by: Gopal Dahale <[email protected]>

Signed-off-by: Gopal Dahale <[email protected]>

---------

Signed-off-by: Gopal Dahale <[email protected]>
Co-authored-by: Sachin Pisal <[email protected]>
Co-authored-by: Thien Nguyen <[email protected]>
Signed-off-by: Anna Gringauze <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation UnitaryHack Good issue for UnitaryHack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CUDA-Q dynamics examples/tutorials for quantum hardware device modelling
3 participants