Skip to content

Commit 6604f74

Browse files
committed
fix typos
1 parent a24547e commit 6604f74

File tree

12 files changed

+62
-62
lines changed

12 files changed

+62
-62
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ QuantumToolbox.jl is equipped with a robust set of features:
6565

6666
- **Quantum State and Operator Manipulation:** Easily handle quantum states and operators with a rich set of tools, with the same functionalities as QuTiP.
6767
- **Dynamical Evolution:** Advanced solvers for time evolution of quantum systems, thanks to the powerful [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl) package.
68-
- **GPU Computing:** Leverage GPU resources for high-performance computing. For example, you run the master equation direclty on the GPU with the same syntax as the CPU case.
68+
- **GPU Computing:** Leverage GPU resources for high-performance computing. For example, you run the master equation directly on the GPU with the same syntax as the CPU case.
6969
- **Distributed Computing:** Distribute the computation over multiple nodes (e.g., a cluster). For example, you can run hundreds of quantum trajectories in parallel on a cluster, with, again, the same syntax as the simple case.
7070
- **Easy Extension:** Easily extend the package, taking advantage of the Julia language features, like multiple dispatch and metaprogramming.
7171

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ QuantumToolbox.jl is equipped with a robust set of features:
1414

1515
- **Quantum State and Operator Manipulation:** Easily handle quantum states and operators with a rich set of tools, with the same functionalities as QuTiP.
1616
- **Dynamical Evolution:** Advanced solvers for time evolution of quantum systems, thanks to the powerful [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl) package.
17-
- **GPU Computing:** Leverage GPU resources for high-performance computing. For example, you run the master equation direclty on the GPU with the same syntax as the CPU case.
17+
- **GPU Computing:** Leverage GPU resources for high-performance computing. For example, you run the master equation directly on the GPU with the same syntax as the CPU case.
1818
- **Distributed Computing:** Distribute the computation over multiple nodes (e.g., a cluster). For example, you can run undreds of quantum trajectories in parallel on a cluster, with, again, the same syntax as the simple case.
1919
- **Easy Extension:** Easily extend the package, taking advantage of the Julia language features, like multiple dispatch and metaprogramming.
2020

docs/src/tutorials/lowrank.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# [Low rank master equation](@id doc-tutor:Low-rank-master-equation)
22

3-
In this tutorial, we will show how to solve the master equation using the low-rank method. For a detailed explaination of the method, we recommend to read the article [gravina2024adaptive](@cite).
3+
In this tutorial, we will show how to solve the master equation using the low-rank method. For a detailed explanation of the method, we recommend to read the article [gravina2024adaptive](@cite).
44

55
As a test, we will consider the dissipative Ising model with a transverse field. The Hamiltonian is given by
66

docs/src/users_guide/states_and_operators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ We can also create superpositions of states:
9999
ket = normalize(basis(5, 0) + basis(5, 1))
100100
```
101101

102-
where we have used the `normalize` function again to normalize the state. Apply the number opeartor again:
102+
where we have used the `normalize` function again to normalize the state. Apply the number operator again:
103103

104104
```@example states_and_operators
105105
n * ket

src/linear_maps.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ A **linear map** is a transformation `L` that satisfies:
1818
L(cu) = cL(u)
1919
```
2020
21-
It is typically represented as a matrix with dimensions given by `size`, and this abtract type helps to define this map when the matrix is not explicitly available.
21+
It is typically represented as a matrix with dimensions given by `size`, and this abstract type helps to define this map when the matrix is not explicitly available.
2222
2323
## Methods
2424

src/qobj/arithmetic_and_attributes.jl

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -511,17 +511,17 @@ Quantum Object: type=Operator dims=[2] size=(2, 2) ishermitian=true
511511
function ptrace(QO::QuantumObject{<:AbstractArray,KetQuantumObject}, sel::Union{AbstractVector{Int},Tuple})
512512
_non_static_array_warning("sel", sel)
513513

514-
ns = length(sel)
515-
if ns == 0 # return full trace for empty sel
514+
n_s = length(sel)
515+
if n_s == 0 # return full trace for empty sel
516516
return tr(ket2dm(QO))
517517
else
518-
nd = length(QO.dims)
518+
n_d = length(QO.dims)
519519

520-
(any(>(nd), sel) || any(<(1), sel)) && throw(
521-
ArgumentError("Invalid indices in `sel`: $(sel), the given QuantumObject only have $(nd) sub-systems"),
520+
(any(>(n_d), sel) || any(<(1), sel)) && throw(
521+
ArgumentError("Invalid indices in `sel`: $(sel), the given QuantumObject only have $(n_d) sub-systems"),
522522
)
523-
(ns != length(unique(sel))) && throw(ArgumentError("Duplicate selection indices in `sel`: $(sel)"))
524-
(nd == 1) && return ket2dm(QO) # ptrace should always return Operator
523+
(n_s != length(unique(sel))) && throw(ArgumentError("Duplicate selection indices in `sel`: $(sel)"))
524+
(n_d == 1) && return ket2dm(QO) # ptrace should always return Operator
525525
end
526526

527527
_sort_sel = sort(SVector{length(sel),Int}(sel))
@@ -534,17 +534,17 @@ ptrace(QO::QuantumObject{<:AbstractArray,BraQuantumObject}, sel::Union{AbstractV
534534
function ptrace(QO::QuantumObject{<:AbstractArray,OperatorQuantumObject}, sel::Union{AbstractVector{Int},Tuple})
535535
_non_static_array_warning("sel", sel)
536536

537-
ns = length(sel)
538-
if ns == 0 # return full trace for empty sel
537+
n_s = length(sel)
538+
if n_s == 0 # return full trace for empty sel
539539
return tr(QO)
540540
else
541-
nd = length(QO.dims)
541+
n_d = length(QO.dims)
542542

543-
(any(>(nd), sel) || any(<(1), sel)) && throw(
544-
ArgumentError("Invalid indices in `sel`: $(sel), the given QuantumObject only have $(nd) sub-systems"),
543+
(any(>(n_d), sel) || any(<(1), sel)) && throw(
544+
ArgumentError("Invalid indices in `sel`: $(sel), the given QuantumObject only have $(n_d) sub-systems"),
545545
)
546-
(ns != length(unique(sel))) && throw(ArgumentError("Duplicate selection indices in `sel`: $(sel)"))
547-
(nd == 1) && return QO
546+
(n_s != length(unique(sel))) && throw(ArgumentError("Duplicate selection indices in `sel`: $(sel)"))
547+
(n_d == 1) && return QO
548548
end
549549

550550
_sort_sel = sort(SVector{length(sel),Int}(sel))
@@ -554,61 +554,61 @@ end
554554
ptrace(QO::QuantumObject, sel::Int) = ptrace(QO, SVector(sel))
555555

556556
function _ptrace_ket(QO::AbstractArray, dims::Union{SVector,MVector}, sel)
557-
nd = length(dims)
557+
n_d = length(dims)
558558

559-
nd == 1 && return QO, dims
559+
n_d == 1 && return QO, dims
560560

561-
qtrace = filter(i -> i sel, 1:nd)
561+
qtrace = filter(i -> i sel, 1:n_d)
562562
dkeep = dims[sel]
563563
dtrace = dims[qtrace]
564-
nt = length(dtrace)
564+
n_t = length(dtrace)
565565

566566
# Concatenate qtrace and sel without losing the length information
567567
# Tuple(qtrace..., sel...)
568-
qtrace_sel = ntuple(Val(nd)) do i
569-
if i <= nt
568+
qtrace_sel = ntuple(Val(n_d)) do i
569+
if i <= n_t
570570
@inbounds qtrace[i]
571571
else
572-
@inbounds sel[i-nt]
572+
@inbounds sel[i-n_t]
573573
end
574574
end
575575

576576
vmat = reshape(QO, reverse(dims)...)
577-
topermute = reverse(nd + 1 .- qtrace_sel)
577+
topermute = reverse(n_d + 1 .- qtrace_sel)
578578
vmat = permutedims(vmat, topermute) # TODO: use PermutedDimsArray when Julia v1.11.0 is released
579579
vmat = reshape(vmat, prod(dkeep), prod(dtrace))
580580

581581
return vmat * vmat', dkeep
582582
end
583583

584584
function _ptrace_oper(QO::AbstractArray, dims::Union{SVector,MVector}, sel)
585-
nd = length(dims)
585+
n_d = length(dims)
586586

587-
nd == 1 && return QO, dims
587+
n_d == 1 && return QO, dims
588588

589-
qtrace = filter(i -> i sel, 1:nd)
589+
qtrace = filter(i -> i sel, 1:n_d)
590590
dkeep = dims[sel]
591591
dtrace = dims[qtrace]
592-
nk = length(dkeep)
593-
nt = length(dtrace)
594-
_2_nt = 2 * nt
592+
n_k = length(dkeep)
593+
n_t = length(dtrace)
594+
_2_n_t = 2 * n_t
595595

596596
# Concatenate qtrace and sel without losing the length information
597597
# Tuple(qtrace..., sel...)
598-
qtrace_sel = ntuple(Val(2 * nd)) do i
599-
if i <= nt
598+
qtrace_sel = ntuple(Val(2 * n_d)) do i
599+
if i <= n_t
600600
@inbounds qtrace[i]
601-
elseif i <= _2_nt
602-
@inbounds qtrace[i-nt] + nd
603-
elseif i <= _2_nt + nk
604-
@inbounds sel[i-_2_nt]
601+
elseif i <= _2_n_t
602+
@inbounds qtrace[i-n_t] + n_d
603+
elseif i <= _2_n_t + n_k
604+
@inbounds sel[i-_2_n_t]
605605
else
606-
@inbounds sel[i-_2_nt-nk] + nd
606+
@inbounds sel[i-_2_n_t-n_k] + n_d
607607
end
608608
end
609609

610610
ρmat = reshape(QO, reverse(vcat(dims, dims))...)
611-
topermute = reverse(2 * nd + 1 .- qtrace_sel)
611+
topermute = reverse(2 * n_d + 1 .- qtrace_sel)
612612
ρmat = permutedims(ρmat, topermute) # TODO: use PermutedDimsArray when Julia v1.11.0 is released
613613
ρmat = reshape(ρmat, prod(dkeep), prod(dkeep), prod(dtrace), prod(dtrace))
614614
res = map(tr, eachslice(ρmat, dims = (1, 2)))

src/qobj/boolean_functions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,6 @@ SciMLOperators.iscached(A::AbstractQuantumObject) = iscached(A.data)
100100
@doc raw"""
101101
SciMLOperators.isconstant(A::AbstractQuantumObject)
102102
103-
Test whether the [`AbstractQuantumObject`](@ref) `A` is constant in time. For a [`QuantumObject`](@ref), this function returns `true`, while for a [`QuantumObjectEvolution`](@ref), this function returns `true` if the operator is contant in time.
103+
Test whether the [`AbstractQuantumObject`](@ref) `A` is constant in time. For a [`QuantumObject`](@ref), this function returns `true`, while for a [`QuantumObjectEvolution`](@ref), this function returns `true` if the operator is constant in time.
104104
"""
105105
SciMLOperators.isconstant(A::AbstractQuantumObject) = isconstant(A.data)

src/qobj/superoperators.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function _sprepost(A, B) # for any other input types
2020
end
2121

2222
## if input is AbstractSciMLOperator
23-
## some of them are optimzed to speed things up
23+
## some of them are optimized to speed things up
2424
## the rest of the SciMLOperators will just use lazy tensor (and prompt a warning)
2525
_spre(A::MatrixOperator, Id::AbstractMatrix) = MatrixOperator(_spre(A.A, Id))
2626
_spre(A::ScaledOperator, Id::AbstractMatrix) = ScaledOperator(A.λ, _spre(A.L, Id))

src/steadystate.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ function _steadystate(
106106
idx_range = collect(1:N)
107107
rows = _get_dense_similar(L_tmp, N)
108108
cols = _get_dense_similar(L_tmp, N)
109-
datas = _get_dense_similar(L_tmp, N)
109+
_data = _get_dense_similar(L_tmp, N)
110110
fill!(rows, 1)
111111
copyto!(cols, N .* (idx_range .- 1) .+ idx_range)
112-
fill!(datas, weight)
113-
Tn = sparse(rows, cols, datas, N^2, N^2)
112+
fill!(_data, weight)
113+
Tn = sparse(rows, cols, _data, N^2, N^2)
114114
L_tmp = L_tmp + Tn
115115

116116
(haskey(kwargs, :Pl) || haskey(kwargs, :Pr)) && error("The use of preconditioners must be defined in the solver.")
@@ -160,11 +160,11 @@ function _steadystate(
160160
idx_range = collect(1:N)
161161
rows = _get_dense_similar(L_tmp, N)
162162
cols = _get_dense_similar(L_tmp, N)
163-
datas = _get_dense_similar(L_tmp, N)
163+
_data = _get_dense_similar(L_tmp, N)
164164
fill!(rows, 1)
165165
copyto!(cols, N .* (idx_range .- 1) .+ idx_range)
166-
fill!(datas, weight)
167-
Tn = sparse(rows, cols, datas, N^2, N^2)
166+
fill!(_data, weight)
167+
Tn = sparse(rows, cols, _data, N^2, N^2)
168168
L_tmp = L_tmp + Tn
169169

170170
ρss_vec = L_tmp \ v0 # This is still not supported on GPU, yet

src/time_evolution/mcsolve.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ function LindbladJumpAffect!(integrator)
3838
end
3939
cumsum!(cumsum_weights_mc, weights_mc)
4040
r = rand(traj_rng) * sum(weights_mc)
41-
collaps_idx = getindex(1:length(weights_mc), findfirst(>(r), cumsum_weights_mc))
42-
mul!(cache_mc, c_ops[collaps_idx], ψ)
41+
collapse_idx = getindex(1:length(weights_mc), findfirst(>(r), cumsum_weights_mc))
42+
mul!(cache_mc, c_ops[collapse_idx], ψ)
4343
normalize!(cache_mc)
4444
copyto!(integrator.u, cache_mc)
4545

4646
random_n[] = rand(traj_rng)
4747
jump_times[internal_params.jump_times_which_idx[]] = integrator.t
48-
jump_which[internal_params.jump_times_which_idx[]] = collaps_idx
48+
jump_which[internal_params.jump_times_which_idx[]] = collapse_idx
4949
internal_params.jump_times_which_idx[] += 1
5050
if internal_params.jump_times_which_idx[] > length(jump_times)
5151
resize!(jump_times, length(jump_times) + internal_params.jump_times_which_init_size)

0 commit comments

Comments
 (0)