Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/dependabot.yml
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"
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
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
13 changes: 13 additions & 0 deletions .github/workflows/SpellCheck.yml
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/typos@v1.28.3
54 changes: 54 additions & 0 deletions .github/workflows/publish.yml
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 }}
23 changes: 12 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
.DS_Store

# Files generated by invoking Julia with --code-coverage
*.jl.cov
*.jl.*.cov

# Files generated by invoking Julia with --track-allocation
*.jl.mem

Manifest.toml

.vscode

# System-specific files and directories generated by the BinaryProvider and BinDeps packages
# They contain absolute paths specific to the host computer, and so should not be committed
deps/deps.jl
Expand All @@ -13,17 +17,14 @@ deps/downloads/
deps/usr/
deps/src/

# Build artifacts for creating documentation generated by the Documenter package
docs/build/
docs/site/

# File generated by Pkg, the package manager, based on a corresponding Project.toml
# It records a fixed state of all packages used by the project. As such, it should not be
# committed for packages, but should be committed for applications that require a static
# environment.
# Manifest.toml
.ipynb_checkpoints
*.ipynb

pyenv/
/.quarto/
/_freeze/
/_site/
/_output/
*.html
*.json
/site_libs/
25 changes: 25 additions & 0 deletions CODE_OF_CONDUCT.md
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/
42 changes: 25 additions & 17 deletions LICENSE
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.
24 changes: 24 additions & 0 deletions Makefile
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
4 changes: 4 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[deps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
HierarchicalEOM = "a62dbcb7-80f5-4d31-9a88-8b19fd92b128"
QuantumToolbox = "6c2fb7c5-b903-41d2-bc5e-5a7c320b9fab"
13 changes: 13 additions & 0 deletions QuantumToolbox.jl/jaynes_cummings.qmd
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()
```
50 changes: 44 additions & 6 deletions README.md
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
[![tutorials](https://img.shields.io/badge/tutorials-stable-blue.svg)](https://qutip.org/qutip-julia-tutorials/)
[![Quarto Build](https://github.com/qutip/qutip-julia-tutorials/actions/workflows/publish.yml/badge.svg)](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.
2 changes: 0 additions & 2 deletions _environment
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
12 changes: 0 additions & 12 deletions _freeze/index/execute-results/html.json

This file was deleted.

Loading
Loading