-
Notifications
You must be signed in to change notification settings - Fork 4
Setup the structure of tutorials and several CI pipelines. #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 21 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
8c9156a
Create Quarto CI
ytdHuang c142a1e
add spell check CI
ytdHuang fe7281f
add dependent bot
ytdHuang 642d186
Create Project.toml for `Julia`
ytdHuang 8ec06c1
Update environment variables
ytdHuang 156bda2
Update README.md
ytdHuang c0c95e8
Update README.md
ytdHuang 5b6fc2b
Update LICENSE
ytdHuang feb8da7
add code of conduct
ytdHuang 6f898e0
Create Makefile
ytdHuang 7f88ce9
fix Makefile
ytdHuang a9dfb47
update gitignore
ytdHuang f61d3e3
remove `_freeze`
ytdHuang fdf5f89
update tutorials
ytdHuang b8eb416
add PR template
ytdHuang d979c96
Update `README`, `LICENSE`, and add `CODE_OF_CONDUCT`
ytdHuang ffb75cc
update CI
ytdHuang 7381a86
add build CI badge in README
ytdHuang 1e1619d
add Quarto to deps in Project.toml
ytdHuang 2c8c695
improve precompilation for julia
ytdHuang 13e0634
fix CI
ytdHuang c837db2
remove Quarto in Project.toml
ytdHuang 1b96edb
ignore `json` files
ytdHuang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" # Location of package manifests | ||
| schedule: | ||
| interval: "weekly" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| ## Checklist | ||
| Thank you for contributing to Tutorials for Quantum Toolbox in `Julia`! Please make sure you have finished the following tasks before opening the PR. | ||
|
|
||
| - [ ] Please read [Contributing to QuantumToolbox.jl](https://qutip.org/QuantumToolbox.jl/stable/resources/contributing). | ||
| - [ ] All tutorials were able to render locally by running: `make render`. | ||
|
|
||
| Request for a review after you have completed all the tasks. If you have not finished them all, you can also open a [Draft Pull Request](https://github.blog/2019-02-14-introducing-draft-pull-requests/) to let the others know this on-going work. | ||
|
|
||
| ## Description | ||
| Describe the proposed change here. | ||
|
|
||
| ## Related issues or PRs | ||
| Please mention the related issues or PRs here. If the PR fixes an issue, use the keyword close/closes/closed/fix/fixes/fixed/resolve/resolves/resolved followed by the issue id, e.g. fix #[id] | ||
|
|
||
| ## Additional context |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| name: Spell Check | ||
|
|
||
| on: [pull_request] | ||
|
|
||
| jobs: | ||
| typos-check: | ||
| name: Spell Check with Typos | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout Actions Repository | ||
| uses: actions/checkout@v4 | ||
| - name: Check spelling | ||
| uses: crate-ci/[email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| name: Quarto Build | ||
|
|
||
| on: # either one of the following four cases | ||
| workflow_dispatch: # manually trigger | ||
|
|
||
| schedule: | ||
| - cron: '0 0 * * 0' # weekly (every Sunday) | ||
|
|
||
| push: | ||
| branches: main | ||
|
|
||
| pull_request: | ||
| branches: | ||
| - main | ||
| types: | ||
| - opened | ||
| - reopened | ||
| - synchronize | ||
| - ready_for_review | ||
|
|
||
| jobs: | ||
| build-deploy: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| actions: write # needed to allow julia-actions/cache to delete old caches that it has created | ||
| contents: write # needed for Quarto render | ||
| if: ${{ !github.event.pull_request.draft }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Quarto | ||
| uses: quarto-dev/quarto-actions/setup@v2 | ||
| - uses: julia-actions/setup-julia@v2 | ||
| with: | ||
| version: '1' | ||
| - uses: julia-actions/cache@v2 | ||
| - uses: julia-actions/julia-buildpkg@v1 | ||
| with: | ||
| precompile: true | ||
| - uses: cardinalby/export-env-action@v1 | ||
| with: | ||
| envFile: '_environment' | ||
| expand: 'true' | ||
| - name: Quarto Render | ||
| uses: quarto-dev/quarto-actions/render@v2 | ||
| with: | ||
| to: html | ||
| - name: Quarto Publish | ||
| if: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }} | ||
| uses: quarto-dev/quarto-actions/publish@v2 | ||
| with: | ||
| render: 'false' # rendered in the previous step already | ||
| target: gh-pages | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Contributor Covenant Code of Conduct | ||
|
|
||
| As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. | ||
|
|
||
| We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality. | ||
|
|
||
| Examples of unacceptable behavior by participants include: | ||
|
|
||
| * The use of sexualized language or imagery | ||
| * Personal attacks | ||
| * Trolling or insulting/derogatory comments | ||
| * Public or private harassment | ||
| * Publishing other's private information, such as physical or electronic addresses, without explicit permission | ||
| * Other unethical or unprofessional conduct | ||
|
|
||
| Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team. | ||
|
|
||
| This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. | ||
|
|
||
| Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers. | ||
|
|
||
| This Code of Conduct is adapted from the Contributor Covenant , version 1.2.0, available at https://www.contributor-covenant.org/version/1/2/0/code-of-conduct.html | ||
|
|
||
| [homepage]: https://contributor-covenant.org | ||
| [version]: https://contributor-covenant.org/version/1/2/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,29 @@ | ||
| MIT License | ||
| BSD 3-Clause License | ||
|
|
||
| Copyright (c) 2025 QuTiP | ||
| Copyright (c) 2025, QuTiP developers and contributors. | ||
| All rights reserved. | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
| Redistribution and use in source and binary forms, with or without modification, | ||
| are permitted provided that the following conditions are met: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
| 1. Redistributions of source code must retain the above copyright notice, this | ||
| list of conditions and the following disclaimer. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. | ||
| 2. Redistributions in binary form must reproduce the above copyright notice, | ||
| this list of conditions and the following disclaimer in the documentation | ||
| and/or other materials provided with the distribution. | ||
|
|
||
| 3. Neither the name of the copyright holder nor the names of its contributors | ||
| may be used to endorse or promote products derived from this software without | ||
| specific prior written permission. | ||
|
|
||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
| ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | ||
| ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
| (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
| ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| JULIA:=julia | ||
| QUARTO:=quarto | ||
|
|
||
| include _environment | ||
|
|
||
| default: help | ||
|
|
||
| render: | ||
| ${JULIA} --project=@. -e 'import Pkg; Pkg.instantiate(); Pkg.resolve(); Pkg.precompile(); using QuantumToolbox, HierarchicalEOM;' | ||
| ${JULIA} --project=@. -e 'using QuantumToolbox, HierarchicalEOM;' | ||
| ${QUARTO} render | ||
|
|
||
| preview: | ||
| ${QUARTO} preview | ||
|
|
||
| all: render preview | ||
|
|
||
| help: | ||
| @echo "The following make commands are available:" | ||
| @echo " - make render: render the tutorial files" | ||
| @echo " - make preview: start a local site of tutorials" | ||
| @echo " - make all: run every commands in the above order" | ||
|
|
||
| .PHONY: default render preview all help |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| [deps] | ||
| CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" | ||
| HierarchicalEOM = "a62dbcb7-80f5-4d31-9a88-8b19fd92b128" | ||
| QuantumToolbox = "6c2fb7c5-b903-41d2-bc5e-5a7c320b9fab" | ||
| QuartoNotebookRunner = "4c0109c6-14e9-4c88-93f0-2b974d3468f4" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| title: "Jaynes Cummings Model" | ||
| # subtitle: "" | ||
| author: Alberto Mercurio | ||
|
|
||
| engine: julia | ||
| --- | ||
|
|
||
| ```{julia} | ||
| using QuantumToolbox | ||
|
|
||
| QuantumToolbox.versioninfo() | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,47 @@ | ||
| # qutip-julia-tutorials | ||
| QuantumToolbox.jl and HierarchicalEOM.jl Tutorials | ||
| # Tutorials for Quantum Toolbox in `Julia` | ||
|
|
||
| ## How to build the Website | ||
| [](https://qutip.org/qutip-julia-tutorials/) | ||
| [](https://github.com/qutip/qutip-julia-tutorials/actions/workflows/publish.yml) | ||
|
|
||
| The website is built using [Quarto](https://quarto.org). The steps to build the website are: | ||
| This repositories collects tutorials of different complexity for using quantum toolbox in [`Julia`](https://julialang.org/). The tutorials of the following packages are included: | ||
|
|
||
| 1. Load the environment variables: `source _environment` | ||
| 2. Run Quarto: `quarto publish gh-pages --no-browser` | ||
| - [`QuantumToolbox.jl`](https://github.com/qutip/QuantumToolbox.jl) | ||
| - [`HierarchicalEOM.jl`](https://github.com/qutip/HierarchicalEOM.jl) | ||
|
|
||
| ## How to build the tutorials locally ? | ||
|
|
||
| The tutorials are built upon [Quarto](https://quarto.org). | ||
|
|
||
| After installing both [`Julia`](https://julialang.org/) and [Quarto](https://quarto.org), the steps to build the tutorials are: | ||
|
|
||
| > [!NOTE] | ||
| > All the following commands should be run under the root folder of this repository: `/path/to/qutip-julia-tutorials/` | ||
|
|
||
| ### First, render the files: | ||
|
|
||
| ```shell | ||
| make render | ||
| ``` | ||
| or | ||
| ```shell | ||
| source _environment | ||
| julia --project=@. -e 'import Pkg; Pkg.instantiate(); Pkg.resolve(); Pkg.precompile()' | ||
| julia --project=@. -e 'using QuantumToolbox, HierarchicalEOM;' | ||
| quarto render | ||
| ``` | ||
|
|
||
| ### Second, preview it on a local site: | ||
|
|
||
| ```shell | ||
| make preview | ||
| ``` | ||
| or | ||
| ```shell | ||
| quarto preview | ||
| ``` | ||
|
|
||
| ## Contributing | ||
|
|
||
| You are most welcome to contribute to the tutorials development by forking this repository and sending pull requests (PRs) at the issues page. You can also help out with users' questions, or discuss proposed changes in the [QuTiP discussion group](https://groups.google.com/g/qutip). | ||
|
|
||
| For more information about contribution, including technical advice, please see the [Contributing to QuantumToolbox.jl](https://qutip.org/QuantumToolbox.jl/stable/resources/contributing) section of the documentation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1 @@ | ||
| JULIA_NUM_THREADS=16 | ||
| JULIA_CONDAPKG_BACKEND=Null | ||
| JULIA_PYTHONCALL_EXE=pyenv/bin/python |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.