Skip to content

feat: complete the Braket SDK cheat sheet with verified snippets#1279

Open
hassaansaleem28 wants to merge 16 commits into
amazon-braket:mainfrom
hassaansaleem28:docs/complete-braket-cheat-sheet
Open

feat: complete the Braket SDK cheat sheet with verified snippets#1279
hassaansaleem28 wants to merge 16 commits into
amazon-braket:mainfrom
hassaansaleem28:docs/complete-braket-cheat-sheet

Conversation

@hassaansaleem28

Copy link
Copy Markdown

Issue #, if available: Closes #1255

Description of changes:

This finishes the Braket SDK cheat sheet that was started in the draft PR #995 by @jcjaskula-aws. As the issue suggested, I built on that work and opened a fresh PR for clarity. The first commit brings in the original foundation untouched and credits the original authors, then the later commits take it the rest of the way.

What I did:

  1. Went through every existing snippet and fixed the ones that no longer match the current SDK. For example task.result() (it was results()), the Circuit.unitary argument order, straight quotes in the free parameter examples, the retired Rigetti AspenM3 device, and a couple of missing imports.

  2. Added the five sections the issue asked for, in both English and French:

    • Program sets
    • Emulators
    • Experimental capabilities
    • Reservations
    • The hybrid job decorator
  3. Finished the French translation. The original design was bilingual but the French side was only partly done, so I brought every section to parity. The code stays identical across languages and only the descriptions are translated.

  4. Added a small script that checks the cheat sheet against the installed SDK. It runs every import, runs the local snippets for real, makes sure the French code matches the English, and confirms the generated file is up to date. Writing this is actually how I found two of the snippet bugs above.

  5. Restored the generator that builds the flat genai_cheat_sheet.md companion file. The original was removed in feat: publish a cheat sheet via github pages #995 because it downloaded a zip over the network and broke CI, so I rewrote it to read the local files instead, and regenerated the output.

  6. Added a README.md in the cheat sheet folder that explains how to add or edit a section, add a language, run the checks, regenerate the companion file, and preview the site locally.

  7. Fixed the publish workflow to call the restored generator, and added a small workflow that runs the checks on pull requests. Publishing still only happens on pushes to main.

Testing done:

I installed the SDK in a clean Python 3.12 environment and ran the verification script, which passes. Every import resolves, the local snippets run on the local simulator and the local emulator, the English and French code match, and the generated file is in sync. I also ran the same lint commands the CI uses (ruff format --check . and ruff check src) and both pass. The changes are documentation only and do not touch src or the unit tests.

Merge Checklist

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • 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.

hassaansaleem28 and others added 13 commits June 4, 2026 12:31
Co-authored-by: Jean-Christophe Jaskula <jjaskula@amazon.com>
Signed-off-by: hassaansaleem28 <iamhassaans@gmail.com>
Signed-off-by: hassaansaleem28 <iamhassaans@gmail.com>
Signed-off-by: hassaansaleem28 <iamhassaans@gmail.com>
Signed-off-by: hassaansaleem28 <iamhassaans@gmail.com>
Signed-off-by: hassaansaleem28 <iamhassaans@gmail.com>
Signed-off-by: hassaansaleem28 <iamhassaans@gmail.com>
…(en + fr)

Signed-off-by: hassaansaleem28 <iamhassaans@gmail.com>
…it caught

Signed-off-by: hassaansaleem28 <iamhassaans@gmail.com>
Signed-off-by: hassaansaleem28 <iamhassaans@gmail.com>
Signed-off-by: hassaansaleem28 <iamhassaans@gmail.com>
Signed-off-by: hassaansaleem28 <iamhassaans@gmail.com>
Signed-off-by: hassaansaleem28 <iamhassaans@gmail.com>
Signed-off-by: hassaansaleem28 <iamhassaans@gmail.com>
@hassaansaleem28 hassaansaleem28 requested a review from a team as a code owner June 4, 2026 14:46
@github-actions github-actions Bot added title needs formatting documentation Improvements or additions to documentation CI and removed title needs formatting labels Jun 4, 2026
@hassaansaleem28 hassaansaleem28 changed the title feat(docs) : complete the Amazon Braket SDK cheat sheet feat(docs): complete the Amazon Braket SDK cheat sheet Jun 5, 2026
@hassaansaleem28 hassaansaleem28 changed the title feat(docs): complete the Amazon Braket SDK cheat sheet feat: complete the Braket SDK cheat sheet with verified snippets Jun 5, 2026
@hassaansaleem28

Copy link
Copy Markdown
Author

cc @peterkomar-aws @sesmart

@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a5ee47d) to head (3570697).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1279   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          169       169           
  Lines        10963     10963           
  Branches      1412      1412           
=========================================
  Hits         10963     10963           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@peterkomar-aws

Copy link
Copy Markdown
Contributor

The jekyll bundle is failing. Please include detailed instructions in the Readme on how to make it work.

Signed-off-by: hassaansaleem28 <iamhassaans@gmail.com>
@hassaansaleem28

Copy link
Copy Markdown
Author

done @peterkomar-aws.

I ran the whole flow locally and it builds and serves cleanly, with both language pages returning HTTP 200:

$ bundle install
Bundle complete! 2 Gemfile dependencies, 35 gems now installed.

$ bundle exec jekyll build
Destination: doc/cheat_sheet/_site
Generating...
done in 0.30 seconds.

$ bundle exec jekyll serve
Server address: http://127.0.0.1:4000

$ curl -I http://127.0.0.1:4000/ # English page
HTTP 200
$ curl -I http://127.0.0.1:4000/fr/ # French page
HTTP 200

Steps are in doc/cheat_sheet/README.md under "Preview the site locally" if you'd like to reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Complete a Braket SDK Cheat sheet

2 participants