Skip to content

Commit 2b05fa4

Browse files
authored
update documentation (#302)
1 parent 2d24826 commit 2b05fa4

File tree

9 files changed

+32
-22
lines changed

9 files changed

+32
-22
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,19 @@ and [Y.-T. Huang](https://github.com/ytdHuang).
5555

5656
## Introduction
5757

58-
[QuantumToolbox.jl](https://github.com/qutip/QuantumToolbox.jl) is a cutting-edge Julia package designed for quantum physics simulations, closely emulating the popular Python [QuTiP](https://github.com/qutip/qutip) package. It uniquely combines the simplicity and power of Julia with advanced features like GPU acceleration and distributed computing, making simulation of quantum systems more accessible and efficient.
58+
[QuantumToolbox.jl](https://github.com/qutip/QuantumToolbox.jl) is a cutting-edge [`Julia`](https://julialang.org/) package designed for quantum physics simulations, closely emulating the popular Python [`QuTiP`](https://github.com/qutip/qutip) package. It uniquely combines the simplicity and power of [`Julia`](https://julialang.org/) with advanced features like GPU acceleration and distributed computing, making simulation of quantum systems more accessible and efficient.
5959

6060
*With this package, moving from Python to Julia for quantum physics simulations has never been easier*, due to the similar syntax and functionalities.
6161

6262
## Features
6363

64-
QuantumToolbox.jl is equipped with a robust set of features:
64+
`QuantumToolbox.jl` is equipped with a robust set of features:
6565

66-
- **Quantum State and Operator Manipulation:** Easily handle quantum states and operators with a rich set of tools, with the same functionalities as QuTiP.
67-
- **Dynamical Evolution:** Advanced solvers for time evolution of quantum systems, thanks to the powerful [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl) package.
66+
- **Quantum State and Operator Manipulation:** Easily handle quantum states and operators with a rich set of tools, with the same functionalities as `QuTiP`.
67+
- **Dynamical Evolution:** Advanced solvers for time evolution of quantum systems, thanks to the powerful [`DifferentialEquations.jl`](https://github.com/SciML/DifferentialEquations.jl) package.
6868
- **GPU Computing:** Leverage GPU resources for high-performance computing. Simulate quantum dynamics directly on the GPU with the same syntax as the CPU case.
6969
- **Distributed Computing:** Distribute the computation over multiple nodes (e.g., a cluster). For example, you can run hundreds of quantum trajectories in parallel on a cluster, with, again, the same syntax as the simple case.
70-
- **Easy Extension:** Easily extend the package, taking advantage of the Julia language features, like multiple dispatch and metaprogramming.
70+
- **Easy Extension:** Easily extend the package, taking advantage of the `Julia` language features, like multiple dispatch and metaprogramming.
7171

7272
## Installation
7373

@@ -79,7 +79,7 @@ To install `QuantumToolbox.jl`, run the following commands inside Julia's intera
7979
using Pkg
8080
Pkg.add("QuantumToolbox")
8181
```
82-
Alternatively, this can also be done in Julia's [Pkg REPL](https://julialang.github.io/Pkg.jl/v1/getting-started/) by pressing the key `]` in the REPL to use the package mode, and then type the following command:
82+
Alternatively, this can also be done in `Julia`'s [Pkg REPL](https://julialang.github.io/Pkg.jl/v1/getting-started/) by pressing the key `]` in the REPL to use the package mode, and then type the following command:
8383
```julia-repl
8484
(1.10) pkg> add QuantumToolbox
8585
```
@@ -94,7 +94,7 @@ QuantumToolbox.about()
9494

9595
## Brief Example
9696

97-
We now provide a brief example to demonstrate the similarity between [QuantumToolbox.jl](https://github.com/qutip/QuantumToolbox.jl) and [QuTiP](https://github.com/qutip/qutip).
97+
We now provide a brief example to demonstrate the similarity between [`QuantumToolbox.jl`](https://github.com/qutip/QuantumToolbox.jl) and [`QuTiP`](https://github.com/qutip/qutip).
9898

9999
Let's consider a quantum harmonic oscillator with a Hamiltonian given by:
100100

docs/make.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ bib = CitationBibliography(
1818
const PAGES = [
1919
"Home" => "index.md",
2020
"Getting Started" => [
21-
"Brief Example" => "getting_started.md",
22-
"Key differences from QuTiP" => "qutip_differences.md",
23-
"The Importance of Type-Stability" => "type_stability.md",
24-
# "Cite QuantumToolbox.jl" => "cite.md",
21+
"Brief Example" => "getting_started/brief_example.md",
22+
"Key differences from QuTiP" => "getting_started/qutip_differences.md",
23+
"The Importance of Type-Stability" => "getting_started/type_stability.md",
24+
# "Cite QuantumToolbox.jl" => "getting_started/cite.md",
2525
],
2626
"Users Guide" => [
2727
"Basic Operations on Quantum Objects" => [

docs/src/.vitepress/config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default defineConfig({
3939

4040
// options for @mdit-vue/plugin-toc
4141
// https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-toc#options
42-
toc: { level: [1, 2] },
42+
toc: { level: [2, 3, 4] }, // for API page, triggered by: [[toc]]
4343

4444
config(md) {
4545
md.use(tabsMarkdownPlugin),

docs/src/getting_started.md renamed to docs/src/getting_started/brief_example.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
CurrentModule = QuantumToolbox
33
```
44

5-
## Brief Example
5+
# Brief Example
66

7-
We now provide a brief example to demonstrate the similarity between [QuantumToolbox.jl](https://github.com/qutip/QuantumToolbox.jl) and [QuTiP](https://github.com/qutip/qutip).
7+
We now provide a brief example to demonstrate the similarity between [`QuantumToolbox.jl`](https://github.com/qutip/QuantumToolbox.jl) and [`QuTiP`](https://github.com/qutip/qutip).
8+
9+
## CPU Computation
810

911
Let's consider a quantum harmonic oscillator with a Hamiltonian given by:
1012

@@ -37,6 +39,9 @@ where ``\hat{\rho}`` is the density matrix, ``\gamma`` is the damping rate, and
3739
\mathcal{D}[\hat{a}]\hat{\rho} = \hat{a}\hat{\rho}\hat{a}^\dagger - \frac{1}{2}\hat{a}^\dagger\hat{a}\hat{\rho} - \frac{1}{2}\hat{\rho}\hat{a}^\dagger\hat{a}
3840
```
3941

42+
!!! note "Lindblad master equation"
43+
See [here](@ref doc-TE:Lindblad-Master-Equation-Solver) for more details about Lindblad master equation.
44+
4045
We now compute the time evolution of the system using the [`mesolve`](@ref) function, starting from the initial state ``\ket{\psi (0)} = \ket{3}``:
4146

4247
```julia
@@ -54,15 +59,20 @@ sol = mesolve(H, ψ0, tlist, c_ops, e_ops = e_ops)
5459

5560
We can extract the expectation value of the number operator ``\hat{a}^\dagger \hat{a}`` with the command `sol.expect`, and the states with the command `sol.states`.
5661

57-
### Support for GPU calculation
62+
## GPU Computation
5863

59-
We can easily pass the computation to the GPU, by simply passing all the `Qobj`s to the GPU:
64+
!!! note "Extension for CUDA.jl"
65+
`QuantumToolbox.jl` provides an extension to support GPU computation. To trigger the extension, you need to install and import [`CUDA.jl`](https://github.com/JuliaGPU/CUDA.jl) together with `QuantumToolbox.jl`. See [here](@ref doc:CUDA) for more details.
6066

6167
```julia
6268
using QuantumToolbox
6369
using CUDA
6470
CUDA.allowscalar(false) # Avoid unexpected scalar indexing
71+
```
6572

73+
We can easily pass the computation to the GPU, by simply passing all the [`QuantumObject`](@ref)s to the GPU:
74+
75+
```julia
6676
a_gpu = cu(destroy(N)) # The only difference in the code is the cu() function
6777

6878
H_gpu = ω * a_gpu' * a_gpu
File renamed without changes.
File renamed without changes.

docs/src/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ hero:
1212
actions:
1313
- theme: brand
1414
text: Getting Started
15-
link: /getting_started
15+
link: /getting_started/brief_example
1616
- theme: alt
1717
text: Users Guide
1818
link: /users_guide/QuantumObject/QuantumObject
@@ -35,7 +35,7 @@ features:
3535
- icon: <img width="64" height="64" src="https://cuda.juliagpu.org/stable/assets/logo.png" />
3636
title: GPU Computing
3737
details: Leverage GPU resources for high-performance computing. Simulate quantum dynamics directly on the GPU with the same syntax as the CPU case.
38-
link: /getting_started
38+
link: /users_guide/extensions/cuda
3939
- icon: <img width="64" height="64" src="https://img.icons8.com/?size=100&id=1W4Bkj363ov0&format=png&color=000000" />
4040
title: Distributed Computing
4141
details: Distribute the computation over multiple nodes (e.g., a cluster). Simulate hundreds of quantum trajectories in parallel on a cluster, with, again, the same syntax as the simple case.
@@ -45,7 +45,7 @@ features:
4545

4646
# [Introduction](@id doc:Introduction)
4747

48-
[QuantumToolbox.jl](https://github.com/qutip/QuantumToolbox.jl) is a cutting-edge Julia package designed for quantum physics simulations, closely emulating the popular Python [QuTiP](https://github.com/qutip/qutip) package. It uniquely combines the simplicity and power of Julia with advanced features like GPU acceleration and distributed computing, making simulation of quantum systems more accessible and efficient. Taking advantage of the Julia language features (like multiple dispatch and metaprogramming), QuantumToolbox.jl is designed to be easily extendable, allowing users to build upon the existing functionalities.
48+
[`QuantumToolbox.jl`](https://github.com/qutip/QuantumToolbox.jl) is a cutting-edge [`Julia`](https://julialang.org/) package designed for quantum physics simulations, closely emulating the popular [`Python QuTiP`](https://github.com/qutip/qutip) package. It uniquely combines the simplicity and power of Julia with advanced features like GPU acceleration and distributed computing, making simulation of quantum systems more accessible and efficient. Taking advantage of the [`Julia`](https://julialang.org/) language features (like multiple dispatch and metaprogramming), [`QuantumToolbox.jl`](https://github.com/qutip/QuantumToolbox.jl) is designed to be easily extendable, allowing users to build upon the existing functionalities.
4949

5050
*__With this package, moving from Python to Julia for quantum physics simulations has never been easier__*, due to the similar syntax and functionalities.
5151

@@ -59,7 +59,7 @@ To install `QuantumToolbox.jl`, run the following commands inside Julia's intera
5959
using Pkg
6060
Pkg.add("QuantumToolbox")
6161
```
62-
Alternatively, this can also be done in Julia's [Pkg REPL](https://julialang.github.io/Pkg.jl/v1/getting-started/) by pressing the key `]` in the REPL to use the package mode, and then type the following command:
62+
Alternatively, this can also be done in `Julia`'s [Pkg REPL](https://julialang.github.io/Pkg.jl/v1/getting-started/) by pressing the key `]` in the REPL to use the package mode, and then type the following command:
6363
```julia-repl
6464
(1.10) pkg> add QuantumToolbox
6565
```

docs/src/resources/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ CurrentModule = QuantumToolbox
66

77
**Table of contents**
88

9-
[[toc]]
9+
[[toc]] <!-- the level setting is in ".vitepress/config.mts" -->
1010

1111
## [Quantum object (Qobj) and type](@id doc-API:Quantum-object-and-type)
1212

docs/src/users_guide/extensions/cuda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
This is an extension to support `QuantumObject.data` conversion from standard dense and sparse CPU arrays to GPU ([`CUDA.jl`](https://github.com/JuliaGPU/CUDA.jl)) arrays.
66

7-
This extension will be automatically loaded if user imports both `QuantumToolbox` and [`CUDA.jl`](https://github.com/JuliaGPU/CUDA.jl):
7+
This extension will be automatically loaded if user imports both `QuantumToolbox.jl` and [`CUDA.jl`](https://github.com/JuliaGPU/CUDA.jl):
88

99
```julia
1010
using QuantumToolbox

0 commit comments

Comments
 (0)