Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ytdHuang committed Nov 12, 2024
1 parent 2d24826 commit f1c4867
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 22 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
```
Expand All @@ -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:

Expand Down
8 changes: 4 additions & 4 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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" => [
Expand Down
2 changes: 1 addition & 1 deletion docs/src/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -35,7 +35,7 @@ features:
- icon: <img width="64" height="64" src="https://cuda.juliagpu.org/stable/assets/logo.png" />
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: <img width="64" height="64" src="https://img.icons8.com/?size=100&id=1W4Bkj363ov0&format=png&color=000000" />
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.
Expand All @@ -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.

Expand All @@ -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
```
Expand Down
2 changes: 1 addition & 1 deletion docs/src/resources/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CurrentModule = QuantumToolbox

**Table of contents**

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/src/users_guide/extensions/cuda.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f1c4867

Please sign in to comment.