NVIDIA / NVIDIA/cuda-quantum

Consistent cell ordering in published jupyter notebooks

Open
#693 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue stale-notified
Dominant language
C++
Stars
1.1k
Forks
456
Avg merge
1d 22h
Merged PRs (30d)
165

Description

Required prerequisites
  • Search the issue tracker to check if your feature has already been mentioned or rejected in other issues.
Describe the feature

We recently added a "Tutorials" section to the documentation containing a set of jupyter notebooks. What gets published here (https://nvidia.github.io/cuda-quantum/latest/examples/python/tutorials/single_qubit_rotation.html) all comes from the files in (docs/.../python/tutorials).

If you've executed a cell within that notebook and it has no output, the published docs will show no output. If you do print something, a separate cell will be displayed with that output below the code cell in the docs. See the output here for an example { 00:490 11:510 }.

This issue is incredibly nit picky, but the notebooks display the cell number next to each code cell -- according to the order that each cell was executed locally. In the executing_circuits.ipynb file above, this results in the first code cell for sample being labeled "# 3" and the next cell for observe being "# 12". Preferably, they will instead be "# 1" and "# 2" to make them both consistent and easier to reference.

The fix should be simple -- just re-run all of the files end to end -- instead of one kernel at a time. Then just open a PR with all of those re-executed files.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in docs/sphinx/examples/python/tutorials and inspect the published executing_circuits.ipynb example. Run each tutorial notebook end to end rather than executing one kernel at a time, then verify that code-cell numbers follow notebook order and outputs remain represented correctly in the published documentation. Open a PR containing the re-executed notebook files.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
documentation
Issue type
Feature
Difficulty
2/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.