Skip to content

Commit 98019fe

Browse files
Merge remote-tracking branch 'upstream/main' into dev/patch-1
2 parents b371a4c + db333c2 commit 98019fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+964
-168
lines changed

.buildkite/pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
steps:
33
- label: ":runner: Dynamically launch pipelines"
44
plugins:
5-
- staticfloat/forerunner:
5+
- staticfloat/forerunner: # CUDA.jl tests
66
watch:
77
- ".buildkite/pipeline.yml"
88
- ".buildkite/CUDA_Ext.yml"
99
- "src/**"
1010
- "ext/QuantumToolboxCUDAExt.jl"
1111
- "test/runtests.jl"
12-
- "test/cuda_ext.jl"
12+
- "test/ext-test/cuda_ext.jl"
1313
- "Project.toml"
1414
target: ".buildkite/CUDA_Ext.yml"
1515
agents:

.github/pull_request_template.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ Thank you for contributing to `QuantumToolbox.jl`! Please make sure you have fin
33

44
- [ ] Please read [Contributor Covenant Code of Conduct](https://github.com/qutip/QuantumToolbox.jl/blob/main/CODE_OF_CONDUCT.md)
55
- [ ] Any code changes were done in a way that does not break public API
6-
- [ ] Appropriate tests were added.
7-
- [ ] Any code changes should be formatted by running: `julia -e 'using JuliaFormatter; format(".")'`
8-
- [ ] All documentation (in `docs/` folder) related to code changes were updated.
6+
- [ ] Appropriate tests were added and tested locally by running: `make test`.
7+
- [ ] Any code changes should be `julia` formatted by running: `make format`.
8+
- [ ] All documents (in `docs/` folder) related to code changes were updated and able to build locally by running `make docs`.
99

1010
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.
1111

1212
## Description
1313
Describe the proposed change here.
1414

1515
## Related issues or PRs
16-
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 #1234
16+
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]
1717

18-
## Additional context
18+
## Additional context
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Runtests (Julia nightly)
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
paths:
8+
- '.github/workflows/CI-Julia-nightly.yml'
9+
- 'src/**'
10+
- 'ext/**'
11+
- 'test/runtests.jl'
12+
- 'test/core-test/**'
13+
- 'Project.toml'
14+
pull_request:
15+
branches:
16+
- 'main'
17+
paths:
18+
- '.github/workflows/CI-Julia-nightly.yml'
19+
- 'src/**'
20+
- 'ext/**'
21+
- 'test/runtests.jl'
22+
- 'test/core-test/**'
23+
- 'Project.toml'
24+
types:
25+
- opened
26+
- reopened
27+
- synchronize
28+
- ready_for_review
29+
30+
jobs:
31+
test:
32+
name: ${{ matrix.os }} - ${{ matrix.arch }} ( ${{ matrix.group }} )
33+
runs-on: ${{ matrix.os }}
34+
permissions: # needed to allow julia-actions/cache to delete old caches that it has created
35+
actions: write
36+
contents: read
37+
if: ${{ !github.event.pull_request.draft }}
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
version:
42+
- 'nightly'
43+
os:
44+
- 'ubuntu-latest'
45+
arch:
46+
- 'x64'
47+
group:
48+
- 'Core'
49+
- 'Code-Quality'
50+
51+
steps:
52+
- uses: actions/checkout@v4
53+
- uses: julia-actions/setup-julia@v2
54+
with:
55+
version: ${{ matrix.version }}
56+
arch: ${{ matrix.arch }}
57+
- uses: julia-actions/cache@v2
58+
- uses: julia-actions/julia-buildpkg@v1
59+
- uses: julia-actions/julia-runtest@v1
60+
env:
61+
GROUP: ${{ matrix.group }}

.github/workflows/CI.yml

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ on:
88
- '.github/workflows/CI.yml'
99
- 'src/**'
1010
- 'ext/**'
11-
- 'test/**'
11+
- 'test/runtests.jl'
12+
- 'test/core-test/**'
1213
- 'Project.toml'
1314
pull_request:
1415
branches:
@@ -17,7 +18,8 @@ on:
1718
- '.github/workflows/CI.yml'
1819
- 'src/**'
1920
- 'ext/**'
20-
- 'test/**'
21+
- 'test/runtests.jl'
22+
- 'test/core-test/**'
2123
- 'Project.toml'
2224
types:
2325
- opened
@@ -27,8 +29,8 @@ on:
2729

2830
jobs:
2931
test:
30-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} ( ${{ matrix.group }} )
31-
runs-on: ${{ matrix.os }}
32+
name: Julia ${{ matrix.version }} - ${{ matrix.node.os }} - ${{ matrix.node.arch }} ( ${{ matrix.group }} )
33+
runs-on: ${{ matrix.node.os }}
3234
permissions: # needed to allow julia-actions/cache to delete old caches that it has created
3335
actions: write
3436
contents: read
@@ -40,43 +42,37 @@ jobs:
4042
version:
4143
- '1.10' # oldest
4244
# - '1' # latest
43-
os:
44-
- ubuntu-latest
45-
- windows-latest
46-
arch:
47-
- x64
45+
node:
46+
- os: 'ubuntu-latest'
47+
arch: 'x64'
48+
- os: 'windows-latest'
49+
arch: 'x64'
50+
- os: 'macOS-latest'
51+
arch: 'arm64'
4852
group:
49-
- Core
53+
- 'Core'
5054

5155
include:
52-
# for core tests on macOS (M-series chip)
53-
- version: '1.10' # oldest
54-
os: 'macOS-latest'
55-
arch: 'x64'
56-
group: 'Core'
57-
# - version: '1' # latest
58-
# os: 'macOS-latest'
59-
# arch: 'arm64'
60-
# group: 'Core'
56+
# for code quality tests
57+
- version: '1'
58+
node:
59+
os: 'ubuntu-latest'
60+
arch: 'x64'
61+
group: 'Code-Quality'
6162

6263
# for core tests (intermediate versions)
6364
# - version: '1.x'
64-
# os: 'ubuntu-latest'
65-
# arch: 'x64'
65+
# node:
66+
# os: 'ubuntu-latest'
67+
# arch: 'x64'
6668
# group: 'Core'
6769

68-
# for code quality tests
69-
- version: '1'
70-
os: 'ubuntu-latest'
71-
arch: 'x64'
72-
group: 'Code-Quality'
73-
7470
steps:
7571
- uses: actions/checkout@v4
7672
- uses: julia-actions/setup-julia@v2
7773
with:
7874
version: ${{ matrix.version }}
79-
arch: ${{ matrix.arch }}
75+
arch: ${{ matrix.node.arch }}
8076
- uses: julia-actions/cache@v2
8177
- uses: julia-actions/julia-buildpkg@v1
8278
- uses: julia-actions/julia-runtest@v1

.github/workflows/FormatCheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ jobs:
4545
write(stdout, output)
4646
write(stdout, "-----\n")
4747
write(stdout, "Please format them by running the following command:\n")
48-
write(stdout, "julia -e \"using JuliaFormatter; format(\\\".\\\")\"")
48+
write(stdout, "make format")
4949
exit(1)
5050
end'

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
JULIA:=julia
2+
3+
default: help
4+
5+
docs:
6+
${JULIA} --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
7+
${JULIA} --project=docs docs/make.jl
8+
9+
format:
10+
${JULIA} -e 'using JuliaFormatter; format(".")'
11+
12+
test:
13+
${JULIA} --project -e 'using Pkg; Pkg.resolve(); Pkg.test()'
14+
15+
help:
16+
@echo "The following make commands are available:"
17+
@echo " - make docs: instantiate and build the documentation"
18+
@echo " - make format: format codes with JuliaFormatter"
19+
@echo " - make test: run the tests"
20+
21+
.PHONY: default docs format test help

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "QuantumToolbox"
22
uuid = "6c2fb7c5-b903-41d2-bc5e-5a7c320b9fab"
33
authors = ["Alberto Mercurio", "Luca Gravina", "Yi-Te Huang"]
4-
version = "0.13.1"
4+
version = "0.14.0"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ We can extract the expectation value of the number operator $\hat{a}^\dagger \ha
144144

145145
We can easily pass the computation to the GPU, by simply passing all the `Qobj`s to the GPU:
146146

147-
> **_NOTE:_** The described feature requires `Julia 1.9+`.
148-
149147
```julia
150148
using QuantumToolbox
151149
using CUDA

docs/README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,25 @@
33
## Working Directory
44
All the commands should be run under the root folder of the package: `/path/to/QuantumToolbox.jl/`
55

6-
## Build Pkg
6+
The document pages will be generated in the directory: `/path/to/QuantumToolbox.jl/docs/build/` (which is ignored by git).
7+
8+
## Method 1: Run with `make` command
9+
Run the following command:
10+
```shell
11+
make docs
12+
```
13+
14+
## Method 2: Run `julia` command manually
15+
16+
### Build Pkg
717
Run the following command:
818
```shell
919
julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
1020
```
1121
> **_NOTE:_** `Pkg.develop(PackageSpec(path=pwd()))` adds the local version of `QuantumToolbox` as dev-dependency instead of pulling from the registered version.
1222
13-
## Build Documentation
23+
### Build Documentation
1424
Run the following command:
1525
```shell
1626
julia --project=docs docs/make.jl
1727
```
18-
The document pages will be generated in the directory: `/path/to/QuantumToolbox.jl/docs/build/` (which is ignored by git).

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ const PAGES = [
2121
"Getting Started" => [
2222
"Introduction" => "index.md",
2323
"Key differences from QuTiP" => "qutip_differences.md",
24+
"The Importance of Type-Stability" => "type_stability.md",
2425
# "Cite QuantumToolbox.jl" => "cite.md",
2526
],
2627
"Users Guide" => [
2728
"Basic Operations on Quantum Objects" => [
2829
"users_guide/QuantumObject/QuantumObject.md",
2930
"users_guide/QuantumObject/QuantumObject_functions.md",
3031
],
31-
"The Importance of Type-Stability" => "users_guide/type_stability.md",
3232
"Manipulating States and Operators" => "users_guide/states_and_operators.md",
3333
"Tensor Products and Partial Traces" => "users_guide/tensor.md",
3434
"Time Evolution and Dynamics" => [

0 commit comments

Comments
 (0)