Skip to content

Add new Julia tutorial (continuing work from #5254) - #5557

Draft
abbycross wants to merge 4 commits into
mainfrom
ajc/julia-to-merge
Draft

Add new Julia tutorial (continuing work from #5254)#5557
abbycross wants to merge 4 commits into
mainfrom
ajc/julia-to-merge

Conversation

@abbycross

Copy link
Copy Markdown
Collaborator

No description provided.

haimeng-zhang and others added 3 commits August 24, 2026 11:07
…5254)

### Summary
Julia is a dynamic language designed for high-performance numerical and
scientific computing, making it a natural fit for quantum simulation
workflows. The tutorial shows how Julia is used for both classical pre-
and post-processing (e.g., building Hamiltonians, running ODE solvers,
computing expectation values) and for orchestrating quantum hardware
jobs, eliminating the need to switch between languages or environments.
The example used in this tutorial is simulating time evolution of the
transverse-field Ising model.

To interface with IBM Quantum hardware from Julia, this tutorial uses
two packages from the Qiskit ecosystem: `Qiskit.jl` wraps the Qiskit C
API and provides circuit construction and transpilation functionality in
Julia; `QiskitIBMRuntime.jl` connects to IBM Quantum hardware through
the Qiskit IBM Runtime service, enabling job submission and result
retrieval directly from Julia.

### Files
The PR adds the following files:

- the notebook `docs/tutorials/time-evolution/time-evolution.ipynb` 
- the files `docs/tutorials/time-evolution/Project.toml` and
`docs/tutorials/time-evolution/Manifest.toml`, which are needed to set
up the Julia environment and install the dependencies to run the
notebook.

---------

Co-authored-by: ABBY CROSS <across@us.ibm.com>
Co-authored-by: Jim Garrison <garrison@ibm.com>
@abbycross
abbycross requested a review from a team August 24, 2026 15:14
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@qiskit-bot

Copy link
Copy Markdown
Contributor

One or more of the following people are relevant to this code:

  • @nathanearnestnoble

@henryzou50 henryzou50 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the updates @haimeng-zhang, overall the tutorial looks great! I do have some minor suggestions:

  1. Background text still has the old factor-of-2: the Background cell says each Trotter step applies $R_x(h_i\Delta\tau/2)$, but since $R_x(\theta) = e^{-i\theta X/2}$, the half-step needs $\theta = h_i\Delta\tau$, which is what the corrected code now does. Both mentions should read $R_x(h_i\Delta\tau)$. (The $R_{ZZ}(2J_{ij}\Delta\tau)$ part is correct.)

  2. Two saved outputs are stale: the println strings in two cells were edited after the notebook was last run, so the saved outputs still show the old text. To fix, edit the saved output text to match the current code (no re-run needed, since only the print strings changed):

    • In the tensor-network fidelity cell (the loop printing "fidelity at Trotter step $(r) was $(fidelity)"), the saved output still reads fidelity at trotter step ..., capitalize "trotter" -> "Trotter" in the output lines.
    • In the N=60 tensor-network reference cell, the code says println("Tensor-network reference:") but the saved output still reads Converged tensor-network reference: - change the output line to Tensor-network reference:.
  3. Small copyedits:

    • Comma splice in Requirements: "developed with Julia 1.11, one can install…" -> "…Julia 1.11; install it with juliaup add 1.11"
    • Doubled # # comment marker in the save_counts cell
    • "Github" -> "GitHub" in Next steps

@abbycross one thing I noticed on the infra side: the two plot images don't show up in the PR preview, the "Output:" blocks for both plot cells render empty. The extracted SVGs are deployed correctly; the problem is in the notebook itself. IJulia/Plots.jl saves each plot output with two representations: a text/html entry (an <img> with a ~50 KB base64 data-URI PNG) alongside the text/plain entry that ./fix rewrites to the <Image src="...svg" /> tag. The site renderer prefers text/html when present, and the data-URI <img> gets sanitized away, so nothing renders. I tried tox -e fix as usual, but it doesn't help as it extracts the SVG and rewrites text/plain but leaves the stale text/html entry in place (Python notebooks never hit this since matplotlib emits image/png/image/svg+xml directly). I think a fix for this PR is to delete the text/html key from the two plot outputs (also shrinks the notebook by ~120 KB). Longer term, we could have the notebook normalizer strip text/html from outputs it extracts images from, since any future Julia notebook will hit the same issue.

@abbycross
abbycross marked this pull request as draft August 31, 2026 18:01
@abbycross

Copy link
Copy Markdown
Collaborator Author

Ah, we need to look more closely at how to handle the toml files, and the additional directory added here. We might need to rethink how to support that content. @kaelynj thoughts?

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

5 participants