Skip to content

Comments

feat(examples): add QDP tutorial notebook for Google Colab#1068

Open
SuyashParmar wants to merge 39 commits intoapache:mainfrom
SuyashParmar:feat/colab-examples-clean
Open

feat(examples): add QDP tutorial notebook for Google Colab#1068
SuyashParmar wants to merge 39 commits intoapache:mainfrom
SuyashParmar:feat/colab-examples-clean

Conversation

@SuyashParmar
Copy link
Contributor

This PR adds a ready-to-run Jupyter Notebook :

qdp/qdp-python/benchmark/notebooks/mahout_qdp_tutorial.ipynb

designed specifically for Google Colab.

Key Features:
Automated Setup: Includes cells to install Rust and build the QDP package from source directly in the Colab environment (no manual setup required).

Interactive Walkthrough: Demonstrates Engine initialization, data encoding (Lists, NumPy, PyTorch), and GPU acceleration.

PyTorch Integration: Shows how to perform zero-copy transfer of quantum states to PyTorch tensors.

How to Test: Upload the notebook to Google Colab (using a T4 GPU runtime) and run all cells. It validates the end-to-end workflow from installation to execution.

Suyash Parmar and others added 21 commits February 10, 2026 19:34
# Conflicts:
#	website/docusaurus.config.ts
@SuyashParmar
Copy link
Contributor Author

@ryankert01 can you pls check it ?

@SuyashParmar
Copy link
Contributor Author

Screenshot 2026-02-19 at 5 55 51 PM

@ryankert01

@ryankert01
Copy link
Member

Could you provide the colab link?

@SuyashParmar
Copy link
Contributor Author

@ryankert01
Copy link
Member

Please help ensure everything is right! There’s an obvious one!
IMG_5768

@SuyashParmar
Copy link
Contributor Author

@ryankert01
Copy link
Member

We don’t need try except in the example
IMG_5770

@ryankert01
Copy link
Member

ryankert01 commented Feb 19, 2026

You should use the correct one on the spot

@ryankert01 ryankert01 self-assigned this Feb 19, 2026
@SuyashParmar
Copy link
Contributor Author

@ryankert01 recheck ?

@ryankert01
Copy link
Member

ryankert01 commented Feb 19, 2026

Please help not do that and refer to mahout docs quickstart section

@SuyashParmar
Copy link
Contributor Author

@ryankert01 made changes to fix the Checks error

@SuyashParmar SuyashParmar force-pushed the feat/colab-examples-clean branch from a9790e0 to fafa8ce Compare February 20, 2026 00:58
@SuyashParmar
Copy link
Contributor Author

@ryankert01 sir can you pls re-run the checks

@SuyashParmar
Copy link
Contributor Author

@ryankert01 not able to figure out why checks are failing

@ryankert01 ryankert01 removed their assignment Feb 20, 2026
@ryankert01
Copy link
Member

ryankert01 commented Feb 20, 2026

Ok, you install our thing in the wrong way. Let’s refer to the docs

this is the reason

@400Ping
Copy link
Member

400Ping commented Feb 20, 2026

@SuyashParmar maybe you should consider easier issues to work on that suited you.

@ryankert01 ryankert01 changed the title feat(examples): add QDP tutorial notebook for Google Colab #1067 feat(examples): add QDP tutorial notebook for Google Colab Feb 21, 2026
@SuyashParmar
Copy link
Contributor Author

@ryankert01 @guan404ming CI was failing because test-notebooks runs on CPU-only ubuntu-latest and executes a GPU-only QDP notebook (QdpEngine(0)), so I fixed it by excluding qdp/qdp-python/benchmark/notebooks/* from that workflow while keeping the notebook itself direct and real for Colab GPU runs.

@SuyashParmar
Copy link
Contributor Author

If you want to keep notebook CI enabled for this file, we can keep the notebook straight-through but add one explicit prerequisite cell (assert QdpEngine.module == "_qdp") plus install _qdp in CI before execution (or use a GPU runner), because on CPU-only runners a real QdpEngine(0) notebook cannot pass without either setup changes or a conditional skip.

@ryankert01
Copy link
Member

ryankert01 commented Feb 23, 2026

Yeah! I think we probably just skip the ci. Btw, I think it should be located at examples/qdp. Let's move it there and notebook should be as educational purposes as possible. Please proof read it.

And I kinda understand why you wrote this kinda code hh. I just use claude code to write some notebook for me, and it gets me same output lol.

Maybe next thing we should work on is to make agent not mis-understanding

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