Skip to content

Commit 4e54a4c

Browse files
Change Homepage
1 parent 9bd2f62 commit 4e54a4c

File tree

3 files changed

+143
-138
lines changed

3 files changed

+143
-138
lines changed

docs/make.jl

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,10 @@ const DRAFT = false # set `true` to disable cell evaluation
1212

1313
bib = CitationBibliography(joinpath(@__DIR__, "src", "bibliography.bib"), style=:authoryear)
1414

15-
# const MathEngine = MathJax3(
16-
# Dict(
17-
# :loader => Dict("load" => ["[tex]/physics"]),
18-
# :tex => Dict(
19-
# "inlineMath" => [["\$", "\$"], ["\\(", "\\)"]],
20-
# "tags" => "ams",
21-
# "packages" => ["base", "ams", "autoload", "physics"],
22-
# ),
23-
# )
24-
# )
25-
2615
const PAGES = [
16+
"Home" => "index.md",
2717
"Getting Started" => [
28-
"Introduction" => "index.md",
18+
"Introduction" => "getting_started.md",
2919
"Key differences from QuTiP" => "qutip_differences.md",
3020
"The Importance of Type-Stability" => "type_stability.md",
3121
# "Cite QuantumToolbox.jl" => "cite.md",
@@ -72,24 +62,13 @@ makedocs(;
7262
repo = Remotes.GitHub("qutip", "QuantumToolbox.jl"),
7363
sitename = "QuantumToolbox.jl",
7464
pages = PAGES,
75-
# format = Documenter.HTML(;
76-
# prettyurls = get(ENV, "CI", "false") == "true",
77-
# canonical = "https://qutip.github.io/QuantumToolbox.jl",
78-
# edit_link = "main",
79-
# assets = ["assets/favicon.ico"],
80-
# mathengine = MathEngine,
81-
# size_threshold_ignore = ["api.md"],
82-
# ),
8365
format = DocumenterVitepress.MarkdownVitepress(
8466
repo = "https://qutip.github.io/QuantumToolbox.jl",
85-
# deploy_url = "https://qutip.org/QuantumToolbox.jl/",
8667
),
8768
draft = DRAFT,
8869
plugins = [bib],
8970
)
9071

91-
# deploydocs(; repo = "github.com/qutip/QuantumToolbox.jl", devbranch = "main")
92-
9372
deploydocs(;
9473
repo = "github.com/qutip/QuantumToolbox.jl",
9574
target = "build", # this is where Vitepress stores its output

docs/src/getting_started.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
```@meta
2+
CurrentModule = QuantumToolbox
3+
```
4+
5+
## [Installation](@id doc:Installation)
6+
7+
!!! note "Requirements"
8+
`QuantumToolbox.jl` requires `Julia 1.10+`.
9+
10+
To install `QuantumToolbox.jl`, run the following commands inside Julia's interactive session (also known as REPL):
11+
```julia
12+
using Pkg
13+
Pkg.add("QuantumToolbox")
14+
```
15+
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:
16+
```julia-REPL
17+
(1.10) pkg> add QuantumToolbox
18+
```
19+
More information about `Julia`'s package manager can be found at [`Pkg.jl`](https://julialang.github.io/Pkg.jl/v1/).
20+
21+
To load the package and check the version information, use either [`QuantumToolbox.versioninfo()`](@ref) or [`QuantumToolbox.about()`](@ref), namely
22+
```julia
23+
using QuantumToolbox
24+
QuantumToolbox.versioninfo()
25+
QuantumToolbox.about()
26+
```
27+
28+
## Brief Example
29+
30+
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).
31+
32+
Let's consider a quantum harmonic oscillator with a Hamiltonian given by:
33+
34+
```math
35+
\hat{H} = \omega \hat{a}^\dagger \hat{a}
36+
```
37+
38+
where ``\hat{a}`` and ``\hat{a}^\dagger`` are the annihilation and creation operators, respectively. We can define the Hamiltonian as follows:
39+
40+
```julia
41+
using QuantumToolbox
42+
43+
N = 20 # cutoff of the Hilbert space dimension
44+
ω = 1.0 # frequency of the harmonic oscillator
45+
46+
a = destroy(N) # annihilation operator
47+
48+
H = ω * a' * a
49+
```
50+
51+
We now introduce some losses in a thermal environment, described by the Lindblad master equation:
52+
53+
```math
54+
\frac{d \hat{\rho}}{dt} = -i [\hat{H}, \hat{\rho}] + \gamma \mathcal{D}[\hat{a}] \hat{\rho}
55+
```
56+
57+
where ``\hat{\rho}`` is the density matrix, ``\gamma`` is the damping rate, and ``\mathcal{D}[\hat{a}]`` is the Lindblad dissipator, defined as:
58+
59+
```math
60+
\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}
61+
```
62+
63+
We now compute the time evolution of the system using the [`mesolve`](@ref) function, starting from the initial state ``\ket{\psi (0)} = \ket{3}``:
64+
65+
```julia
66+
γ = 0.1 # damping rate
67+
68+
ψ0 = fock(N, 3) # initial state
69+
70+
tlist = range(0, 10, 100) # time list
71+
72+
c_ops = [sqrt(γ) * a]
73+
e_ops = [a' * a]
74+
75+
sol = mesolve(H, ψ0, tlist, c_ops, e_ops = e_ops)
76+
```
77+
78+
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`.
79+
80+
### Support for GPU calculation
81+
82+
We can easily pass the computation to the GPU, by simply passing all the `Qobj`s to the GPU:
83+
84+
```julia
85+
using QuantumToolbox
86+
using CUDA
87+
CUDA.allowscalar(false) # Avoid unexpected scalar indexing
88+
89+
a_gpu = cu(destroy(N)) # The only difference in the code is the cu() function
90+
91+
H_gpu = ω * a_gpu' * a_gpu
92+
93+
ψ0_gpu = cu(fock(N, 3))
94+
95+
c_ops = [sqrt(γ) * a_gpu]
96+
e_ops = [a_gpu' * a_gpu]
97+
98+
sol = mesolve(H_gpu, ψ0_gpu, tlist, c_ops, e_ops = e_ops)
99+
```

docs/src/index.md

Lines changed: 42 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,42 @@
1-
```@meta
2-
CurrentModule = QuantumToolbox
3-
```
4-
5-
# QuantumToolbox.jl Documentation
6-
7-
[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.
8-
9-
*With this package, moving from Python to Julia for quantum physics simulations has never been easier*, due to the similar syntax and functionalities.
10-
11-
## Features
12-
13-
QuantumToolbox.jl is equipped with a robust set of features:
14-
15-
- **Quantum State and Operator Manipulation:** Easily handle quantum states and operators with a rich set of tools, with the same functionalities as QuTiP.
16-
- **Dynamical Evolution:** Advanced solvers for time evolution of quantum systems, thanks to the powerful [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl) package.
17-
- **GPU Computing:** Leverage GPU resources for high-performance computing. For example, you run the master equation directly on the GPU with the same syntax as the CPU case.
18-
- **Distributed Computing:** Distribute the computation over multiple nodes (e.g., a cluster). For example, you can run undreds of quantum trajectories in parallel on a cluster, with, again, the same syntax as the simple case.
19-
- **Easy Extension:** Easily extend the package, taking advantage of the Julia language features, like multiple dispatch and metaprogramming.
20-
21-
## [Installation](@id doc:Installation)
22-
23-
!!! note "Requirements"
24-
`QuantumToolbox.jl` requires `Julia 1.10+`.
25-
26-
To install `QuantumToolbox.jl`, run the following commands inside Julia's interactive session (also known as REPL):
27-
```julia
28-
using Pkg
29-
Pkg.add("QuantumToolbox")
30-
```
31-
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:
32-
```julia-REPL
33-
(1.10) pkg> add QuantumToolbox
34-
```
35-
More information about `Julia`'s package manager can be found at [`Pkg.jl`](https://julialang.github.io/Pkg.jl/v1/).
36-
37-
To load the package and check the version information, use either [`QuantumToolbox.versioninfo()`](@ref) or [`QuantumToolbox.about()`](@ref), namely
38-
```julia
39-
using QuantumToolbox
40-
QuantumToolbox.versioninfo()
41-
QuantumToolbox.about()
42-
```
43-
44-
## Brief Example
45-
46-
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).
47-
48-
Let's consider a quantum harmonic oscillator with a Hamiltonian given by:
49-
50-
```math
51-
\hat{H} = \omega \hat{a}^\dagger \hat{a}
52-
```
53-
54-
where ``\hat{a}`` and ``\hat{a}^\dagger`` are the annihilation and creation operators, respectively. We can define the Hamiltonian as follows:
55-
56-
```julia
57-
using QuantumToolbox
58-
59-
N = 20 # cutoff of the Hilbert space dimension
60-
ω = 1.0 # frequency of the harmonic oscillator
61-
62-
a = destroy(N) # annihilation operator
63-
64-
H = ω * a' * a
65-
```
66-
67-
We now introduce some losses in a thermal environment, described by the Lindblad master equation:
68-
69-
```math
70-
\frac{d \hat{\rho}}{dt} = -i [\hat{H}, \hat{\rho}] + \gamma \mathcal{D}[\hat{a}] \hat{\rho}
71-
```
72-
73-
where ``\hat{\rho}`` is the density matrix, ``\gamma`` is the damping rate, and ``\mathcal{D}[\hat{a}]`` is the Lindblad dissipator, defined as:
74-
75-
```math
76-
\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}
77-
```
78-
79-
We now compute the time evolution of the system using the [`mesolve`](@ref) function, starting from the initial state ``\ket{\psi (0)} = \ket{3}``:
80-
81-
```julia
82-
γ = 0.1 # damping rate
83-
84-
ψ0 = fock(N, 3) # initial state
85-
86-
tlist = range(0, 10, 100) # time list
87-
88-
c_ops = [sqrt(γ) * a]
89-
e_ops = [a' * a]
90-
91-
sol = mesolve(H, ψ0, tlist, c_ops, e_ops = e_ops)
92-
```
93-
94-
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`.
95-
96-
### Support for GPU calculation
97-
98-
We can easily pass the computation to the GPU, by simply passing all the `Qobj`s to the GPU:
99-
100-
```julia
101-
using QuantumToolbox
102-
using CUDA
103-
CUDA.allowscalar(false) # Avoid unexpected scalar indexing
104-
105-
a_gpu = cu(destroy(N)) # The only difference in the code is the cu() function
106-
107-
H_gpu = ω * a_gpu' * a_gpu
108-
109-
ψ0_gpu = cu(fock(N, 3))
110-
111-
c_ops = [sqrt(γ) * a_gpu]
112-
e_ops = [a_gpu' * a_gpu]
113-
114-
sol = mesolve(H_gpu, ψ0_gpu, tlist, c_ops, e_ops = e_ops)
115-
```
1+
```@raw html
2+
---
3+
# https://vitepress.dev/reference/default-theme-home-page
4+
layout: home
5+
6+
hero:
7+
name: "QuantumToolbox.jl"
8+
tagline: High-performance quantum simulations made simple
9+
image:
10+
src: /logo.png
11+
alt: QuantumToolbox
12+
actions:
13+
- theme: brand
14+
text: Getting Started
15+
link: /getting_started
16+
- theme: alt
17+
text: View on Github
18+
link: https://github.com/qutip/QuantumToolbox.jl
19+
- theme: alt
20+
text: API
21+
link: /api
22+
23+
24+
features:
25+
- icon: <img width="64" height="64" src="https://docs.sciml.ai/DiffEqDocs/stable/assets/logo.png" alt="markdown"/>
26+
title: Dynamical Evolution
27+
details: Advanced solvers for time evolution of quantum systems, thanks to the powerful DifferentialEquations.jl package.
28+
link: /users_guide/time_evolution/intro
29+
- icon: <img width="64" height="64" src="https://cuda.juliagpu.org/stable/assets/logo.png" />
30+
title: GPU Computing
31+
details: Leverage GPU resources for high-performance computing. Simulate the master equation directly on the GPU with the same syntax as the CPU case.
32+
link: /getting_started
33+
- icon: <img width="64" height="64" src="https://img.icons8.com/?size=100&id=1W4Bkj363ov0&format=png&color=000000" />
34+
title: Distributed Computing
35+
details: Distribute the computation over multiple nodes (e.g., a cluster). Simulate undreds of quantum trajectories in parallel on a cluster, with, again, the same syntax as the simple case.
36+
link: /users_guide/time_evolution/mcsolve
37+
---
38+
```
39+
40+
[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.
41+
42+
*__With this package, moving from Python to Julia for quantum physics simulations has never been easier__*, due to the similar syntax and functionalities.

0 commit comments

Comments
 (0)