Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/getting_started/type_stability.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
14 changes: 7 additions & 7 deletions docs/src/users_guide/time_evolution/time_dependent.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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))
Expand All @@ -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)``

Expand Down Expand Up @@ -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):
Expand All @@ -214,7 +214,7 @@ size(Ht)
```

```@example QobjEvo
shape(Ht) # synonym of size(H)
shape(Ht) # synonym of size(Ht)
```

```@example QobjEvo
Expand All @@ -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)
```
Expand Down
Loading