diff --git a/README.md b/README.md index 8f01caf31..b75ed3fe1 100644 --- a/README.md +++ b/README.md @@ -55,19 +55,19 @@ and [Y.-T. Huang](https://github.com/ytdHuang). ## Introduction -[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. +[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. *With this package, moving from Python to Julia for quantum physics simulations has never been easier*, due to the similar syntax and functionalities. ## Features -QuantumToolbox.jl is equipped with a robust set of features: +`QuantumToolbox.jl` is equipped with a robust set of features: -- **Quantum State and Operator Manipulation:** Easily handle quantum states and operators with a rich set of tools, with the same functionalities as QuTiP. -- **Dynamical Evolution:** Advanced solvers for time evolution of quantum systems, thanks to the powerful [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl) package. +- **Quantum State and Operator Manipulation:** Easily handle quantum states and operators with a rich set of tools, with the same functionalities as `QuTiP`. +- **Dynamical Evolution:** Advanced solvers for time evolution of quantum systems, thanks to the powerful [`DifferentialEquations.jl`](https://github.com/SciML/DifferentialEquations.jl) package. - **GPU Computing:** Leverage GPU resources for high-performance computing. Simulate quantum dynamics directly on the GPU with the same syntax as the CPU case. - **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. -- **Easy Extension:** Easily extend the package, taking advantage of the Julia language features, like multiple dispatch and metaprogramming. +- **Easy Extension:** Easily extend the package, taking advantage of the `Julia` language features, like multiple dispatch and metaprogramming. ## Installation @@ -79,7 +79,7 @@ To install `QuantumToolbox.jl`, run the following commands inside Julia's intera using Pkg Pkg.add("QuantumToolbox") ``` -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: +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: ```julia-repl (1.10) pkg> add QuantumToolbox ``` @@ -94,7 +94,7 @@ QuantumToolbox.about() ## Brief Example -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). +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). Let's consider a quantum harmonic oscillator with a Hamiltonian given by: diff --git a/docs/make.jl b/docs/make.jl index a60d1c39b..1066c84d7 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -18,10 +18,10 @@ bib = CitationBibliography( const PAGES = [ "Home" => "index.md", "Getting Started" => [ - "Brief Example" => "getting_started.md", - "Key differences from QuTiP" => "qutip_differences.md", - "The Importance of Type-Stability" => "type_stability.md", - # "Cite QuantumToolbox.jl" => "cite.md", + "Brief Example" => "getting_started/brief_example.md", + "Key differences from QuTiP" => "getting_started/qutip_differences.md", + "The Importance of Type-Stability" => "getting_started/type_stability.md", + # "Cite QuantumToolbox.jl" => "getting_started/cite.md", ], "Users Guide" => [ "Basic Operations on Quantum Objects" => [ diff --git a/docs/src/.vitepress/config.mts b/docs/src/.vitepress/config.mts index 07c86952b..8ba7258d6 100644 --- a/docs/src/.vitepress/config.mts +++ b/docs/src/.vitepress/config.mts @@ -39,7 +39,7 @@ export default defineConfig({ // options for @mdit-vue/plugin-toc // https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-toc#options - toc: { level: [1, 2] }, + toc: { level: [2, 3, 4] }, // for API page, triggered by: [[toc]] config(md) { md.use(tabsMarkdownPlugin), diff --git a/docs/src/getting_started.md b/docs/src/getting_started/brief_example.md similarity index 75% rename from docs/src/getting_started.md rename to docs/src/getting_started/brief_example.md index 377f33ec9..b2a280753 100644 --- a/docs/src/getting_started.md +++ b/docs/src/getting_started/brief_example.md @@ -2,9 +2,11 @@ CurrentModule = QuantumToolbox ``` -## Brief Example +# Brief Example -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). +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). + +## CPU Computation Let's consider a quantum harmonic oscillator with a Hamiltonian given by: @@ -37,6 +39,9 @@ where ``\hat{\rho}`` is the density matrix, ``\gamma`` is the damping rate, and \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} ``` +!!! note "Lindblad master equation" + See [here](@ref doc-TE:Lindblad-Master-Equation-Solver) for more details about Lindblad master equation. + We now compute the time evolution of the system using the [`mesolve`](@ref) function, starting from the initial state ``\ket{\psi (0)} = \ket{3}``: ```julia @@ -54,15 +59,20 @@ sol = mesolve(H, ψ0, tlist, c_ops, e_ops = e_ops) 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`. -### Support for GPU calculation +## GPU Computation -We can easily pass the computation to the GPU, by simply passing all the `Qobj`s to the GPU: +!!! note "Extension for CUDA.jl" + `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. ```julia using QuantumToolbox using CUDA CUDA.allowscalar(false) # Avoid unexpected scalar indexing +``` +We can easily pass the computation to the GPU, by simply passing all the [`QuantumObject`](@ref)s to the GPU: + +```julia a_gpu = cu(destroy(N)) # The only difference in the code is the cu() function H_gpu = ω * a_gpu' * a_gpu diff --git a/docs/src/qutip_differences.md b/docs/src/getting_started/qutip_differences.md similarity index 100% rename from docs/src/qutip_differences.md rename to docs/src/getting_started/qutip_differences.md diff --git a/docs/src/type_stability.md b/docs/src/getting_started/type_stability.md similarity index 100% rename from docs/src/type_stability.md rename to docs/src/getting_started/type_stability.md diff --git a/docs/src/index.md b/docs/src/index.md index e864a0b95..f30f0a96d 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -12,7 +12,7 @@ hero: actions: - theme: brand text: Getting Started - link: /getting_started + link: /getting_started/brief_example - theme: alt text: Users Guide link: /users_guide/QuantumObject/QuantumObject @@ -35,7 +35,7 @@ features: - icon: title: GPU Computing details: Leverage GPU resources for high-performance computing. Simulate quantum dynamics directly on the GPU with the same syntax as the CPU case. - link: /getting_started + link: /users_guide/extensions/cuda - icon: title: Distributed Computing 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: # [Introduction](@id doc:Introduction) -[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. +[`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. *__With this package, moving from Python to Julia for quantum physics simulations has never been easier__*, due to the similar syntax and functionalities. @@ -59,7 +59,7 @@ To install `QuantumToolbox.jl`, run the following commands inside Julia's intera using Pkg Pkg.add("QuantumToolbox") ``` -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: +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: ```julia-repl (1.10) pkg> add QuantumToolbox ``` diff --git a/docs/src/resources/api.md b/docs/src/resources/api.md index 59f4d22d6..c12753b06 100644 --- a/docs/src/resources/api.md +++ b/docs/src/resources/api.md @@ -6,7 +6,7 @@ CurrentModule = QuantumToolbox **Table of contents** -[[toc]] +[[toc]] ## [Quantum object (Qobj) and type](@id doc-API:Quantum-object-and-type) diff --git a/docs/src/users_guide/extensions/cuda.md b/docs/src/users_guide/extensions/cuda.md index 11290c6f7..228a8acf1 100644 --- a/docs/src/users_guide/extensions/cuda.md +++ b/docs/src/users_guide/extensions/cuda.md @@ -4,7 +4,7 @@ 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. -This extension will be automatically loaded if user imports both `QuantumToolbox` and [`CUDA.jl`](https://github.com/JuliaGPU/CUDA.jl): +This extension will be automatically loaded if user imports both `QuantumToolbox.jl` and [`CUDA.jl`](https://github.com/JuliaGPU/CUDA.jl): ```julia using QuantumToolbox