Skip to content

Commit 625fbab

Browse files
committed
improve documentation for cluster
1 parent 07edec0 commit 625fbab

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

docs/src/users_guide/cluster.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,13 @@ end
218218
ωd_list = range(ωc - 3*g, ωc + 3*g, 100)
219219
F_list = [F]
220220

221-
ψ0 = tensor(fock(Nc, 0), basis(2, 1))
221+
ψ_list = [
222+
tensor(fock(Nc, 0), basis(2, 0)),
223+
tensor(fock(Nc, 0), basis(2, 1))
224+
]
222225
tlist = range(0, 20 / γ, 1000)
223226

224-
sol = mesolve_map(H, ψ0, tlist, c_ops; e_ops = e_ops, params = (ωq_list, ωd_list, F_list), ensemblealg = EnsembleSplitThreads())
227+
sol = mesolve_map(H, ψ_list, tlist, c_ops; e_ops = e_ops, params = (ωq_list, ωd_list, F_list), ensemblealg = EnsembleSplitThreads())
225228
```
226229

227-
Notice that we are using the [`mesolve_map`](@ref) function, which internally uses the `EnsembleProblem` function to parallelize the computation. The result is an array of `TimeEvolutionSol` objects, where each element corresponds to a specific combination of parameters. One can access the solution for a specific combination of parameters using indexing. For example, `sol[1, 1, 1].expect` will give the expectation values for the first combination of `ωq`, `ωd`, and `F`.
230+
Notice that we are using the [`mesolve_map`](@ref) function, which internally uses the `SciMLBase.EnsembleProblem` function to parallelize the computation of [`mesolveProblem`](@ref). The result is an array of `TimeEvolutionSol` objects, where each element corresponds to a specific combination of initial states and parameters. One can access the solution for a specific combination of initial states and parameters using indexing. For example, `sol[i,j,k,l].expect` will give the expectation values for the case of `ψ_list[i]`, `ωq_list[j]`, `ωd_list[k]`, and `F_list[l]`.

0 commit comments

Comments
 (0)