Skip to content

Commit

Permalink
fix typos in documentation (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
ytdHuang authored Dec 6, 2024
1 parent 0f2c4a1 commit ff73a5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
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

2 comments on commit ff73a5a

@albertomercurio
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/120803

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.23.1 -m "<description of version>" ff73a5a26872997b441e6b20eab2974f89524ce7
git push origin v0.23.1

Please sign in to comment.