|
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