You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/qobj/states.jl
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ It is also possible to specify the list of dimensions `dims` if different subsys
34
34
If you want to keep type stability, it is recommended to use `fock(N, j, dims=dims, sparse=Val(sparse))` instead of `fock(N, j, dims=dims, sparse=sparse)`. Consider also to use `dims` as a `Tuple` or `SVector` instead of `Vector`. See [this link](https://docs.julialang.org/en/v1/manual/performance-tips/#man-performance-value-type) and the [related Section](@ref doc:Type-Stability) about type stability for more details.
35
35
"""
36
36
functionfock(N::Int, j::Int=0; dims::Union{Int,AbstractVector{Int},Tuple}= N, sparse::Union{Bool,Val}=Val(false))
37
-
ifgetVal(makeVal(sparse))
37
+
ifgetVal(sparse)
38
38
array =sparsevec([j +1], [1.0+0im], N)
39
39
else
40
40
array =zeros(ComplexF64, N)
@@ -130,7 +130,7 @@ function thermal_dm(N::Int, n::Real; sparse::Union{Bool,Val} = Val(false))
130
130
β =log(1.0/ n +1.0)
131
131
N_list =Array{Float64}(0:N-1)
132
132
data =exp.(-β .* N_list)
133
-
ifgetVal(makeVal(sparse))
133
+
ifgetVal(sparse)
134
134
returnQuantumObject(spdiagm(0=> data ./sum(data)), Operator, N)
135
135
else
136
136
returnQuantumObject(diagm(0=> data ./sum(data)), Operator, N)
0 commit comments