You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We wrapped several functions in CUDA and CUDA.CUSPARSE in order to not only converting QuantumObject.data into GPU arrays, but also changing the element type and word size (32 and 64) since some of the GPUs perform better in 32-bit. The functions are listed as follows (where input A is a QuantumObject):
13
13
14
14
Therefore, we wrapped several functions in `CUDA` and `CUDA.CUSPARSE` in order to not only converting a HEOMLS-matrix-type object into GPU arrays, but also changing the element type and word size (`32` and `64`) since some of the GPUs perform better in `32`-bit. The functions are listed as follows (where input `M` is a `AbstractHEOMLSMatrix`):
15
-
-`cu(M, word_size=64)` : Translate `M.data` into CUDA arrays with specified `word_size`.
15
+
-`cu(M, word_size=64)` : Translate `M.data` into CUDA arrays with specified `word_size` (default to `64`).
16
16
-`CuSparseMatrixCSC{T}(M)` : Translate `M.data` into the type `CuSparseMatrixCSC{T, Int32}`
17
17
18
18
### Demonstration
@@ -21,7 +21,6 @@ The extension will be automatically loaded if user imports the package `CUDA.jl`
21
21
22
22
```julia
23
23
using HierarchicalEOM
24
-
using LinearSolve # to change the solver for better GPU performance
### Solving steady state with CPU using linear-solve method
65
79
66
-
# solve steady state with CPU
80
+
```julia
67
81
ados_ss =steadystate(M_even_cpu);
68
82
```
69
83
70
-
!!! note "Note"
71
-
This extension does not support for solving [stationary state](@ref doc-Stationary-State) on GPU since it is not efficient and might get wrong solutions. If you really want to obtain the stationary state with GPU, you can repeatedly solve the [time evolution](@ref doc-Time-Evolution) until you find it.
84
+
### Solving steady state with GPU using linear-solve method
72
85
73
-
### Solving time evolution with CPU
86
+
```julia
87
+
ados_ss =steadystate(M_even_gpu);
88
+
```
89
+
90
+
### Solving steady state with CPU using ODE method
74
91
75
92
```julia
76
-
ados_list_cpu=HEOMsolve(M_even_cpu, ρ0, tlist)
93
+
ados_ss=steadystate(M_even_cpu, ψ0);
77
94
```
78
95
79
-
### Solving time evolution with GPU
96
+
### Solving steady state with GPU using ODE method
Copy file name to clipboardExpand all lines: docs/src/stationary_state.md
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,9 @@
3
3
4
4
To solve the stationary state of the reduced state and also all the [ADOs](@ref doc-ADOs), you only need to call [`steadystate`](@ref). Different methods are implemented with different input parameters of the function which makes it easy to switch between different methods. The output of the function [`steadystate`](@ref) for each methods will always be in the type of the auxiliary density operators [`ADOs`](@ref).
5
5
6
+
!!! compat "Extension for CUDA.jl"
7
+
`HierarchicalEOM.jl` provides an extension to support GPU ([`CUDA.jl`](https://github.com/JuliaGPU/CUDA.jl)) acceleration for [`steadystate`](@ref). See [here](@ref doc-ext-CUDA) for more details.
8
+
6
9
## Solve with [LinearSolve.jl](http://linearsolve.sciml.ai/stable/)
7
10
The first method is implemented by solving the linear problem
8
11
```math
@@ -16,6 +19,7 @@ The first method is implemented by solving the linear problem
16
19
M::AbstractHEOMLSMatrix
17
20
ados_steady =steadystate(M)
18
21
```
22
+
19
23
!!! warning "Unphysical solution"
20
24
This method does not require an initial condition ``\rho^{(m,n,p)}_{\textbf{j} \vert \textbf{q}}(0)``. Although this method works for most of the cases, it does not guarantee that one can obtain a physical (or unique) solution. If there is any problem within the solution, please try the second method which solves with an initial condition, as shown below.
Copy file name to clipboardExpand all lines: docs/src/time_evolution.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,7 @@ end
78
78
The first method is implemented by solving the ordinary differential equation (ODE). `HierarchicalEOM.jl` wraps some of the functions in [`DifferentialEquations.jl`](https://diffeq.sciml.ai/stable/), which is a very rich numerical library for solving the differential equations and provides many ODE solvers. It offers quite a few options for the user to tailor the solver to their specific needs. The default solver (and its corresponding settings) are chosen to suit commonly encountered problems and should work fine for most of the cases. If you require more specialized methods, such as the choice of algorithm, please refer to [DifferentialEquations solvers](@ref ODE-solvers) and also the documentation of [`DifferentialEquations.jl`](https://diffeq.sciml.ai/stable/).
79
79
80
80
!!! compat "Extension for CUDA.jl"
81
-
`HierarchicalEOM.jl` provides an extension to support GPU ([`CUDA.jl`](https://github.com/JuliaGPU/CUDA.jl)) acceleration for solving the time evolution (only for ODE method with time-independent system Hamiltonian). See [here](@ref doc-ext-CUDA) for more details.
81
+
`HierarchicalEOM.jl` provides an extension to support GPU ([`CUDA.jl`](https://github.com/JuliaGPU/CUDA.jl)) acceleration for [`HEOMsolve`](@ref)(only for ODE method). See [here](@ref doc-ext-CUDA) for more details.
0 commit comments