Skip to content

Add Rabi Oscillations textbook notebook#188

Open
friedsam wants to merge 2 commits intoamazon-braket:mainfrom
friedsam:add-rabi-oscillations
Open

Add Rabi Oscillations textbook notebook#188
friedsam wants to merge 2 commits intoamazon-braket:mainfrom
friedsam:add-rabi-oscillations

Conversation

@friedsam
Copy link
Copy Markdown

*Issue #, if available:*Originally prepared in relation to amazon-braket-sdk-python#1194

Description of changes:
This PR adds a Rabi Oscillations example to the Amazon Braket Algorithm Library.

The contribution includes:
• New utility functions rabi_probability and rabi_circuit under src/braket/experimental/algorithms/rabi_oscillations/
• Unit tests validating the new utilities
• A textbook notebook Rabi_Oscillations.ipynb demonstrating:
• Theoretical background and analytic expression for P(|1\rangle)
• Exact simulator results using shots=0
• Finite-shot sampling comparison
• A measurement histogram at \theta = \pi/2
• Resource usage and cost tracking using the Braket Tracker
• An updated README entry referencing the new notebook

No existing core functionality was modified.

Testing done:

•	tox -e unit-tests

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

  • [x ] I have read the CONTRIBUTING doc
  • [ x] I used the commit message format described in CONTRIBUTING
  • [x ] I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Tests

  • [ x] I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • [x ] I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@friedsam friedsam requested a review from a team as a code owner February 27, 2026 22:38
@friedsam
Copy link
Copy Markdown
Author

Thanks for updating the branch. Please let me know if any further changes or documentation updates are needed from my side. Thanks again for reviewing the notebook.

@peterkomar-aws
Copy link
Copy Markdown
Contributor

Hi @friedsam , thanks for this contribution. This is a great idea for the textbook algorithm collection; it aligns with its educational direction (see Bell inequality). We are happy to add this if you could enrich it with 2-3 more demonstrations (in the same notebook is fine) that show how the effect of noise (T1, T2) can be simulated with Braket noisy circuits, and how the dynamics of off-resonant Rabi oscillation can be encoded with single qubit rotations, and maybe all of them combined. The circuits and the graphs will be more complex and will give the reader a good learning experience without going beyond the initial scope, i.e. Rabi oscillation. Also, happy to give more guidance on what part of the Braket Python SDK may be useful for this demo. What do you think?

@friedsam
Copy link
Copy Markdown
Author

Hi Peter, thanks a lot for the detailed feedback — that’s very helpful!
I like the idea of expanding the notebook in that direction and adding demonstrations for T1/T2 noise as well as off-resonant Rabi oscillations and a combined comparison.
It may take me a some time to work through these additions and structure the new sections properly. But I’ll update the notebook accordingly and will make sure that this still happens in a timely manner.
If you have any specific Braket SDK features you would recommend for the noise modeling part, I’d be happy to take a look.
Thanks again for the guidance!

@peterkomar-aws
Copy link
Copy Markdown
Contributor

Wonderful! Thanks for the quick response. For noise simulation the Simulating_Noise_On_Amazon_Braket.ipynb notebook is a great place to start. Let us know if you hit any blocker.

@friedsam
Copy link
Copy Markdown
Author

Thank you very much for the pointer to the Simulating_Noise_On_Amazon_Braket notebook — that’s very helpful.
I hope I will get to this over the weekend or soon after and will come back to you.
Thanks again for the guidance!

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