From ff73a5a26872997b441e6b20eab2974f89524ce7 Mon Sep 17 00:00:00 2001 From: Yi-Te Huang <44385685+ytdHuang@users.noreply.github.com> Date: Fri, 6 Dec 2024 17:56:13 +0900 Subject: [PATCH] fix typos in documentation (#336) --- docs/src/getting_started/type_stability.md | 2 +- .../users_guide/time_evolution/time_dependent.md | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/src/getting_started/type_stability.md b/docs/src/getting_started/type_stability.md index b9a31f20..1daabb06 100644 --- a/docs/src/getting_started/type_stability.md +++ b/docs/src/getting_started/type_stability.md @@ -144,7 +144,7 @@ nothing # hide Thus, we highly recommend using `Vector` only when we are sure that it contains elements of the same type, and only when we don't need to know its size at compile time. On the other hand, `Tuple`s are less flexible but more efficient in terms of performance. A third option is to use the `SVector` type from the [StaticArrays.jl](https://github.com/JuliaArrays/StaticArrays.jl) package. This is similar to `Vector`, where the elements should have the same type, but it is fixed-size and immutable. One may ask when it is necessary to know the array size at compile time. A practical example is the case of [`ptrace`](@ref), where it internally reshapes the quantum state into a tensor whose dimensions depend on the number of subsystems. We will see this in more detail in the next section. -## The [`QuantumObject`](@ref) internal structure +## The `QuantumObject` internal structure Before making a practical example, let's see the internal structure of the [`QuantumObject`](@ref) type. As an example, we consider the case of three qubits, and we study the internal structure of the ``\hat{\sigma}_x^{(2)}`` operator: diff --git a/docs/src/users_guide/time_evolution/time_dependent.md b/docs/src/users_guide/time_evolution/time_dependent.md index ba9c0042..5c5a0b11 100644 --- a/docs/src/users_guide/time_evolution/time_dependent.md +++ b/docs/src/users_guide/time_evolution/time_dependent.md @@ -22,7 +22,7 @@ H_t = QobjEvo(sigmax(), coef) ``` !!! warning "The inputs of coefficient function" - Please note that although we didn't use the argument `p` in the definition of `coef`, we still need to put a dummy input `p` in the declaration of `coef`. We will describe how to use the parameter `p` in the section [Using parameters](@ref doc-TE:Using-parameters). + Please note that although we didn't use the argument `p` in the definition of `coef`, we still need to put a dummy input `p` (in front of `t`) in the declaration of `coef`. We will describe how to use the parameter `p` in the section [Using parameters](@ref doc-TE:Using-parameters). The [`QobjEvo`](@ref) can also be generated by specifying many pairs of time-independent [`Qobj`](@ref) and time-dependent coefficient function. For instance, we will look at a case with the total Hamiltonian ``\hat{H}(t)`` can be separate into time-independent part (``\hat{H}_0``) and a summation of many time-dependent operators, which takes the form: @@ -131,8 +131,8 @@ e_ops = [ ] # solve dynamics -exp_me = mesolve(H_t, ψ0, tlist, c_ops, e_ops = e_ops; progress_bar = Val(false)).expect -exp_mc = mcsolve(H_t, ψ0, tlist, c_ops, e_ops = e_ops; progress_bar = Val(false)).expect +exp_me = mesolve(H_t, ψ0, tlist, c_ops; e_ops = e_ops, progress_bar = Val(false)).expect +exp_mc = mcsolve(H_t, ψ0, tlist, c_ops; e_ops = e_ops, ntraj = 100, progress_bar = Val(false)).expect # plot by CairoMakie.jl fig = Figure(size = (500, 350)) @@ -149,7 +149,7 @@ axislegend(ax, position = :rc) fig ``` -The result from [`mesolve`](@ref) is identical to that shown in the examples, the [`mcsolve`](@ref) however will be noticeably off, suggesting we should increase the number of trajectories `ntraj` for this example. +The result from [`mesolve`](@ref) is identical to that shown in the examples, the [`mcsolve`](@ref) however will be noticeably off, suggesting we should increase the number of trajectories `ntraj = 100` for this example. In addition, we can also consider the decay of a simple Harmonic oscillator with time-varying decay rate ``\gamma_1(t)`` @@ -190,7 +190,7 @@ fig coef(p, t) = sin(π * t) Ht = QobjEvo(sigmaz(), coef) -Ht(0.25) +Ht(0.25) # t = 0.25 ``` [`QuantumObjectEvolution`](@ref) shares a lot of properties with the [`QuantumObject`](@ref): @@ -214,7 +214,7 @@ size(Ht) ``` ```@example QobjEvo -shape(Ht) # synonym of size(H) +shape(Ht) # synonym of size(Ht) ``` ```@example QobjEvo @@ -234,7 +234,7 @@ println(isoperbra(Ht)) # operator-bra println(issuper(Ht)) # super operator println(isconstant(Ht)) # time-independent or not println(ishermitian(Ht)) # Hermitian -println(isherm(Ht)) # synonym of ishermitian(a) +println(isherm(Ht)) # synonym of ishermitian(Ht) println(issymmetric(Ht)) # symmetric println(isposdef(Ht)) # positive definite (and Hermitian) ```