Add Julia tutorial for simulating time evolution of the Ising model - #5254
Add Julia tutorial for simulating time evolution of the Ising model#5254haimeng-zhang wants to merge 23 commits into
Conversation
|
Thanks for contributing to Qiskit documentation! Before your PR can be merged, it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. Thanks! 🙌 |
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
Before I forget ... the runtime client has a pending rename, which will be complete once JuliaRegistries/General#158556 merges. |
| @@ -0,0 +1,10 @@ | |||
| [deps] | |||
There was a problem hiding this comment.
Is it possible to remove both the toml files? These files won't render on the site and readers won't be able to see their contents. I would say if it's not critical to have the exact package versions installed you could just list these as packages the user should install. If it is, I would add the contents of Project.toml into the notebook through an accordion object.
There was a problem hiding this comment.
Hi @kaelynj, Sorry for the late reply on this! I edited the Requirements section of the notebook. It now has a code cell that directly installs the tutorial dependencies; this way the installation experience is self-contained in the notebook. It also provide an alternative approach to install from the .toml files, by linking to the Qiskit documentation github repo for those files, for users who want exact reproducibility. Let me know if this looks good to you :)
| "\n", | ||
| " # Neel state initialization\n", | ||
| " for i in 1:2:n\n", | ||
| " qc.x(i)\n", |
There was a problem hiding this comment.
Here's an example of what a corresponding change would look like. Throughout, all mutating operations starting with qc. should be replaced with the corresponding method ending with a !.
| " qc.x(i)\n", | |
| " x!(qc, i)\n", |
There was a problem hiding this comment.
Sorry for coming to this late. I've made this change to the tutorial. @garrison, please take a look.
8164662 to
6cf4840
Compare
| " \"LinearAlgebra\",\n", | ||
| " \"Plots\",\n", | ||
| " \"SparseArrays\",\n", |
There was a problem hiding this comment.
It's not necessary to include the standard library packages here.
| " \"LinearAlgebra\",\n", | |
| " \"Plots\",\n", | |
| " \"SparseArrays\",\n", | |
| " \"Plots\",\n", |
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.jlwraps the Qiskit C API and provides circuit construction and transpilation functionality in Julia;QiskitIBMRuntime.jlconnects 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:
docs/tutorials/time-evolution/time-evolution.ipynbdocs/tutorials/time-evolution/Project.tomlanddocs/tutorials/time-evolution/Manifest.toml, which are needed to set up the Julia environment and install the dependencies to run the notebook.